glibc, ch5, p1: error compiling libc.so.6

Jappie jappie at tiscalimail.nl
Tue Nov 11 06:48:55 PST 2003


The error was probably due to the fact that I didn"t run the command 
"make -C ld install". This because I"ve build a script witch cd"ed into 
a nonexisting directory, and the line never gets started.
I fixed that... So the dummy.c gets compiled without errors.

But when I run the line "readelf -l a.out | grep ': /tools'" I get no output
When I run the line "readelf -l a.out | grep ': /lib'" I get the output: 
"[Requesting program interpreter: /lib/ld-linux.so.2]"

So the linker still points to /lib/ld-linux.so.2 in stead of 
/tools/ld-linux.so.2
Where am I doing something wrong ?

I"d realy like some help thistime, it"s quite frustrating having to 
begin over and over again with no clue what you"re doing wrong.
Jappie



Jappie wrote:

> ok... the errors I discribed below are most likely to come from the 
> recompilation of gcc-3.3.1 on my slackware distro.
> I unpacked an old tar-ball of lfs-4.0 that a made some time ago... So 
> nou I tried the following:
>
> source-system: lfs-4.0
> lfs: 5.0
> gcc: 3.2
> glibc: 2.2.5
>
> This time I have run the exact same stuff: copy/pasted the commands 
> from book to scripts on my system.
> I run all the scrips, and this time: no errors :)
> But the fun stops there...
> After compiling glibc, you're supposed to adjust some stuff in order 
> to make the self-contained toolchain.
> When I make the dummy,c (containing ownly a main function) I get the 
> following error:
>
> /tools/lib/libc.so.6: undefined reference to 
> `_dl_lookup_versioned_symbol_skip at GLIBC_PRIVATE'
> /tools/lib/libc.so.6: undefined reference to `_rtld_global at GLIBC_PRIVATE'
> /tools/lib/libc.so.6: undefined reference to 
> `_dl_lookup_versioned_symbol at GLIBC_PRIVATE'
> /tools/lib/libc.so.6: undefined reference to 
> `_dl_start_profile at GLIBC_PRIVATE'
> /tools/lib/libc.so.6: undefined reference to 
> `_dl_check_map_versions at GLIBC_PRIVATE'
> /tools/lib/libc.so.6: undefined reference to 
> `__libc_enable_secure at GLIBC_PRIVATE'
> /tools/lib/libc.so.6: undefined reference to 
> `_dl_get_origin at GLIBC_PRIVATE'
> /tools/lib/libc.so.6: undefined reference to 
> `_dl_dst_substitute at GLIBC_PRIVATE'
> /tools/lib/libc.so.6: undefined reference to 
> `_dl_debug_state at GLIBC_PRIVATE'
> /tools/lib/libc.so.6: undefined reference to `_dl_init at GLIBC_PRIVATE'
> /tools/lib/libc.so.6: undefined reference to 
> `_dl_dst_count at GLIBC_PRIVATE'
> /tools/lib/libc.so.6: undefined reference to 
> `_dl_out_of_memory at GLIBC_PRIVATE'
> /tools/lib/libc.so.6: undefined reference to 
> `_dl_signal_error at GLIBC_PRIVATE'
> /tools/lib/libc.so.6: undefined reference to 
> `_dl_debug_printf at GLIBC_PRIVATE'
> /tools/lib/libc.so.6: undefined reference to 
> `_dl_map_object_deps at GLIBC_PRIVATE'
> /tools/lib/libc.so.6: undefined reference to 
> `_dl_unload_cache at GLIBC_PRIVATE'
> /tools/lib/libc.so.6: undefined reference to 
> `_dl_relocate_object at GLIBC_PRIVATE'
> /tools/lib/libc.so.6: undefined reference to 
> `__libc_stack_end at GLIBC_PRIVATE'
> /tools/lib/libc.so.6: undefined reference to `_dl_argv at GLIBC_PRIVATE'
> /tools/lib/libc.so.6: undefined reference to 
> `_dl_catch_error at GLIBC_PRIVATE'
> /tools/lib/libc.so.6: undefined reference to 
> `_dl_lookup_symbol_skip at GLIBC_PRIVATE'
> /tools/lib/libc.so.6: undefined reference to 
> `_dl_lookup_symbol at GLIBC_PRIVATE'
> /tools/lib/libc.so.6: undefined reference to 
> `_dl_map_object at GLIBC_PRIVATE'
> collect2: ld returned 1 exit status
>
> What am I doing wrong here ??
>
> Yes: I used the right target triplet: i686-pc-linux-gnu
> Yes: I used the right dynamic linker: ld-linux.so.2
>
> I"m still following everything exactly from book, plz hlp :S
>
> Jappie
>
>
>
> Jappie wrote:
>
>> lfs: 5.0 (stable)
>> system: slackware 8.1
>> compiler: gcc-3.3.1 (recompiled this, cause compiling glibc-2.3.2 
>> needs at least gcc-3.2)
>>
>> In chapter 5, making glibc phase 1, I copy/pasted the commands into a 
>> script and gave it a go.
>> After a lot of compile-time I get the following error:
>>
>> rm -f /mnt/lfs/sources/glibc-build/libc.so.6.new
>> /bin/sh ../scripts/rellns-sh /mnt/lfs/sources/glibc-build/libc.so 
>> /mnt/lfs/sources/glibc-build/libc.so.6.new
>> mv -f /mnt/lfs/sources/glibc-build/libc.so.6.new 
>> /mnt/lfs/sources/glibc-build/libc.so.6
>> gcc -B/tools/bin/ -nostdlib -nostartfiles -o 
>> /mnt/lfs/sources/glibc-build/iconv/iconvconfig  
>> -Wl,-dynamic-linker=/tools/lib/ld-linux.so.2   -Wl,-z,combreloc 
>> /mnt/lfs/sources/glibc-build/csu/crt1.o 
>> /mnt/lfs/sources/glibc-build/csu/crti.o `gcc -B/tools/bin/ 
>> --print-file-name=crtbegin.o` 
>> /mnt/lfs/sources/glibc-build/iconv/iconvconfig.o 
>> /mnt/lfs/sources/glibc-build/iconv/strtab.o 
>> /mnt/lfs/sources/glibc-build/iconv/xmalloc.o  
>> -Wl,-rpath-link=/mnt/lfs/sources/glibc-build:/mnt/lfs/sources/glibc-build/math:/mnt/lfs/sources/glibc-build/elf:/mnt/lfs/sources/glibc-build/dlfcn:/mnt/lfs/sources/glibc-build/nss:/mnt/lfs/sources/glibc-build/nis:/mnt/lfs/sources/glibc-build/rt:/mnt/lfs/sources/glibc-build/resolv:/mnt/lfs/sources/glibc-build/crypt:/mnt/lfs/sources/glibc-build/linuxthreads 
>> /mnt/lfs/sources/glibc-build/libc.so.6 
>> /mnt/lfs/sources/glibc-build/libc_nonshared.a -lgcc `gcc 
>> -B/tools/bin/ --print-file-name=crtend.o` 
>> /mnt/lfs/sources/glibc-build/csu/crtn.o
>> /mnt/lfs/sources/glibc-build/libc.so.6(*IND*+0x0): multiple 
>> definition of `__udivdi3 at GLIBC_2.0'
>> /mnt/lfs/sources/glibc-build/libc.so.6(.text+0x710): first defined here
>> /mnt/lfs/sources/glibc-build/libc.so.6: In function 
>> `__umoddi3 at GLIBC_2.0':
>> /mnt/lfs/sources/glibc-build/libc.so.6(.text+0x750): multiple 
>> definition of `__umoddi3 at GLIBC_2.0'
>> /mnt/lfs/sources/glibc-build/libc.so.6(.data+0x524): multiple 
>> definition of `__ctype_toupper at GLIBC_2.0'
>> /mnt/lfs/sources/glibc-build/libc.so.6(*IND*+0x0): multiple 
>> definition of `_res at GLIBC_2.0'
>> /mnt/lfs/sources/glibc-build/libc.so.6(.bss+0x1a80): first defined here
>> /mnt/lfs/sources/glibc-build/libc.so.6: In function 
>> `__stop___libc_freeres_ptrs':
>> /mnt/lfs/sources/glibc-build/libc.so.6(.bss+0xc0): multiple 
>> definition of `errno at GLIBC_2.0'
>> /mnt/lfs/sources/glibc-build/libc.so.6(*IND*+0x0): multiple 
>> definition of `__ctype32_toupper at GLIBC_2.2'
>> /mnt/lfs/sources/glibc-build/libc.so.6(.data+0x52c): first defined here
>> /mnt/lfs/sources/glibc-build/libc.so.6: In function 
>> `__stop___libc_freeres_ptrs':
>> /mnt/lfs/sources/glibc-build/libc.so.6(.bss+0x1cc4): multiple 
>> definition of `h_errno at GLIBC_2.0'
>> /mnt/lfs/sources/glibc-build/libc.so.6: In function 
>> `__divdi3 at GLIBC_2.0':
>> /mnt/lfs/sources/glibc-build/libc.so.6(.text+0x610): multiple 
>> definition of `__divdi3 at GLIBC_2.0'
>> /mnt/lfs/sources/glibc-build/libc.so.6(.data+0x528): multiple 
>> definition of `__ctype32_tolower at GLIBC_2.2'
>> /mnt/lfs/sources/glibc-build/libc.so.6(*IND*+0x0): multiple 
>> definition of `_errno at GLIBC_2.0'
>> /mnt/lfs/sources/glibc-build/libc.so.6(.bss+0xc0): first defined here
>> /mnt/lfs/sources/glibc-build/libc.so.6(*IND*+0x0): multiple 
>> definition of `__moddi3 at GLIBC_2.0'
>> /mnt/lfs/sources/glibc-build/libc.so.6(.text+0x690): first defined here
>> /mnt/lfs/sources/glibc-build/libc.so.6(.data+0x518): multiple 
>> definition of `__ctype_b at GLIBC_2.0'
>> /mnt/lfs/sources/glibc-build/libc.so.6(*IND*+0x0): multiple 
>> definition of `__ctype_tolower at GLIBC_2.0'
>> /mnt/lfs/sources/glibc-build/libc.so.6(.data+0x520): first defined here
>> /mnt/lfs/sources/glibc-build/libc.so.6(.data+0x51c): multiple 
>> definition of `__ctype32_b at GLIBC_2.0'
>> collect2: ld returned 1 exit status
>> make[2]: *** [/mnt/lfs/sources/glibc-build/iconv/iconvconfig] Error 1
>> make[2]: Leaving directory `/mnt/lfs/sources/glibc-2.3.2/iconv'
>> make[1]: *** [iconv/others] Error 2
>> make[1]: Leaving directory `/mnt/lfs/sources/glibc-2.3.2'
>> make: *** [all] Error 2
>>
>> I (think I) followed every step of the book...
>> To me it seems like a header file is called twice somewere, but I 
>> can't make out what could have caused it.
>> Can anyone help ?
>>
>> Jappie
>




More information about the lfs-support mailing list