This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: ld_compile: force CFLAGS really necessary ?


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

Attachment: signature.asc
Description: This is a digitally signed message part.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]