Linux From ScratchThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
So here are the errors. I get these when i'm trying to compile glibc for the toolchain.
Code:
gcc -B/tools/bin/ -shared -static-libgcc -Wl,-O1 -Wl,-z,defs -Wl,-dynamic-linker=/tools/lib/ld-linux.so.2 -B/media/sda8/sources/glibc-build/csu/ -Wl,--version-script=/media/sda8/sources/glibc-build/libc.map -Wl,-soname=libc.so.6 -Wl,-z,combreloc -Wl,-z,relro -Wl,--hash-style=both -nostdlib -nostartfiles -e __libc_main -L/media/sda8/sources/glibc-build -L/media/sda8/sources/glibc-build/math -L/media/sda8/sources/glibc-build/elf -L/media/sda8/sources/glibc-build/dlfcn -L/media/sda8/sources/glibc-build/nss -L/media/sda8/sources/glibc-build/nis -L/media/sda8/sources/glibc-build/rt -L/media/sda8/sources/glibc-build/resolv -L/media/sda8/sources/glibc-build/crypt -L/media/sda8/sources/glibc-build/nptl -Wl,-rpath-link=/media/sda8/sources/glibc-build:/media/sda8/sources/glibc-build/math:/media/sda8/sources/glibc-build/elf:/media/sda8/sources/glibc-build/dlfcn:/media/sda8/sources/glibc-build/nss:/media/sda8/sources/glibc-build/nis:/media/sda8/sources/glibc-build/rt:/media/sda8/sources/glibc-build/resolv:/media/sda8/sources/glibc-build/crypt:/media/sda8/sources/glibc-build/nptl -o /media/sda8/sources/glibc-build/libc.so -T /media/sda8/sources/glibc-build/shlib.lds /media/sda8/sources/glibc-build/csu/abi-note.o /media/sda8/sources/glibc-build/elf/soinit.os /media/sda8/sources/glibc-build/libc_pic.os /media/sda8/sources/glibc-build/elf/sofini.os /media/sda8/sources/glibc-build/elf/interp.os /media/sda8/sources/glibc-build/elf/ld.so -lgcc
/media/sda8/sources/glibc-build/libc_pic.os: In function `__libc_fork':
/media/sda8/sources/glibc-2.8-20080929/posix/../nptl/sysdeps/unix/sysv/linux/i386/../fork.c:76: undefined reference to `__sync_bool_compare_and_swap_4'
/media/sda8/sources/glibc-build/libc_pic.os: In function `nscd_getpw_r':
/media/sda8/sources/glibc-2.8-20080929/nscd/nscd_getpw_r.c:232: undefined reference to `__sync_fetch_and_add_4'
/media/sda8/sources/glibc-build/libc_pic.os: In function `__nscd_drop_map_ref':
/media/sda8/sources/glibc-2.8-20080929/nscd/nscd-client.h:320: undefined reference to `__sync_fetch_and_add_4'
/media/sda8/sources/glibc-build/libc_pic.os: In function `nscd_getgr_r':
/media/sda8/sources/glibc-2.8-20080929/nscd/nscd_getgr_r.c:321: undefined reference to `__sync_fetch_and_add_4'
/media/sda8/sources/glibc-build/libc_pic.os: In function `__nscd_drop_map_ref':
/media/sda8/sources/glibc-2.8-20080929/nscd/nscd-client.h:320: undefined reference to `__sync_fetch_and_add_4'
/media/sda8/sources/glibc-build/libc_pic.os: In function `nscd_gethst_r':
/media/sda8/sources/glibc-2.8-20080929/nscd/nscd_gethst_r.c:400: undefined reference to `__sync_fetch_and_add_4'
/media/sda8/sources/glibc-build/libc_pic.os:/media/sda8/sources/glibc-2.8-20080929/nscd/nscd-client.h:320: more undefined references to `__sync_fetch_and_add_4' follow
/media/sda8/sources/glibc-build/libc_pic.os: In function `__nscd_get_map_ref':
/media/sda8/sources/glibc-2.8-20080929/nscd/nscd_helper.c:406: undefined reference to `__sync_val_compare_and_swap_4'
/media/sda8/sources/glibc-build/libc_pic.os: In function `*__GI___libc_freeres':
/media/sda8/sources/glibc-2.8-20080929/malloc/set-freeres.c:39: undefined reference to `__sync_bool_compare_and_swap_4'
collect2: ld returned 1 exit status
make[1]: *** [/media/sda8/sources/glibc-build/libc.so] Error 1
make[1]: Leaving directory `/media/sda8/sources/glibc-2.8-20080929'
make: *** [all] Error 2
I should note that i'm using Ubuntu 9.04 and instead of version 2.6.27.4 of the kernel i decided to use a newer release that supports ext4(2.6.29.2).
I read in another post that a solution could be recompiling GCC but i haven't tried it since it takes a lot of time.
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,492
Rep:
Quote:
..... could be recompiling GCC ......
Testing if the new gcc is as good as the system one :
That is very easy to find out :
Just make a test compile of glibc, using your system gcc,
/usr/bin/gcc ( 4.3 ), and a different 'configure'.
( From scratch, in a new unique directory in /home/"user"/ ).
....
Testing if the new gcc is as good as the system one :
That is very easy to find out :
Just make a test compile of glibc, using your system gcc,
/usr/bin/gcc ( 4.3 ), and a different 'configure'.
( From scratch, in a new unique directory in /home/"user"/ ).
....
Well i did what you suggested and gcc(from the host system) doesn't seem to be able to compile glibc.
The question is what should i do? Should i try to install another version of gcc on the host system(maybe 4.4) and then recompile gcc from the toolchain ?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.