[SOLVED] Failed to compile libatomic at the first time to compile gcc(step 5.5)
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.
Failed to compile libatomic at the first time to compile gcc(step 5.5)
I am praticing LFS 5.5, compile gcc for the fist time.
But got the following errors:
configure: error: in `/mnt/lfs/sources/gcc-build/i686-lfs-linux-gnu/libatomic':
configure: error: C compiler cannot create executables
See `config.log' for more details.
make[1]: *** [configure-target-libatomic] Error 1
make[1]: Leaving directory `/mnt/lfs/sources/gcc-build'
make: *** [all] Error 2
The config.log is :
Target: i686-lfs-linux-gnu
Configured with: ../gcc-4.8.1/configure --target=i686-lfs-linux-gnu --prefix=/tools --with-sysroot=/mnt/lfs --with-newlib --without-headers --with-local-prefix=/tools --with-native-system-header-dir=/tools/include --disable-nls --disable-shared --disable-multilib --disable-decimal-float --disable-threads --disable-libmudflap --disable-libssp --disable-libgomp --disable-libquadmath --enable-languages=c --with-mpfr-include=/mnt/lfs/sources/gcc-build/../gcc-4.8.1/mpfr/src --with-mpfr-lib=/mnt/lfs/sources/gcc-build/mpfr/src/.libs
Thread model: single
gcc version 4.8.1 (GCC)
configure:3457: $? = 0
configure:3477: checking for C compiler default output file name
configure:3499: /mnt/lfs/sources/gcc-build/./gcc/xgcc -B/mnt/lfs/sources/gcc-build/./gcc/ -B/tools/i686-lfs-linux-gnu/bin/ -B/tools/i686-lfs-linux-gnu/lib/ -isystem /tools/i686-lfs-linux-gnu/include -isystem /tools/i686-lfs-linux-gnu/sys-include -g -O2 conftest.c >&5
/tools/i686-lfs-linux-gnu/bin/ld: cannot find crt1.o: No such file or directory
/tools/i686-lfs-linux-gnu/bin/ld: cannot find crti.o: No such file or directory
/tools/i686-lfs-linux-gnu/bin/ld: cannot find -lc
/tools/i686-lfs-linux-gnu/bin/ld: cannot find crtn.o: No such file or directory
collect2: error: ld returned 1 exit status
configure:3503: $? = 1
configure:3540: result:
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "GNU Atomic Library"
| #define PACKAGE_TARNAME "libatomic"
| #define PACKAGE_VERSION "1.0"
| #define PACKAGE_STRING "GNU Atomic Library 1.0"
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL "http://www.gnu.org/software/libatomic/"
| #define PACKAGE "libatomic"
| #define VERSION "1.0"
| /* end confdefs.h. */
|
| int
| main ()
| {
|
| ;
| return 0;
| }
I have configure gcc successfully by the following cmd:
../gcc-4.8.1/configure \
--target=$LFS_TGT \
--prefix=/tools \
--with-sysroot=$LFS \
--with-newlib \
--without-headers \
--with-local-prefix=/tools \
--with-native-system-header-dir=/tools/include \
--disable-nls \
--disable-shared \
--disable-multilib \
--disable-decimal-float \
--disable-threads \
--disable-libmudflap \
--disable-libssp \
--disable-libgomp \
--disable-libquadmath \
--enable-languages=c \
--with-mpfr-include=$(pwd)/../gcc-4.8.1/mpfr/src \
--with-mpfr-lib=$(pwd)/mpfr/src/.libs
/tools/i686-lfs-linux-gnu/bin/ld: cannot find crt1.o: No such file or directory
/tools/i686-lfs-linux-gnu/bin/ld: cannot find crti.o: No such file or directory
/tools/i686-lfs-linux-gnu/bin/ld: cannot find -lc
/tools/i686-lfs-linux-gnu/bin/ld: cannot find crtn.o: No such file or directory
First, if its any consolation, this is a well crafted problem report providing a wealth of good information that I took the liberty of trimming. It's very specific and the title is appropriate.
My initial thoughts are:
1). Double check that you're functioning in the role of the LFS user.
2). Since the start and end object files (crt?.o) aren't found, examine your host system to ensure they're present. Typically they'll be in one of /lib, lib32 or /lib64. Use the command locate crt1.o to identify their presence. Likewise locate libc.so should be executed to verify that the C library is available to the linker.
3). Can I presume that 5.4. Binutils-2.23.2 - Pass 1 yielded no errors?
bash, version 4.2.24(1)-release
/bin/sh -> /bin/bash
Binutils: (GNU Binutils for Ubuntu) 2.22
bison (GNU Bison) 2.5
/usr/bin/yacc -> /usr/bin/bison.yacc
bzip2, Version 1.0.6, 6-Sept-2010.
Coreutils: 8.13
diff (GNU diffutils) 3.2
find (GNU findutils) 4.4.2
GNU Awk 3.1.8
/usr/bin/awk -> /usr/bin/gawk
gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3 g++ (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
(Ubuntu EGLIBC 2.15-0ubuntu10.3) 2.15
grep (GNU grep) 2.10
gzip 1.4
Linux version 3.2.0-33-generic-pae (buildd@lamiak) (gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) ) #52-Ubuntu SMP Thu Oct 18 16:39:21 UTC 2012
m4 (GNU M4) 1.4.16
GNU Make 3.81
patch 2.6.1
Perl version='5.14.2';
GNU sed version 4.2.1
tar (GNU tar) 1.26
Texinfo: makeinfo (GNU texinfo) 4.13
xz (XZ Utils) 5.1.0alpha g++ compilation OK
The bold/red parts look suspicious.
The g++ part shouldn't be there, and looking at the compilation part it seems to be using g++ instead of gcc.
I'm not sure what you did to make Ubuntu 12.04 compliant, but you might have done something wrong. Maybe this will help (specifically the Preparing Ubuntu steps):
- LFS 7.1 on Ubuntu 12.04
BTW: knudfl's post deals with the latest Debian/Ubuntu versions, which would not include Ubuntu 12.04 (which you can check yourself).
Thanks for you help. Following the steps in your blog, I have successfully compiled gcc pass 1.
Quote:
Originally Posted by druuna
The bold/red parts look suspicious.
The g++ part shouldn't be there, and looking at the compilation part it seems to be using g++ instead of gcc.
I'm not sure what you did to make Ubuntu 12.04 compliant, but you might have done something wrong. Maybe this will help (specifically the Preparing Ubuntu steps):
- LFS 7.1 on Ubuntu 12.04
BTW: knudfl's post deals with the latest Debian/Ubuntu versions, which would not include Ubuntu 12.04 (which you can check yourself).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.