LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This 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


Reply
  Search this Thread
Old 07-18-2013, 07:50 AM   #1
clicdl
LQ Newbie
 
Registered: Jul 2013
Posts: 4

Rep: Reputation: Disabled
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

Is there anything wrong with my enironment?
B.R.
 
Old 07-18-2013, 07:54 AM   #2
clicdl
LQ Newbie
 
Registered: Jul 2013
Posts: 4

Original Poster
Rep: Reputation: Disabled
By the way, my OS is ubuntu12.04
Follwing is the result of version-check :

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
 
Old 07-20-2013, 10:07 PM   #3
re_nelson
Member
 
Registered: Oct 2011
Location: Texas, USA
Distribution: LFS-SVN, Gentoo~amd64, CentOS-7, Slackware64-current, FreeBSD-11.1, Arch
Posts: 229

Rep: Reputation: Disabled
Quote:
Originally Posted by clicdl View Post
/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?
 
Old 07-21-2013, 03:53 AM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,513

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Quote:
cannot find crt1.o
cannot find -lc
$ locale crt1.o : EDIT ..
EDIT typo to : $ locate crt1.o : /usr/lib/i386-linux-gnu/crt1.o
$ dpkg -L libc6-dev | grep crt1.o : /usr/lib/i386-linux-gnu/crt1.o
-lc : That's libc.so : Same location.

I.e. Debian / Ubuntu are now now using "a hideaway location" for a lot of files.

Configuring gcc can be like :

$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/i386-linux-gnu/ && ../gcc-4.8.1/configure -- .......


-

Last edited by knudfl; 07-21-2013 at 04:18 AM.
 
Old 07-21-2013, 04:06 AM   #5
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
@knudfl: That info might come in handy!

BTW: Typo -> locale crt1.o should be locate crt1.o has been fixed

Last edited by druuna; 07-21-2013 at 06:11 AM.
 
Old 07-22-2013, 08:37 AM   #6
clicdl
LQ Newbie
 
Registered: Jul 2013
Posts: 4

Original Poster
Rep: Reputation: Disabled
Unhappy

Thanks for all your replies.
But I get the same problem after I doing the following action.
Quote:
Originally Posted by knudfl View Post
Configuring gcc can be like :

$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/i386-linux-gnu/ && ../gcc-4.8.1/configure -- .......


-
Yet, I totoally clean my envirmont and repeat the binutils compiling again, but it doesn't work.

Is there any other solutions?
 
Old 07-22-2013, 09:07 AM   #7
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Quote:
Originally Posted by clicdl View Post
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).
 
1 members found this post helpful.
Old 07-23-2013, 05:09 AM   #8
clicdl
LQ Newbie
 
Registered: Jul 2013
Posts: 4

Original Poster
Rep: Reputation: Disabled
Thumbs up

Thanks for you help. Following the steps in your blog, I have successfully compiled gcc pass 1.

Quote:
Originally Posted by druuna View Post
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).
 
Old 07-23-2013, 05:20 AM   #9
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
You're welcome

BTW: Can you put up the [SOLVED] tag? (link is on the top right hand side)
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] LFS 7.1 Build: File-5.10 won't compile in step 6.12 bbradley1946 Linux From Scratch 11 08-18-2012 09:52 AM
Cogl-1.10.4 make check failed and compile Clutter-1.10.8 failed kcynice Linux From Scratch 0 08-09-2012 12:27 AM
What is the gcc compile time for the powerpc platform? DrHAAAAAX Linux - General 2 11-26-2011 01:06 PM
Compile error, 'H5G_obj_t' does not name a type, is gcc 4.3 incompatible with gcc 3 ? samrat_rao Linux - Software 5 03-03-2009 02:28 PM
Step by step kernel compile for fedora core 3 Braveheart1980 Fedora 6 11-11-2004 01:41 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 05:44 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration