[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 1.5.18: suppressing non-C language checks / pass flags to cc in link

From: Ralf Wildenhues
Subject: Re: 1.5.18: suppressing non-C language checks / pass flags to cc in link mode
Date: Sat, 26 Nov 2005 12:02:57 +0100
User-agent: Mutt/1.5.9i

[ BTW, Paul, I believe you mail setup is a bit broken.  Please do not
set Mail-Followup-To: to your mail address only, if you want the mailing
list to be included.  At least mutt needs manual override for this. ]

* Paul Jakma wrote on Sat, Nov 26, 2005 at 11:28:05AM CET:
> On Sat, 26 Nov 2005, Ralf Wildenhues wrote:
> >Well, in a way libtool *cannot* allow all flags through, and thus 
> >*has* to know about them.  At least it has to know whether a 
> >certain flag eats an argument or not.
> Well, one simple trick at least would be if:
>       -XCClink "x y z"
> would result in cc being invoked with x, y and z as seperate 
> arguments. Unfortunately it does not, cc is then invoked with 'x y z' 
> as one arg ;).

Should work already if you use `-Wc,x,y,z' or `-Wl,x,y,z', unless I am
missing something obvious.   Your example does not work because
arguments with spaces are legitimate.

> >And it cannot allow flags through without knowing, when those flags 
> >alter linking behavior which libtool assumes differently.  Also 
> >note that on some systems $LD is used for linking rather than $CC 
> >or $CXX.
> Right. But libtool knows that, no point passing CFLAGS to ld.


> I tried going through libtool.m4 to find an easy fix, but it's not 
> very obvious.

ltmain is mostly responsible.  And if you can describe all your needs,
we can fix them.

> >>The only other alternative then, it seems, is to write your 
> >>configure script to include some kind of extra 'LINK_MODE_CFLAGS' 
> >>variable, then tack that on to CFLAGS and also generate an 
> >>additional 'LI5BBTOOL_CCLINK_FLAGS' variable for each word in 
> >>LINK_MODE_CFLAGS combined with -XCClinker and then use 
> >>LIBTOOL_CCLINK_FLAGS in prog_LDADD in your's.
> >something like this, yes.  It would be nice to adjust Autoconf/Automake
> >to cope better with this situation.
> Well, a libtool autoconf macro to specify the CClink flags to use 
> might be nice.


> >Which flags do you need passed through?
> For gcc:
>       -fpic
>       -fPIC
>       -fpie
>       -fPIE

The last two I might understand, but why do you ever need -fpic/-fPIC?
Libtool should add these itself in the right cases.

For position-independent executables, we have a TODO item.  I haven't
looked closely at the semantics nor understood it completely.  If
someone can help out here or point at good documentation, great!
(What happens if you have partially PIC, partially PIE code, which parts
need to be compiled PIE/linked PIE, on which systems, what happens if
you try to link in non-PIC code...)

> (I think you have some support for -fpic already?)


> For Sun Studio, the ones i'm interested in:
>       -xarch=....

Is allowed through by 1.5.20.
There is a related fix in branch-1-5 not in 1.5.20 though.

>       -xtarget=....


For the others I need to check documentation first (thanks for the
pointer!), will reply later.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]