LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.

Notices


Reply
  Search this Thread
Old 02-15-2006, 06:19 AM   #1
newcomer4
LQ Newbie
 
Registered: Jan 2006
Posts: 21

Rep: Reputation: 15
Thumbs down libc.so error in glibc compilation


I am trying to build cross toolchain by looking at CLFS.
Here , instead of nptl I am using linuxthreads.
Tools used are:
linux-2.6.15.1
binutils-2.14
gcc-4.0.2
glibc-2.3.6
glibc-linuxthreads-2.3.6

After installing bootstrap compiler, when I tried to compile glibc I am getting error.I have installed binutils,glibc headers and bootstrap compiler successfully.


To configure:
BUILD_CC="gcc" CC="${LFS_TARGET}-gcc" \
AR="${LFS_TARGET}-ar" RANLIB="${LFS_TARGET}-ranlib" \
../glibc-2.3.6/configure --prefix=/tools \
--host=${LFS_TARGET} --build=${LFS_HOST} \
--disable-profile --enable-add-ons=linuxthreads \
--with-tls --enable-kernel=2.6.15.1 --with-__thread \
--with-binutils=/cross-tools/bin --with-headers=/tools/include \
--cache-file=config.cache

Here comes the error.

To compile :
make
.......
.......
...

make[3]: Leaving directory `/mnt/lfs/sources/glibc-2.3.6/elf'
i686-pc-linux-gnu-gcc interp.c -c -std=gnu99 -O2 -Wall -Winline -Wstrict-prototypes -Wwrite-strings -g -mpreferred-stack-boundary=2 -fPIC -D'RUNTIME_LINKER="/tools/lib/ld-linux.so.2"' -DNOT_IN_libc=1 -I../include -I. -I/mnt/lfs/sources/glibc-build/elf -I.. -I../libio -I/mnt/lfs/sources/glibc-build -I../sysdeps/i386/elf -I../linuxthreads/sysdeps/unix/sysv/linux/i386 -I../linuxthreads/sysdeps/unix/sysv/linux -I../linuxthreads/sysdeps/pthread -I../sysdeps/pthread -I../linuxthreads/sysdeps/unix/sysv -I../linuxthreads/sysdeps/unix -I../linuxthreads/sysdeps/i386/i686 -I../linuxthreads/sysdeps/i386 -I../sysdeps/unix/sysv/linux/i386 -I../sysdeps/unix/sysv/linux -I../sysdeps/gnu -I../sysdeps/unix/common -I../sysdeps/unix/mman -I../sysdeps/unix/inet -I../sysdeps/unix/sysv/i386 -I../sysdeps/unix/sysv -I../sysdeps/unix/i386 -I../sysdeps/unix -I../sysdeps/posix -I../sysdeps/i386/i686/fpu -I../sysdeps/i386/i686 -I../sysdeps/i386/i486 -I../sysdeps/i386/fpu -I../sysdeps/i386 -I../sysdeps/wordsize-32 -I../sysdeps/ieee754/ldbl-96 -I../sysdeps/ieee754/dbl-64 -I../sysdeps/ieee754/flt-32 -I../sysdeps/ieee754 -I../sysdeps/generic/elf -I../sysdeps/generic -nostdinc -isystem /mnt/lfs/cross-tools/bin/../lib/gcc/i686-pc-linux-gnu/4.0.2/include -isystem /tools/include -D_LIBC_REENTRANT -include ../include/libc-symbols.h -DPIC -DSHARED -o /mnt/lfs/sources/glibc-build/elf/interp.os -MD -MP -MF /mnt/lfs/sources/glibc-build/elf/interp.os.dt -MT /mnt/lfs/sources/glibc-build/elf/interp.os
make[2]: Leaving directory `/mnt/lfs/sources/glibc-2.3.6/elf'
cd /mnt/lfs/sources/glibc-build && /mnt/lfs/cross-tools/bin/../lib/gcc/i686-pc-linux-gnu/4.0.2/../../../../i686-pc-linux-gnu/bin/ar cruv libc.a `cat csu/stamp.o iconv/stamp.o iconvdata/stamp.o locale/stamp.o localedata/stamp.o assert/stamp.o ctype/stamp.o intl/stamp.o catgets/stamp.o math/stamp.o setjmp/stamp.o signal/stamp.o stdlib/stamp.o stdio-common/stamp.o libio/stamp.o dlfcn/stamp.o malloc/stamp.o string/stamp.o wcsmbs/stamp.o timezone/stamp.o time/stamp.o dirent/stamp.o grp/stamp.o pwd/stamp.o posix/stamp.o io/stamp.o termios/stamp.o resource/stamp.o misc/stamp.o socket/stamp.o sysvipc/stamp.o gmon/stamp.o gnulib/stamp.o wctype/stamp.o manual/stamp.o shadow/stamp.o po/stamp.o argp/stamp.o crypt/stamp.o linuxthreads/stamp.o resolv/stamp.o nss/stamp.o rt/stamp.o conform/stamp.o debug/stamp.o linuxthreads_db/stamp.o inet/stamp.o hesiod/stamp.o sunrpc/stamp.o nis/stamp.o nscd/stamp.o streams/stamp.o login/stamp.o elf/stamp.o stamp.o`
r - csu/version.o
: /mnt/lfs/sources/glibc-build/libc.a
i686-pc-linux-gnu-gcc -nostdlib -nostartfiles -r -o /mnt/lfs/sources/glibc-build/libc_pic.os \
-Wl,-d -Wl,--whole-archive /mnt/lfs/sources/glibc-build/libc_pic.a
i686-pc-linux-gnu-gcc -shared -Wl,-O1 \
-nostdlib -nostartfiles \
-Wl,-dynamic-linker=/tools/lib/ld-linux.so.2 -Wl,-z,combreloc \
-Wl,--verbose 2>&1 | \
sed > /mnt/lfs/sources/glibc-build/shlib.ldsT \
-e '/^=========/,/^=========/!d;/^=========/d' \
-e 's/^.*\.hash[ ]*:.*$/ .note.ABI-tag : { *(.note.ABI-tag) } &/' \
-e 's/^.*\*(\.dynbss).*$/& \
PROVIDE(__start___libc_freeres_ptrs = .); \
*(__libc_freeres_ptrs) \
PROVIDE(__stop___libc_freeres_ptrs = .);/'\
-e 's/^.*\*(\.jcr).*$/& \
PROVIDE(__start___libc_subfreeres = .);\
__libc_subfreeres : { *(__libc_subfreeres) }\
PROVIDE(__stop___libc_subfreeres = .);\
PROVIDE(__start___libc_atexit = .);\
__libc_atexit : { *(__libc_atexit) }\
PROVIDE(__stop___libc_atexit = .);\
PROVIDE(__start___libc_thread_subfreeres = .);\
__libc_thread_subfreeres : { *(__libc_thread_subfreeres) }\
PROVIDE(__stop___libc_thread_subfreeres = .);/'
mv -f /mnt/lfs/sources/glibc-build/shlib.ldsT /mnt/lfs/sources/glibc-build/shlib.lds
i686-pc-linux-gnu-gcc -shared -static-libgcc -Wl,-O1 -Wl,-z,defs -Wl,-dynamic-linker=/tools/lib/ld-linux.so.2 -B/mnt/lfs/sources/glibc-build/csu/ -Wl,--version-script=/mnt/lfs/sources/glibc-build/libc.map -Wl,-soname=libc.so.6 -Wl,-z,combreloc -nostdlib -nostartfiles -e __libc_main -L/mnt/lfs/sources/glibc-build -L/mnt/lfs/sources/glibc-build/math -L/mnt/lfs/sources/glibc-build/elf -L/mnt/lfs/sources/glibc-build/dlfcn -L/mnt/lfs/sources/glibc-build/nss -L/mnt/lfs/sources/glibc-build/nis -L/mnt/lfs/sources/glibc-build/rt -L/mnt/lfs/sources/glibc-build/resolv -L/mnt/lfs/sources/glibc-build/crypt -L/mnt/lfs/sources/glibc-build/linuxthreads -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 -o /mnt/lfs/sources/glibc-build/libc.so -T /mnt/lfs/sources/glibc-build/shlib.lds /mnt/lfs/sources/glibc-build/csu/abi-note.o /mnt/lfs/sources/glibc-build/elf/soinit.os /mnt/lfs/sources/glibc-build/libc_pic.os /mnt/lfs/sources/glibc-build/elf/sofini.os /mnt/lfs/sources/glibc-build/elf/interp.os /mnt/lfs/sources/glibc-build/elf/ld.so -lgcc
/mnt/lfs/sources/glibc-build/libc_pic.os(.text+0xb48f2): In function `*__GI___register_atfork':
../linuxthreads/sysdeps/pthread/list.h:61: undefined reference to `__fork_block'
/mnt/lfs/sources/glibc-build/libc_pic.os(.text+0xb48f8):../linuxthreads/sysdeps/pthread/list.h:60: undefined reference to `__fork_block'
/mnt/lfs/sources/glibc-build/libc_pic.os(.text+0xb4905):../linuxthreads/sysdeps/pthread/list.h:63: undefined reference to `__fork_block'
/mnt/lfs/sources/glibc-build/libc_pic.os(.text+0xb490f):../linuxthreads/sysdeps/pthread/list.h:60: undefined reference to `__fork_block'
/mnt/lfs/sources/glibc-build/libc_pic.os(.text+0xb4915):../linuxthreads/sysdeps/pthread/list.h:61: undefined reference to `__fork_block'
/mnt/lfs/sources/glibc-build/libc_pic.os(.text+0xb4922):../linuxthreads/sysdeps/pthread/list.h:63: more undefined references to `__fork_block' follow
collect2: ld returned 1 exit status
make[1]: *** [/mnt/lfs/sources/glibc-build/libc.so] Error 1
make[1]: Leaving directory `/mnt/lfs/sources/glibc-2.3.6'
make: *** [all] Error 2

Plz help me.I am trying to build a cross build toolchain from the past 2 weeks, but not yet succeeded.
 
Old 02-16-2006, 05:13 AM   #2
shotokan
Member
 
Registered: Mar 2005
Distribution: slackware, LFS
Posts: 204

Rep: Reputation: 30
You can try ugrading to a higher glibc, or downgrading to a lower binutils. It helped for this guy: http://www.cygwin.com/ml//binutils/2.../msg00205.html

Also you might try doing:
Code:
BUILD_CC="gcc" CC="${LFS_TARGET}-gcc" \
    AR="${LFS_TARGET}-ar" RANLIB="${LFS_TARGET}-ranlib" \
    ../glibc-20051107/configure --prefix=/tools \
    --host=${LFS_TARGET} --build=${LFS_HOST} \
    --disable-profile --enable-add-ons \
    --with-tls --enable-kernel=2.6.0 --with-__thread \
    --with-binutils=/cross-tools/bin --with-headers=/tools/include \
    --cache-file=config.cache
 
Old 02-17-2006, 12:13 AM   #3
newcomer4
LQ Newbie
 
Registered: Jan 2006
Posts: 21

Original Poster
Rep: Reputation: 15
My configuration command was:

To configure:
BUILD_CC="gcc" CC="${LFS_TARGET}-gcc" \
AR="${LFS_TARGET}-ar" RANLIB="${LFS_TARGET}-ranlib" \
../glibc-2.3.6/configure --prefix=/tools \
--host=${LFS_TARGET} --build=${LFS_HOST} \
--disable-profile --enable-add-ons=linuxthreads \
--with-tls --enable-kernel=2.6.15.1 --with-__thread \
--with-binutils=/cross-tools/bin --with-headers=/tools/include \
--cache-file=config.cache


To compile :
make

But still, I got the error...which version of binutils and glibc will work ?
Regarding the software tools that I have used, I have already mentioned earlier.
 
Old 02-18-2006, 04:23 AM   #4
shotokan
Member
 
Registered: Mar 2005
Distribution: slackware, LFS
Posts: 204

Rep: Reputation: 30
I really don't know the specifics of what version to get of either.
[GUESS]
I figure since only the development release of CLFS is available.
Your going to have to ask people on the CLFS project or on projects like GCC, Glibc, or Binutils.
You might need to exeriment yourself with versions.
[/GUESS]
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
glibc compilation error newcomer4 Linux - Newbie 1 02-03-2006 02:53 PM
glibc compilation error newcomer4 Linux From Scratch 1 02-03-2006 05:02 AM
Glibc compilation error Krappy Linux From Scratch 0 05-03-2005 12:24 AM
libc or glibc bigtl Programming 1 06-25-2002 09:41 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 10:16 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration