ld_compile: force CFLAGS really necessary ?

Mike Frysinger vapier@gentoo.org
Wed Aug 29 13:56:00 GMT 2007


On Wednesday 29 August 2007, Nick Clifton wrote:
> > maybe something like the attached patch
> >
> > 2007-08-28  Mike Frysinger  <vapier@gentoo.org>
> >
> > 	* lib/ld-lib.exp (default_ld_compile): Pull in global CXXFLAGS and
> > 	add it to $flags when $source matches *.cc.
> > 	(run_ld_link_exec_tests): Pull in global CXXFLAGS and execute CXX
> > 	with CXXFLAGS when $lang matches c++.
> > 	(run_cc_link_tests): Likewise.
>
> Nice, but I see one small niggle:
>
>    * Not all C++ source files use the .cc file extension.  Earlier on in
> proc default_ld_compile there is code to determine if the compiler is gcc
> or g++, maybe you could tap into that ?

i think you mean latter on in default_ld_compile ?  are you referring to this 
code snippet ?
    set ccexe [string replace $ccexe 0 [string last "/" $ccexe] ""]
    if {[string match "*gcc*" $ccexe] || [string match "*++*" $ccexe]} then {
	set flags "$gcc_gas_flag $flags"
    }

> Of course you can then argue that 
> we are not handling the case when the compiler is not gcc/g++.  I am not
> sure if this is a problem worth worrying about, but if it is we could
> always generate another patch to add an optional fourth parameter to
> default_ld_compile which specifies the language being compiled.

i think i'm happy with the current stuff ...
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 827 bytes
Desc: This is a digitally signed message part.
URL: <https://sourceware.org/pipermail/binutils/attachments/20070829/675bd7f2/attachment.sig>


More information about the Binutils mailing list