On Tue, Jul 26, 2011 at 09:44:13AM -0400, Bill Cunningham wrote: > Andrew Elian wrote: > > On Mon, Jul 25, 2011 at 10:19:04PM -0400, Bill Cunningham wrote: > >> I received this error message when my compilation finally broke. > >> I was doing well for a long time. > >> > >> > >> /mnt/lfs/g/nscd/nscd.o: In function `nscd_open_socket': > >> /mnt/lfs/glibc-2.13/nscd/nscd.c:442: undefined reference to > >> `__stack_chk_guard' > >> > >> Bill > > > > I ran into this odd error myself some time ago when I (just for fun) > > built LFS 6.8 using a much older LFS. > > > >> From http://lkml.indiana.edu/hypermail/linux/kernel/0902.1/01077.html > > "It seems that even with the same gcc versions, gcc built against > > libc w/o TLS support generates __stack_chk_guard, so if you mix the > > two flavors, the has-stack-protector check can be compiled on > > machines w/TLS while some other files end up being built on > > machines w/o TLS support thus circumventing the support check." > > > > I think there are two options: adding libc_cv_ssp='no' to configparms > > or > > adding -lssp for the linker. Having gone with option two I found I > > also > > needed to then supply libssp (from /tools) on the host system. Both > > of > > those seem to be hacks. > > Now does this have anything with not building libssp back either > when 4.5.2 was being built? I built it with gcc-4.6.0 too if that means > anything. > > It might be better to rebuild gcc (in Chapter 5) with > > -fno-stack-protection, however, I've not tried that myself.
I just double checked the build scripts I used. I think you are doing Chapter 5.7, whereas I was looking at Chapter 5.10 gcc pass 2. > Remember libssp was disabled earlier. Was it built? If not how can > you link statically to it? Actually, I created a soft link to libssp and hacked a Makefile to include -lssp if there was an error. Really, this is a bad hack and I do not recommend it. I am not sure of the reasons for the undefined reference to `__stack_chk_guard'. I have a hunch it is related to the glibc/gcc build process. This doesn't seem to be a problem when building on a newer linux host. It seems to me you will have two major difficulties with your current LFS build: 1) your build host is old and 2) using an amd64 with a 32 bit linux. Not in itself a bad thing, but as you have discovered, some packages will do strange things and fail to compile. I will strongly recommend the x86_64-Pure64 Cross Linux From Scratch book as it deals with building on a host which is very different than the target. Give development version (as it is the most up to date) a try and see how it goes. Keep at it, it will make sense eventually. ae -- My Blog: http://elian001.wordpress.com -- http://linuxfromscratch.org/mailman/listinfo/lfs-support FAQ: http://www.linuxfromscratch.org/lfs/faq.html Unsubscribe: See the above information page
