[prev in list] [next in list] [prev in thread] [next in thread]
List: pcc-list
Subject: Re: [Pcc] [PATCH] Make PCC use the musl dynamic linker when target=*linux-musl
From: Isaac Dunham <ibid.ag () gmail ! com>
Date: 2014-12-24 23:23:38
Message-ID: 20141224232337.GA1802 () newbook
[Download RAW message or body]
On Wed, Dec 24, 2014 at 02:36:59PM +0100, u-lxna@aetey.se wrote:
> On Tue, Dec 23, 2014 at 09:17:25PM -0500, Rich Felker wrote:
> > > "In all cases" is a quite strong statement.
> >
> > -Wl passes options to the linker, and the order relative to other
> > things is after all default options (options, not libraries), and
> > properly interspersed with -l options, with default -l options at the
> > end. Changing this would break basically anything so it's not going to
> > happen.
>
> I am not so sure that corner cases are well supported and stable.
>
> You suggest to wrap as
> pcc "$@" -Wl,-dynamic-linker <the-desired-path-to-the-linker>
>
> What happens when the user supplies -Wl,-dynamic-linker on her own,
> which one wins? I do not know and I appreciate if you point me
> to the relevant point in the documentation.
>
> A quick look did not give me anything beyond
>
> "The default dynamic linker is normally correct; don't use this unless
> you know what you are doing."
The last specification of -dynamic-linker /PATH/TO/LD.SO
(which is what -Wl,-dynamic-linker,/PATH/TO/LD.SO is expanded to when it
reaches the linker) wins, even when specified 4 times.
The compiler-specified dynamic linker is an early linker option:
everything on the command line comes after it.
From this, I would conclude that
pcc -Wl,-dynamic-linker,${LDSO} "$@"
duplicates the expected behavior better than Rich's proposal;
unlike gcc, pcc has no option requiring the first position.
(gcc -V $MAJOR.$MINOR will call gcc-$MAJOR.$MINOR, and must come
first on the command line.)
HTH,
Isaac Dunham
_______________________________________________
Pcc mailing list
Pcc@lists.ludd.ltu.se
https://lists.ludd.ltu.se/cgi-bin/mailman/listinfo/pcc
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic