ld built without --hash-style, Ch5, Fedora Core 6 -> glibc config failure

Bauke Jan Douma bjdouma at xs4all.nl
Sun Nov 26 08:45:45 PST 2006


Amadeus wrote on 26-11-06 17:16:
> Amadeus wrote:
>> Greg Schafer wrote:
>>>> configure:1980: checking whether the C compiler (gcc  ) works
>>>> configure:1996: gcc -o conftest    conftest.c  1>&5
>>>> /home/lfs/binutils/bin/ld: unrecognized option '--hash-style=gnu'
>>>> /home/lfs/binutils/bin/ld: use the --help option for usage information
>>>> collect2: ld returned 1 exit status
>>>> configure: failed program was:
>>>>     
>>>
>>> This looks very similar to an old problem, possibly one of the last
>>> remaining bugs with the current build method. Details here:
>>>
>>> http://www.diy-linux.org/pipermail/diy-linux-dev/2004-August/000050.html
>>>
>>> Try starting from scratch, this time compiling Binutils-Pass1 like this:
>>>
>>> CC="gcc -B/usr/bin/" \
>>>   ../binutils-2.17/configure --prefix=/tools --disable-nls
>>>
>>> and similar for GCC-Pass1.
>>>   
>> Thanks! That worked a treat (specifying CC="gcc -B/usr/bin" \ for 
>> binutils and gcc pass 1).
> Hmm, maybe I spoke too soon.
> 
> After following the instructions up until DejaGNU, running `make check` 
> reveals:
> 
> /tools/bin/ld: unrecognized option '--hash-style=gnu'
> /tools/bin/ld: use the --help option for usage information
> collect2: ld returned 1 exit status
> make[4]: *** [unit] Error 1
> make[4]: Leaving directory 
> `/home/lfs/sources/dejagnu-1.4.4/testsuite/libdejagnu'
> ...
> 
> Checking config.log for DejaGNU:
> 
> configure:1742: checking for gcc
> configure:1758: found /tools/bin/gcc
> 
> [lfs at poff dejagnu-1.4.4]$ /tools/bin/gcc -dumpspecs
> *asm:
> %{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*}
> 
> *asm_debug:
> %{gstabs*:--gstabs}%{!gstabs*:%{g*:--gdwarf2}}
> 
> *asm_final:
> 
> 
> *asm_options:
> %a %Y %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}
> 
> *invoke_as:
> %{!S:-o %|.s |
> as %(asm_options) %|.s %A }
> 
> *cpp:
> %{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}
> 
> *cpp_options:
> %(cpp_unique_options) %1 %{m*} %{std*&ansi&trigraphs} %{W*&pedantic*} 
> %{w} %{f*} %{g*:%{!g0:%{!fno-working-directory:-fworking-directory}}} 
> %{O*} %{undef} %{save-temps:-fpch-preprocess}
> 
> *cpp_debug_options:
> %{d*}
> 
> *cpp_unique_options:
> %{C|CC:%{!E:%eGCC does not support -C or -CC without -E}} %{!Q:-quiet} 
> %{nostdinc*} %{C} %{CC} %{v} %{I*&F*} %{P} %I %{MD:-MD 
> %{!o:%b.d}%{o*:%.d%*}} %{MMD:-MMD %{!o:%b.d}%{o*:%.d%*}} %{M} %{MM} 
> %{MF*} %{MG} %{MP} %{MQ*} %{MT*} %{!E:%{!M:%{!MM:%{MD|MMD:%{o*:-MQ 
> %*}}}}} %{remap} %{g3:-dD} %{H} %C %{D*&U*&A*} %{i*} %Z %i 
> %{fmudflap:-D_MUDFLAP -include mf-runtime.h} %{fmudflapth:-D_MUDFLAP 
> -D_MUDFLAPTH -include mf-runtime.h} %{E|M|MM:%W{o*}}
> 
> *trad_capable_cpp:
> cc1 -E %{traditional|ftraditional|traditional-cpp:-traditional-cpp}
> 
> *cc1:
> %(cc1_cpu) %{profile:-p}
> 
> *cc1_options:
> %{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are 
> incompatible}} %1 %{!Q:-quiet} -dumpbase %B %{d*} %{m*} %{a*} 
> %{c|S:%{o*:-auxbase-strip %*}%{!o*:-auxbase %b}}%{!c:%{!S:-auxbase %b}} 
> %{g*} %{O*} %{W*&pedantic*} %{w} %{std*&ansi&trigraphs} %{v:-version} 
> %{pg:-p} %{p} %{f*} %{undef} %{Qn:-fno-ident} %{--help:--help} 
> %{--target-help:--target-help} %{!fsyntax-only:%{S:%W{o*}%{!o*:-o 
> %b.s}}} %{fsyntax-only:-o %j} %{-param*} 
> %{fmudflap|fmudflapth:-fno-builtin -fno-merge-constants} 
> %{coverage:-fprofile-arcs -ftest-coverage}
> 
> *cc1plus:
> 
> 
> *link_gcc_c_sequence:
> %{static:--start-group} %G %L %{static:--end-group}%{!static:%G}
> 
> *link_ssp:
> %{fstack-protector:}
> 
> *endfile:
> %{ffast-math|funsafe-math-optimizations:crtfastmath.o%s}    
> %{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s
> 
> *link:
> %{!static:--eh-frame-hdr} -m %(link_emulation) %{shared:-shared}   
> %{!shared:     %{!ibcs:       %{!static:     
> %{rdynamic:-export-dynamic}     %{!dynamic-linker:-dynamic-linker 
> %(dynamic_linker)}}   %{static:-static}}}
> 
> *lib:
> %{pthread:-lpthread}    %{shared:-lc}    %{!shared:%{mieee-fp:-lieee} 
> %{profile:-lc_p}%{!profile:-lc}}
> 
> *mfwrap:
> %{static: %{fmudflap|fmudflapth:  --wrap=malloc --wrap=free 
> --wrap=calloc --wrap=realloc --wrap=mmap --wrap=munmap --wrap=alloca} 
> %{fmudflapth: --wrap=pthread_create}} %{fmudflap|fmudflapth: --wrap=main}
> 
> *mflib:
> %{fmudflap|fmudflapth: -export-dynamic}
> 
> *libgcc:
> %{static|static-libgcc:-lgcc 
> -lgcc_eh}%{!static:%{!static-libgcc:%{!shared-libgcc:-lgcc --as-needed 
> -lgcc_s --no-as-needed}%{shared-libgcc:-lgcc_s%{!shared: -lgcc}}}}
> 
> *startfile:
> %{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}}    
> crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}
> 
> *switches_need_spaces:
> 
> 
> *cross_compile:
> 0
> 
> *version:
> 4.1.1
> 
> *multilib:
> . ;
> 
> *multilib_defaults:
> 
> 
> *multilib_extra:
> 
> 
> *multilib_matches:
> 
> 
> *multilib_exclusions:
> 
> 
> *multilib_options:
> 
> 
> *linker:
> collect2
> 
> *link_libgcc:
> %D
> 
> *md_exec_prefix:
> 
> 
> *md_startfile_prefix:
> 
> 
> *md_startfile_prefix_1:
> 
> 
> *startfile_prefix_spec:
> 
> 
> *sysroot_spec:
> --sysroot=%R
> 
> *sysroot_suffix_spec:
> 
> 
> *sysroot_hdrs_suffix_spec:
> 
> 
> *cc1_cpu:
> %{!mtune*: %{m386:mtune=i386 %n`-m386' is deprecated. Use `-march=i386' 
> or `-mtune=i386' instead.
> } %{m486:-mtune=i486 %n`-m486' is deprecated. Use `-march=i486' or 
> `-mtune=i486' instead.
> } %{mpentium:-mtune=pentium %n`-mpentium' is deprecated. Use 
> `-march=pentium' or `-mtune=pentium' instead.
> } %{mpentiumpro:-mtune=pentiumpro %n`-mpentiumpro' is deprecated. Use 
> `-march=pentiumpro' or `-mtune=pentiumpro' instead.
> } %{mcpu=*:-mtune=%* %n`-mcpu=' is deprecated. Use `-mtune=' or 
> '-march=' instead.
> }} %<mcpu=* %{mintel-syntax:-masm=intel %n`-mintel-syntax' is 
> deprecated. Use `-masm=intel' instead.
> } %{mno-intel-syntax:-masm=att %n`-mno-intel-syntax' is deprecated. Use 
> `-masm=att' instead.
> }
> 
> *link_emulation:
> elf_i386
> 
> *dynamic_linker:
> /lib/ld-linux.so.2
> 
> *link_command:
> %{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:    %(linker) %l %{pie:-pie} 
> %X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} %{r}    %{s} %{t} %{u*} %{x} 
> %{z} %{Z} %{!A:%{!nostdlib:%{!nostartfiles:%S}}}    %{static:} %{L*} 
> %(mfwrap) %(link_libgcc) %o %(mflib)    
> %{fprofile-arcs|fprofile-generate|coverage:-lgcov}    
> %{!nostdlib:%{!nodefaultlibs:%(link_ssp) %(link_gcc_c_sequence)}}    
> %{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} }}}}}}
> 
> And the FC6 specs:
> 
> [lfs at poff dejagnu-1.4.4]$ /usr/bin/gcc -dumpspecs
> *asm:
> %{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*}
> 
> *asm_debug:
> %{gstabs*:--gstabs}%{!gstabs*:%{g*:--gdwarf2}}
> 
> *asm_final:
> 
> 
> *asm_options:
> %a %Y %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}
> 
> *invoke_as:
> %{!S:-o %|.s |
> as %(asm_options) %|.s %A }
> 
> *cpp:
> %{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}
> 
> *cpp_options:
> %(cpp_unique_options) %1 %{m*} %{std*&ansi&trigraphs} %{W*&pedantic*} 
> %{w} %{f*} %{g*:%{!g0:%{!fno-working-directory:-fworking-directory}}} 
> %{O*} %{undef} %{save-temps:-fpch-preprocess}
> 
> *cpp_debug_options:
> %{d*}
> 
> *cpp_unique_options:
> %{C|CC:%{!E:%eGCC does not support -C or -CC without -E}} %{!Q:-quiet} 
> %{nostdinc*} %{C} %{CC} %{v} %{I*&F*} %{P} %I %{MD:-MD 
> %{!o:%b.d}%{o*:%.d%*}} %{MMD:-MMD %{!o:%b.d}%{o*:%.d%*}} %{M} %{MM} 
> %{MF*} %{MG} %{MP} %{MQ*} %{MT*} %{!E:%{!M:%{!MM:%{MD|MMD:%{o*:-MQ 
> %*}}}}} %{remap} %{g3:-dD} %{H} %C %{D*&U*&A*} %{i*} %Z %i 
> %{fmudflap:-D_MUDFLAP -include mf-runtime.h} %{fmudflapth:-D_MUDFLAP 
> -D_MUDFLAPTH -include mf-runtime.h} %{E|M|MM:%W{o*}}
> 
> *trad_capable_cpp:
> cc1 -E %{traditional|ftraditional|traditional-cpp:-traditional-cpp}
> 
> *cc1:
> %(cc1_cpu) %{profile:-p}
> 
> *cc1_options:
> %{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are 
> incompatible}} %1 %{!Q:-quiet} -dumpbase %B %{d*} %{m*} %{a*} 
> %{c|S:%{o*:-auxbase-strip %*}%{!o*:-auxbase %b}}%{!c:%{!S:-auxbase %b}} 
> %{g*} %{O*} %{W*&pedantic*} %{w} %{std*&ansi&trigraphs} %{v:-version} 
> %{pg:-p} %{p} %{f*} %{undef} %{Qn:-fno-ident} %{--help:--help} 
> %{--target-help:--target-help} %{!fsyntax-only:%{S:%W{o*}%{!o*:-o 
> %b.s}}} %{fsyntax-only:-o %j} %{-param*} 
> %{fmudflap|fmudflapth:-fno-builtin -fno-merge-constants} 
> %{coverage:-fprofile-arcs -ftest-coverage}
> 
> *cc1plus:
> 
> 
> *link_gcc_c_sequence:
> %{static:--start-group} %G %L %{static:--end-group}%{!static:%G}
> 
> *link_ssp:
> %{fstack-protector:}
> 
> *endfile:
> %{ffast-math|funsafe-math-optimizations:crtfastmath.o%s}    
> %{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s
> 
> *link:
> %{!static:--eh-frame-hdr} -m %(link_emulation) --hash-style=gnu 
> %{shared:-shared}   %{!shared:     %{!ibcs:       %{!static:    
> %{rdynamic:-export-dynamic}    %{!dynamic-linker:-dynamic-linker 
> %(dynamic_linker)}}    %{static:-static}}}
> 
> *lib:
> %{pthread:-lpthread}    %{shared:-lc}    %{!shared:%{mieee-fp:-lieee} 
> %{profile:-lc_p}%{!profile:-lc}}
> 
> *mfwrap:
> %{static: %{fmudflap|fmudflapth:  --wrap=malloc --wrap=free 
> --wrap=calloc --wrap=realloc --wrap=mmap --wrap=munmap --wrap=alloca} 
> %{fmudflapth: --wrap=pthread_create}} %{fmudflap|fmudflapth: --wrap=main}
> 
> *mflib:
> %{fmudflap|fmudflapth: -export-dynamic}
> 
> *link_gomp:
> 
> 
> *libgcc:
> %{static|static-libgcc:-lgcc 
> -lgcc_eh}%{!static:%{!static-libgcc:%{!shared-libgcc:-lgcc --as-needed 
> -lgcc_s --no-as-needed}%{shared-libgcc:-lgcc_s%{!shared: -lgcc}}}}
> 
> *startfile:
> %{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}}    
> crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}
> 
> *switches_need_spaces:
> 
> 
> *cross_compile:
> 0
> 
> *version:
> 4.1.1
> 
> *multilib:
> . ;
> 
> *multilib_defaults:
> 
> 
> *multilib_extra:
> 
> 
> *multilib_matches:
> 
> 
> *multilib_exclusions:
> 
> 
> *multilib_options:
> 
> 
> *linker:
> collect2
> 
> *link_libgcc:
> %D
> 
> *md_exec_prefix:
> 
> 
> *md_startfile_prefix:
> 
> 
> *md_startfile_prefix_1:
> 
> 
> *startfile_prefix_spec:
> 
> 
> *sysroot_spec:
> --sysroot=%R
> 
> *sysroot_suffix_spec:
> 
> 
> *sysroot_hdrs_suffix_spec:
> 
> 
> *cc1_cpu:
> %{!mtune*: %{m386:mtune=i386 %n`-m386' is deprecated. Use `-march=i386' 
> or `-mtune=i386' instead.
> } %{m486:-mtune=i486 %n`-m486' is deprecated. Use `-march=i486' or 
> `-mtune=i486' instead.
> } %{mpentium:-mtune=pentium %n`-mpentium' is deprecated. Use 
> `-march=pentium' or `-mtune=pentium' instead.
> } %{mpentiumpro:-mtune=pentiumpro %n`-mpentiumpro' is deprecated. Use 
> `-march=pentiumpro' or `-mtune=pentiumpro' instead.
> } %{mcpu=*:-mtune=%* %n`-mcpu=' is deprecated. Use `-mtune=' or 
> '-march=' instead.
> }} %<mcpu=* %{mintel-syntax:-masm=intel %n`-mintel-syntax' is 
> deprecated. Use `-masm=intel' instead.
> } %{mno-intel-syntax:-masm=att %n`-mno-intel-syntax' is deprecated. Use 
> `-masm=att' instead.
> }
> 
> *link_emulation:
> elf_i386
> 
> *dynamic_linker:
> /lib/ld-linux.so.2
> 
> *link_command:
> %{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:    %(linker) %l %{pie:-pie} 
> %X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} %{r}    %{s} %{t} %{u*} %{x} 
> %{z} %{Z} %{!A:%{!nostdlib:%{!nostartfiles:%S}}}    %{static:} %{L*} 
> %(mfwrap) %(link_libgcc) %o    
> %{fopenmp:%:include(libgomp.spec)%(link_gomp)} %(mflib)    
> %{fprofile-arcs|fprofile-generate|coverage:-lgcov}    
> %{!nostdlib:%{!nodefaultlibs:%(link_ssp) %(link_gcc_c_sequence)}}    
> %{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} }}}}}}
> 
> Is --hash-style meant to be there or is it an FC-specific option?


See this thread: http://lkml.org/lkml/2006/7/27/83

Can't you put this little script somewhere early in
the search path, and call it 'ld':

#!/bin/sh

#LD=`which ld`
LD=/usr/bin/ld

ARGS=""
for a in $@
do
         if [ x"${a:0:12}" = x"--hash-style" ]
         then
                 :
         else
                 ARGS="$ARGS $a"
         fi
done

exec $LD $ARGS


> Thanks for your help,
> 
> Amadeus

bjd



More information about the lfs-support mailing list