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.
When trying to compile glibc-2.22 in ch. 5, I get the errors below.
Base system Slackware64-14.1, all patches up to date.
Computer: Linux nadrek 3.10.17 #2 SMP Fri Feb 14 16:45:28 CST 2014 x86_64 AMD Athlon(tm) II X2 \
245 Processor AuthenticAMD GNU/Linux
Quote:
x86_64-lfs-linux-gnu-gcc -shared -static-libgcc -Wl,-O1
-Wl,-z,defs -Wl,-dynamic-linker=/tools/lib/ld-linux-x86-64.so.2
-B/mnt/lfs/sources/glibc-build/csu/
-Wl,--version-script=/mnt/lfs/sources/glibc-build/libresolv.map
-Wl,-soname=libresolv.so.2 -Wl,-z,combreloc -Wl,-z,relro
-Wl,--hash-style=both -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/mathvec -L/mnt/lfs/sources/glibc-build/nptl
-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/mathvec:/mnt/lfs/sources/glibc-build/nptl
-o /mnt/lfs/sources/glibc-build/resolv/libresolv.so
-T /mnt/lfs/sources/glibc-build/shlib.lds
/mnt/lfs/sources/glibc-build/csu/abi-note.o -Wl,--whole-archive
/mnt/lfs/sources/glibc-build/resolv/libresolv_pic.a -Wl,--no-whole-archive
-Wl,--start-group /mnt/lfs/sources/glibc-build/libc.so
/mnt/lfs/sources/glibc-build/libc_nonshared.a -Wl,--as-needed
/mnt/lfs/sources/glibc-build/elf/ld.so -Wl,--no-as-needed -Wl,--end-group
/mnt/lfs/sources/glibc-build/resolv/libresolv_pic.a(gethnamaddr.os):
In function `getanswer':
/mnt/lfs/sources/glibc-2.22/resolv/gethnamaddr.c:185: undefined reference
to `__stack_chk_guard'
/mnt/lfs/sources/glibc-2.22/resolv/gethnamaddr.c:483: undefined reference
to `__stack_chk_guard'
/mnt/lfs/sources/glibc-build/resolv/libresolv_pic.a(gethnamaddr.os):
In function `__GI_res_gethostbyname2':
/mnt/lfs/sources/glibc-2.22/resolv/gethnamaddr.c:510: undefined reference
to `__stack_chk_guard'
/mnt/lfs/sources/glibc-2.22/resolv/gethnamaddr.c:636: undefined reference
to `__stack_chk_guard'
/mnt/lfs/sources/glibc-build/resolv/libresolv_pic.a(gethnamaddr.os):
In function `res_gethostbyaddr':
/mnt/lfs/sources/glibc-2.22/resolv/gethnamaddr.c:644: undefined reference
to `__stack_chk_guard'
/mnt/lfs/sources/glibc-build/resolv/libresolv_pic.a(gethnamaddr.os):/mnt/lfs/sources/glibc-2.22/resolv/gethnamaddr.c:783:
more undefined references to `__stack_chk_guard' follow
collect2: error: ld returned 1 exit status
make[2]: *** [/mnt/lfs/sources/glibc-build/resolv/libresolv.so] Error 1
make[2]: Leaving directory `/mnt/lfs/sources/glibc-2.22/resolv'
make[1]: *** [resolv/others] Error 2
make[1]: Leaving directory `/mnt/lfs/sources/glibc-2.22'
make: *** [all] Error 2
Perhaps I'm reading it wrong but none of the files in the resolve directory seem to
reference __stack_chk_guard. A google search turned up nothing, but ch 5 cannot be
built until I get past this. As a consequence of this error gcc does not build.
Oh, and I did run the version-chk.sh script from the preface. It came said my system
should be adequate.
Doing a search on that error, someone else who was going through LFS appears to have forgotten to run some of the commands required when configuring gcc earlier in the chapter, I would look into this being your potential problem; seeing if you did miss any commands during a copy/paste.
Well, I admit to some skepticism, Basica. I had been over the scripts until
I was going blind. But I went back to the book and cut and paste everything
again and now it compiles. Thanks!
Glad it's working for you now. It's very easy to do by the way, on one occasion I had an issue because when I was copying and pasting text, I missed the first letter of the bunch of commands I copied and paste. This is something easy to miss when you get a wall of text pop up after you've hit enter. Now whenever I do a build, I am far more paranoid with checking and rechecking what I've pasted in
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.