LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
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 11-10-2012, 06:37 AM   #1
Prabhu.Are
LQ Newbie
 
Registered: Oct 2012
Posts: 24

Rep: Reputation: Disabled
libmpfr error in GCC compilation (LFS7.2)


Hi I'm following LFS7.2 in that I'm facing error with 5.5.1 Installation of cross GCC module

I successfully compiled Binutilities, then I untared the GCC. In GCC folder I done the following steps

tar -Jxf ../mpfr-3.1.1.tar.xz
mv -v mpfr-3.1.1 mpfr
tar -Jxf ../gmp-5.0.5.tar.xz
mv -v gmp-5.0.5 gmp
tar -zxf ../mpc-1.0.tar.gz
mv -v mpc-1.0 mpc

This

for file in \
$(find gcc/config -name linux64.h -o -name linux.h -o -name sysv4.h)
do
cp -uv $file{,.orig}
sed -e 's@/lib\(64\)\?\(32\)\?/ld@/tools&@g' \
-e 's@/usr@/tools@g' $file.orig > $file
echo '
#undef STANDARD_STARTFILE_PREFIX_1
#undef STANDARD_STARTFILE_PREFIX_2
#define STANDARD_STARTFILE_PREFIX_1 "/tools/lib/"
#define STANDARD_STARTFILE_PREFIX_2 ""' >> $file
touch $file.orig
done


This

sed -i '/k prot/agcc_cv_libc_provides_ssp=yes' gcc/configure

this
mkdir -v ../gcc-build
cd ../gcc-build


and finally this


../gcc-4.7.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.7.1/mpfr/src \
--with-mpfr-lib=$(pwd)/mpfr/src/.libs



Now the final step is to compile GCC by make command, at this point of time it got compiled for 10 mins and then it was showing an error message that


checking for MPFR... no
configure: error: libmpfr not found or uses a different ABI (including static vs shared).
make[1]: *** [configure-mpc] Error 1
make[1]: Leaving directory `/mnt/test/sources/gcc-build'
make: *** [all] Error 2


You can see the whole compilation part in this link

http://pastebin.com/ahMmeTk8


please help me to resolve this error..
 
Old 11-10-2012, 06:42 AM   #2
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: Ubuntu 12.04/12.10/13.04/LFS/Centos6.3/Debain/PCBSD/Mageia 3
Posts: 1,642
Blog Entries: 1

Rep: Reputation: 229Reputation: 229Reputation: 229
Hi

If you look in the gcc-4.7.1 dir you should have a dir mpfr gmp mpc ?
 
Old 11-10-2012, 06:59 AM   #3
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
The only times I've seen this error is when the host used isn't compliant.

Can you post the output of the version-check.sh script?

Please put your output inside [code] ... [/code] tags it preserves all spacing. If you don't know how: LQ - BB Code List.
 
Old 11-10-2012, 07:14 AM   #4
Prabhu.Are
LQ Newbie
 
Registered: Oct 2012
Posts: 24

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by spiky0011 View Post
Hi

If you look in the gcc-4.7.1 dir you should have a dir mpfr gmp mpc ?


Thank yo for replying,

Yes all the three dir are located in gcc-4.7.1.
 
Old 11-10-2012, 07:17 AM   #5
Prabhu.Are
LQ Newbie
 
Registered: Oct 2012
Posts: 24

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by druuna View Post
The only times I've seen this error is when the host used isn't compliant.

Can you post the output of the version-check.sh script?

Please put your output inside [code] ... [/code] tags it preserves all spacing. If you don't know how: LQ - BB Code List.

Sure, my verson-check output is..

Code:
bash, version 4.1.5(1)-release
/bin/sh -> /bin/dash
Binutils: (GNU Binutils for Ubuntu) 2.20.51-system.20100908
bison (GNU Bison) 2.4.1
/usr/bin/yacc -> /usr/bin/bison.yacc
bzip2,  Version 1.0.5, 10-Dec-2007.
Coreutils:  8.5
diff (GNU diffutils) 3.0
find (GNU findutils) 4.4.2
GNU Awk 3.1.7
/usr/bin/awk -> /usr/bin/gawk
gcc (Ubuntu/Linaro 4.4.4-14ubuntu5.1) 4.4.5
(Ubuntu EGLIBC 2.12.1-0ubuntu6) 2.12.1
GNU grep 2.6.3
gzip 1.3.12
Linux version 2.6.35-22-generic (buildd@rothera) (gcc version 4.4.5 (Ubuntu/Linaro 4.4.4-14ubuntu4) ) #33-Ubuntu SMP Sun Sep 19 20:34:50 UTC 2010
m4 (GNU M4) 1.4.14
GNU Make 3.81
patch 2.6
Perl version='5.10.1';
GNU sed version 4.2.1
tar (GNU tar) 1.23
Texinfo: makeinfo (GNU texinfo) 4.13
xz (XZ Utils) 4.999.9beta
gcc compilation OK
 
Old 11-10-2012, 07:17 AM   #6
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: Ubuntu 12.04/12.10/13.04/LFS/Centos6.3/Debain/PCBSD/Mageia 3
Posts: 1,642
Blog Entries: 1

Rep: Reputation: 229Reputation: 229Reputation: 229
Can you post the version check output as druuna ask for
 
Old 11-10-2012, 07:19 AM   #7
Prabhu.Are
LQ Newbie
 
Registered: Oct 2012
Posts: 24

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by spiky0011 View Post
Can you post the version check output as druuna ask for
Yes I just did it.
 
Old 11-10-2012, 07:19 AM   #8
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: Ubuntu 12.04/12.10/13.04/LFS/Centos6.3/Debain/PCBSD/Mageia 3
Posts: 1,642
Blog Entries: 1

Rep: Reputation: 229Reputation: 229Reputation: 229
Hi

As normal druuna is right lol

you have /bin/sh -> /bin/dash it should point to /bin/sh -> /bin/bash
 
Old 11-10-2012, 07:25 AM   #9
Prabhu.Are
LQ Newbie
 
Registered: Oct 2012
Posts: 24

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by spiky0011 View Post
Hi

As normal druuna is right lol

you have /bin/sh -> /bin/dash it should point to /bin/sh -> /bin/bash

Could you please help me how to change it.
 
Old 11-10-2012, 07:27 AM   #10
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: Ubuntu 12.04/12.10/13.04/LFS/Centos6.3/Debain/PCBSD/Mageia 3
Posts: 1,642
Blog Entries: 1

Rep: Reputation: 229Reputation: 229Reputation: 229
Code:
 rm /bin/sh
Code:
 ln -s /bin/bash /bin/sh
 
Old 11-10-2012, 07:34 AM   #11
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
Quote:
Originally Posted by spiky0011 View Post
As normal druuna is right lol


Quote:
Originally Posted by Prabhu.Are View Post
Yes I just did it.
As pointed out by spiky0011, you overlooked something important.

Be careful and precise, building an LFS based system and understanding how this is done is hard enough as-is if this is your first time and have (very?) limited linux experience.

Tip for when you finish chapter 5: Do make a back-up at that point (the Caution). This way you don't have to start from scratch when something goes wrong in chapter 6.
 
Old 11-10-2012, 07:37 AM   #12
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: Ubuntu 12.04/12.10/13.04/LFS/Centos6.3/Debain/PCBSD/Mageia 3
Posts: 1,642
Blog Entries: 1

Rep: Reputation: 229Reputation: 229Reputation: 229
It might be a good idea if you started from the beginning again as well
 
Old 11-13-2012, 08:23 AM   #13
jjsmithct
LQ Newbie
 
Registered: Nov 2012
Posts: 6

Rep: Reputation: 0
Hello. First post on this forum. I've been trying to work this out myself but am confused about what is doing what. I'm having the same issue, only I don't see issue with the versions of the packages on my host. Figured I'd post here as a reply instead of creating another thread on the same thing.

I'm working from SVN-20121103 version of the book - think that's 7.2? Doing LFS on VMware on an HP laptop. I had started with the livecd but scrapped that and my host is now slackware 14.

In section 5.5. GCC-4.7.2 - Pass 1.

make errs out with this...

Code:
libtool: install: warning: remember to run `libtool --finish /tools/libexec/gcc/i686-lfs-linux-gnu/4.7.2'
configure: WARNING: fixed-point is not supported for this target, ignored
Links are now set up to build a cross-compiler
 from i686-pc-linux-gnu to i686-lfs-linux-gnu.
configure: WARNING: using cross tools not prefixed with host triplet
configure: WARNING: cannot check for properly working vsnprintf when cross compiling, will assume it's ok
libtool: link: warning: library `/usr/lib/libmpfr.la' was moved.
/bin/sed: can't read /usr/lib/libgmp.la: No such file or directory
libtool: link: `/usr/lib/libgmp.la' is not a valid libtool archive
make[4]: *** [libmpc.la] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-mpc] Error 2
make: *** [all] Error 2
Cannot find libgmp.la anywhere on the system.

Here is output of my version-check.sh
Code:
root@lithium:~# ./version-check.sh
bash, version 4.2.37(2)-release
/bin/sh -> /bin/bash
Binutils: (Linux/GNU Binutils) 2.22.52.0.2.20120424
bison (GNU Bison) 2.5.1
/usr/bin/yacc -> /usr/bin/yacc
bzip2,  Version 1.0.6, 6-Sept-2010.
Coreutils:  8.19
diff (GNU diffutils) 3.2
find (GNU findutils) 4.4.2
GNU Awk 3.1.8
/usr/bin/awk -> /bin/gawk-3.1.8
gcc (GCC) 4.7.1
(GNU libc) 2.15
grep (GNU grep) 2.14
gzip 1.5
Linux version 3.2.29-smp (root@hive) (gcc version 4.7.1 (GCC) ) #2 SMP Mon Sep 17 13:16:43 CDT 2012
m4 (GNU M4) 1.4.16
GNU Make 3.82
GNU patch 2.7
Perl version='5.16.1';
GNU sed version 4.2.1
tar (GNU tar) 1.26
Texinfo: makeinfo (GNU texinfo) 4.13
xz (XZ Utils) 5.0.4
gcc compilation OK
I'm continuing to try to understand it myself, looking through output of make, google etc, but if anyone has suggestions, it will be appreciated.

Thanks - Jeff
 
Old 11-13-2012, 08:46 AM   #14
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: Ubuntu 12.04/12.10/13.04/LFS/Centos6.3/Debain/PCBSD/Mageia 3
Posts: 1,642
Blog Entries: 1

Rep: Reputation: 229Reputation: 229Reputation: 229
Hi

The 3 files gmp mpfr mpc should be in surce dir
Untar gcc cd into gcc dir then run commands in book
From with in gcc dir
 
Old 11-13-2012, 09:52 AM   #15
jjsmithct
LQ Newbie
 
Registered: Nov 2012
Posts: 6

Rep: Reputation: 0
Probably should have mentioned - I've done that - all three directories are there (renamed to gmp, mpfr, mpc) and followed all instructions in the book. I've done this a few times - wiping everything clean beforehand. Still getting this error.

It seems that libmpfr.la is being moved at some point in the process:
Code:
libtool: link: warning: library `/usr/lib/libmpfr.la' was moved.
, sed is looking for libgmp.la in /usr/lib and can't find it, then libtool is trying to link with it and doesn't report it as not found, but reports it as "not a valid libtool archive."

Actually, a little strange because I could have sworn I searched my whole box for "libgmp.la" and could not find it, but now:

Code:
lfs:/mnt/lfs/sources$ find . -name \*.la
./gcc-build/mpc/src/libmpc.la
./gcc-build/lto-plugin/.libs/liblto_plugin.la
./gcc-build/lto-plugin/liblto_plugin.la
./gcc-build/gmp/libgmp.la
./gcc-build/gmp/mpz/.libs/libmpz.la
./gcc-build/gmp/mpz/libmpz.la
./gcc-build/gmp/.libs/libgmp.la
./gcc-build/gmp/mpq/.libs/libmpq.la
./gcc-build/gmp/mpq/libmpq.la
./gcc-build/gmp/mpn/.libs/libmpn.la
./gcc-build/gmp/mpn/libmpn.la
./gcc-build/gmp/scanf/.libs/libscanf.la
./gcc-build/gmp/scanf/libscanf.la
./gcc-build/gmp/mpf/.libs/libmpf.la
./gcc-build/gmp/mpf/libmpf.la
./gcc-build/gmp/printf/.libs/libprintf.la
./gcc-build/gmp/printf/libprintf.la
./gcc-build/mpfr/src/.libs/libmpfr.la
./gcc-build/mpfr/src/libmpfr.la
./gcc-build/gcc/liblto_plugin.la
So it does exist - except where tools (libtool, sed) are looking for it is not correct: they are looking in /usr/lib. Guess I could just make symlinks in /usr/lib to get around this, although not sure this is the best solution?
 
  


Reply

Tags
error message, gcc, lfs


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
lfs : gcc make problem :error: libmpfr not found or uses a different ABI k84834 Linux From Scratch 5 08-18-2012 03:39 AM
gcc (GCC) 4.3.2 20081105 (Red Hat 4.3.2-7) compilation error adhesh_19 Red Hat 0 01-05-2010 05:34 AM
custom gcc build wont work (libmpfr.so.1: cannot open shared object file) furryfreak Linux - Software 2 04-03-2009 03:39 AM
have gcc compilation error during gcc installtion in linuxfromscratch vbshanmugaprakash Linux - General 3 12-13-2006 05:52 AM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration