[m-rev.] for post-commit review: link/search/buildsys

Zoltan Somogyi zoltan.somogyi at runbox.com
Tue Jul 1 16:32:29 AEST 2025



On Tue, 1 Jul 2025 11:09:08 +1000, Julien Fischer <jfischer at opturion.com> wrote:
> On Mon, 30 Jun 2025 at 21:10, Zoltan Somogyi <zoltan.somogyi at runbox.com> wrote:
> > diff --git a/tests/warnings/help_text.err_exp b/tests/warnings/help_text.err_exp
> > index a01035521..19d64141e 100644
> > --- a/tests/warnings/help_text.err_exp
> > +++ b/tests/warnings/help_text.err_exp
> > @@ -2710,27 +2710,29 @@ Options for linking
> >
> >      --ld-flags <options>
> >      --no-ld-flags
> > -        Specify options to be passed to the linker command invoked by ml to
> > +        Specify options to be passed to the linker command invoked by `ml' to
> >          link an executable. These options will not be quoted when passed to the
> > -        shell. Use `ml --print-link-command' to find out which command is used.
> > +        shell. Use `ml --print-link-command' to find out what the linker
> > +        command is.
> >
> >      --ld-flag <option>
> >          Specify a single word option to be passed to the linker command invoked
> > -        by ml to link an executable. The word will be quoted when passed to the
> > -        shell. Use `ml --print-link-command' to find out which command is used.
> > +        by `ml' to link an executable. The word will be quoted when passed to
> > +        the shell. Use `ml --print-link-command' to find out what the linker
> > +        command is.
> >
> >      --ld-libflags <options>
> >      --no-ld-libflags
> > -        Specify options to be passed to the linker command invoked by ml to
> > +        Specify options to be passed to the linker command invoked by `ml' to
> >          link a shared library. These options will not be quoted when passed to
> > -        the shell. Use `ml --print-shared-lib-link-command' to find out which
> > -        command is used.
> > +        the shell. Use `ml --print-shared-lib-link-command' to find out what
> > +        the linker command is.
> >
> >      --ld-libflag <option>
> >          Specify a single word option to be passed to the linker command invoked
> > -        by ml to link a shared library. The word will be quoted when passed to
> > -        the shell. Use `ml --print-shared-lib-link-command' to find out which
> > -        command is used.
> > +        by `ml' to link a shared library. The word will be quoted when passed
> > +        to the shell. Use `ml --print-shared-lib-link-command' to find out what
> > +        the linker command is.
> 
> This is an existing problem ...
> 
> Are the values of any of the above actually passed to the ml script?

A search for the quoted versions (--ld-flag and --ld-libflag) shows that
their only use is to add their quoted argument to their unquoted version,
which is fair enough.

> Their only
> use appears to be in compiler/link_target_code.m, which suggests that this
> is *not* the case to me.
>
> In any case, I would suggest removing all references to the ml script above,
> since all of those options are definitely used in the case where we invoke the
> linker directly.

Actually, by default, we pass those options neither to ml nor directly to the linker ld,
but to gcc, which in turn will pass them to ld.

It has been a very long time since I looked at this issue, but you may know the
answer to the obvious question: is there any difference between the form
in which you have to pass these options to gcc, and the form expected by ld?

> ml --print-link-command can be replaced by mmc --output-link-command
> ml --print-shared-lib-link-command can be replaced by mmc
> --output-shared-lib-link-command.
> 
> The rest of the diff looks fine.

Thank you. The attached diff addresses the issues you reported today,
though it may need tweaking, depending on your answer to the question above.

Zoltan.



-------------- next part --------------
A non-text attachment was scrubbed...
Name: DIFF.j2
Type: application/octet-stream
Size: 8147 bytes
Desc: not available
URL: <http://lists.mercurylang.org/archives/reviews/attachments/20250701/f6ccd1e9/attachment.obj>


More information about the reviews mailing list