LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (http://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   LFS 7.1 Glibc-2.14.1 make error (http://www.linuxquestions.org/questions/linux-from-scratch-13/lfs-7-1-glibc-2-14-1-make-error-934942/)

samuraixp 03-17-2012 09:40 AM

LFS 7.1 Glibc-2.14.1 make error
 
I have been following the LFS stable which is currently version 7.1
I am building from a x64 Ubuntu 11.04 live cd.

Everything I have done so far has been fine, up until glibc.
Depending on what I mess with I get different errors.

In file included from ../sysdeps/unix/sysv/linux/syslog.c:10:0:
../misc/syslog.c: In function '__vsyslog_chk':
../misc/syslog.c:123:1: sorry, unimplemented: inlining failed in call to 'syslog': function body not available
../misc/syslog.c:155:9: sorry, unimplemented: called from here
make[2]: *** [/media/ROOT/sources/glibc-build/misc/syslog.o] Error 1
make[2]: Leaving directory `/media/ROOT/sources/glibc-2.14.1/misc'
make[1]: *** [misc/subdir_lib] Error 2
make[1]: Leaving directory `/media/ROOT/sources/glibc-2.14.1'
make: *** [all] Error 2dl-addr.c:(.text+0x0): multiple definition of `_dl_addr_inside_object'
/media/ROOT/sources/glibc-build/elf/dl-allobjs.os:(.text+0x11320): first defined here
collect2: ld returned 1 exit status
make[2]: *** [/media/ROOT/sources/glibc-build/elf/librtld.map] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory `/media/ROOT/sources/glibc-2.14.1/elf'
make[1]: *** [elf/subdir_lib] Error 2
make[1]: Leaving directory `/media/ROOT/sources/glibc-2.14.1'
make: *** [all] Error 2

this site says:
http://plash.beasts.org/wiki/GlibcBu...3d84325c05e9b0

Inlining failed

When building on Ubuntu:

In file included from ../sysdeps/unix/sysv/linux/syslog.c:10:
../misc/syslog.c: In function '__vsyslog_chk':
../misc/syslog.c:123: sorry, unimplemented: inlining failed in call to 'syslog': function body not available
../misc/syslog.c:155: sorry, unimplemented: called from here
Need to add -U_FORTIFY_SOURCE to the gcc invocation. I found this in Ubuntu's Debian packaging for glibc. I believe this is an Ubuntuism. Ubuntu enables -D_FORTIFY_SOURCE=2 by default. See Ubuntu's CompilerFlags wiki page.

so I tried adding -U_FORTIFY_SOURCE to CFLAGS and I get this:

/media/ROOT/sources/glibc-build/config.h:3:3: error: #error "glibc cannot be compiled without optimization"
make[2]: Leaving directory `/media/ROOT/sources/glibc-2.14.1/csu'
make[1]: *** [csu/subdi../glibc-2.14.1/configure --prefix=/tools \
--host=$LFS_TGT --build=$(../glibc-2.14.1/scripts/config.guess) \
--disable-profile --enable-add-ons \
--enable-kernel=2.6.25 --with-headers=/tools/include \
libc_cv_forced_unwind=yes libc_cv_c_cleanup=yesr_lib] Error 2
make[1]: Leaving directory `/media/ROOT/sources/glibc-2.14.1'
make: *** [all] Error 2

Then i read that using CFLAGS -O2 fixes this issue.

with both -O2 and -U_FORTIFY_SOURCE

I get this error:

dl-addr.c:(.text+0x0): multiple definition of `_dl_addr_inside_object'
/media/ROOT/sources/glibc-build/elf/dl-allobjs.os:(.text+0x11320): first defined here
collect2: ld returned 1 exit status
make[2]: *** [/media/ROOT/sources/glibc-build/elf/librtld.map] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory `/media/ROOT/sources/glibc-2.14.1/elf'
make[1]: *** [elf/subdir_lib] Error 2
make[1]: Leaving directory `/media/ROOT/sources/glibc-2.14.1'
make: *** [all] Error 2


I have also read in another forum I shouldnt use 64bit with LFS and should look at CLFS instead????

Whats the deal?
Should I grab a 32bit live CD of ubuntu and just start from scratch, or, start from scratch on CLFS?

Does anyone have a recommended Live CD that works with LFS 7.1?

Cheers,
Madhava

druuna 03-18-2012 04:07 AM

Hi,
Quote:

Originally Posted by samuraixp (Post 4629143)
I have been following the LFS stable which is currently version 7.1
I am building from a x64 Ubuntu 11.04 live cd.

Did you make the Ubuntu live CD compliant with the LFS Host System Requirements?

Quote:

Everything I have done so far has been fine, up until glibc.
Depending on what I mess with I get different errors.
If you encounter an error during the build of LFS the reason is probably you. All the steps in the book work and it is not needed to fiddle with the commands given, fiddling with the command to get it to work will most likely get you into more trouble (which might turn up at a later stage of the build).

Quote:

In file included from ../sysdeps/unix/sysv/linux/syslog.c:10:0:
../misc/syslog.c: In function '__vsyslog_chk':
../misc/syslog.c:123:1: sorry, unimplemented: inlining failed in call to 'syslog': function body not available
../misc/syslog.c:155:9: sorry, unimplemented: called from here
make[2]: *** [/media/ROOT/sources/glibc-build/misc/syslog.o] Error 1
make[2]: Leaving directory `/media/ROOT/sources/glibc-2.14.1/misc'
make[1]: *** [misc/subdir_lib] Error 2
make[1]: Leaving directory `/media/ROOT/sources/glibc-2.14.1'
make: *** [all] Error 2dl-addr.c:(.text+0x0): multiple definition of `_dl_addr_inside_object'
/media/ROOT/sources/glibc-build/elf/dl-allobjs.os:(.text+0x11320): first defined here
collect2: ld returned 1 exit status
I notice you deviated from the book (the bold parts). There's basically nothing wrong with doing so, but I would advise to follow the book to the letter, especially if this is your first LFS build. This particular deviation shouldn't be harmful if used consistently, but in general a good understanding of how LFS is build and Linux in general is needed to make deviations work.

Quote:

I have also read in another forum I shouldnt use 64bit with LFS and should look at CLFS instead????

Whats the deal?
Should I grab a 32bit live CD of ubuntu and just start from scratch, or, start from scratch on CLFS?
That is not true. There is no reason why you shouldn't be able to build LFS on a 64 bit multilib host (I've done so many times). Using a true 64 bit system will not work, but most (if not all) mainstream Linux distro's are 64 bit miltilib.

Quote:

Does anyone have a recommended Live CD that works with LFS 7.1?
If at all possible I wouldn't use a liveCD of any kind. Use the distro you are already using, or do a minimal install of your preferred distro. Whatever it is you choose to do, make sure your host meets the LFS Host System Requirements.

Hope this helps.

samuraixp 03-18-2012 04:54 AM

requirements
 
First question. Will the system from lfs be 64bit? I hAve 16 gb of ram and want to use it.



I have confirmed the requirements are being met. There's 4 things Ubuntu live CD doesn't have which I add and the test script comes back OK on.
I have read in some places mawk is not compatible and to replace with awk but this made no difference.

When you day deviation about my dir surely there's no difference in using Ubuntus /media/ instead of mnt but I guess there's no harm in trying /mnt/lfs instead for good measure.

Also I noticed the guide only refers to 2 patches for glibc but the wget list includes 4 patches. Using 2 or 4 makes no difference I get errors with either. I think there is also an additional patch in the wget list for gcc which I tried using the second time by rebuilding gcc with it.

Same result gcc is fine but glibc errors on make.

Also the latest stable book says 7.1 but if you Google 7.1 there's a different guide on lfs site with a different order of steps than the latest stable which makes me wonder if there's an issue in the guides???


Ideas?
I'll try another build with 100% copy and paste and see if that gets me past glibc.

druuna 03-18-2012 05:21 AM

Hi,
Quote:

Originally Posted by samuraixp (Post 4629653)
First question. Will the system from lfs be 64bit? I hAve 16 gb of ram and want to use it.

Have a look here: iii. LFS Target Architectures

Quote:

I have confirmed the requirements are being met. There's 4 things Ubuntu live CD doesn't have which I add and the test script comes back OK on.
I have read in some places mawk is not compatible and to replace with awk but this made no difference.
Yes, it does matter! And although you do not mention this the same is true for bash vs dash. You need to be 100% compatible, these requirements are there for a reason.

Quote:

When you day deviation about my dir surely there's no difference in using Ubuntus /media/ instead of mnt but I guess there's no harm in trying /mnt/lfs instead for good measure.
As already stated: This specific deviation, if used consistently, will not get you into trouble. /mnt/lfs is a mountpoint and /media/ROOT could be used instead. But why would you want to do so?

Quote:

Also I noticed the guide only refers to 2 patches for glibc but the wget list includes 4 patches. Using 2 or 4 makes no difference I get errors with either. I think there is also an additional patch in the wget list for gcc which I tried using the second time by rebuilding gcc with it.
Follow the book. The patches you downloaded are for chapter 5 AND 6. Some are only used in chapter 5, some only in chapter 6 and some in both chapters.

Chapter 5 (a sane temporary environment) has other requirements then chapter 6 (the actual LFS sytem you will be using when done building).

Quote:

Also the latest stable book says 7.1 but if you Google 7.1 there's a different guide on lfs site with a different order of steps than the latest stable which makes me wonder if there's an issue in the guides???
I haven't noticed that yet, but I would advise to use the guides provided by the official LFS team (http://www.linuxfromscratch.org/) and to use the stable version.

Hope this helps.


All times are GMT -5. The time now is 03:27 PM.