This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: PATCH: LDFLAGS handling in V3
- From: Alexandre Oliva <aoliva at redhat dot com>
- To: Mark Mitchell <mark at codesourcery dot com>
- Cc: libstdc++ at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Fri, 07 Oct 2005 10:56:28 -0300
- Subject: Re: PATCH: LDFLAGS handling in V3
- References: <200507272135.j6RLZHH2024117@sethra.codesourcery.com><or8xzrgaze.fsf@livre.redhat.lsd.ic.unicamp.br><42E806F0.4050704@codesourcery.com><42E81D58.5000108@codesourcery.com><or64uuai3x.fsf@livre.redhat.lsd.ic.unicamp.br><42E927F8.2090004@codesourcery.com><orpst29142.fsf@livre.redhat.lsd.ic.unicamp.br><42E98339.2070803@codesourcery.com><42E9AD58.5020809@codesourcery.com><orbr25qcci.fsf@livre.oliva.athome.lsd.ic.unicamp.br><43461472.2030801@codesourcery.com>
On Oct 7, 2005, Mark Mitchell <mark@codesourcery.com> wrote:
> Alexandre Oliva wrote:
>> One thing that got me a bit confused is that you're quoting every
>> single argument with -Xcompiler here. Is this really what you mean?
>> This will render libtool unable to recognize some arguments that it is
>> supposed to handle itself; -Ldir, -lib, -static, -all-static, -rpath
>> dir and -Rdir come to mind. -rpath is probably the most difficult to
>> handle correctly, because you must not only leave itself alone, but
>> also the subsequent argument.
> I'm not sure.
> Does libtool prefix those with "-Wl," by default?
No, but that doesn't matter. What I'm talking about is that, if you
prefix them with -Xcompiler, then *libtool* will not see them. E.g.,
-all-static is a libtool-only flag, and if libtool doesn't see it
because you prefix it with -Xcompiler, you'll get an error from the
compiler driver. -static has slightly-different meanings too. Ditto
for -rpath, that is equivalent to -R for the linker, not necessarily
so for the compiler driver and definitely different for libtool.
The ones I mentioned above must not get the -Xcompiler prefix at all,
so that libtool can see them and operate on them.
> But, I'm not really sure what people do with LDFLAGS; all I know is
> that I want to pass "--sysroot" there.
Perhaps use -fsysroot instead, and arrange for your script to prefix
only -f* flags with -Xcompiler, as opposed to handling everything
except what you know to be special for libtool? Or maybe extend to
--* as well, since libtool doesn't handle double-dash arguments?
> Do you want me to try to skip the -Xcompiler for the options you list?
Definitely. Not doing so would certainly break things.
Thanks,
--
Alexandre Oliva http://www.lsd.ic.unicamp.br/~oliva/
Red Hat Compiler Engineer aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist oliva@{lsd.ic.unicamp.br, gnu.org}