LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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-27-2010, 02:00 AM   #1
corbis_demon
Member
 
Registered: Jun 2004
Location: India
Distribution: Slack 13
Posts: 494

Rep: Reputation: 35
Errors while building g77 compiler on a CLFS pure64 system


Hi,
I'm trying to build the Fortran77 compiler from gcc-3.4.6 on my 64-bit CLFS machine. But each time I hit upon this error, no matter how I tweak compile options:
Code:
stage1/xgcc -Bstage1/ -B/opt/gcc-3.4.6/x86_64-unknown-linux-gnu/bin/   -g -O2 -DIN_GCC   -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long -Wold-style-definition     -DHAVE_CONFIG_H -DGENERATOR_FILE  -o genmodes \
 genmodes.o errors.o ../libiberty/libiberty.a
stage1/xgcc -Bstage1/ -B/opt/gcc-3.4.6/x86_64-unknown-linux-gnu/bin/   -g -O2 -DIN_GCC   -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long -Wold-style-definition     -DHAVE_CONFIG_H -DGENERATOR_FILE  -o gengenrtl \
 gengenrtl.o ../libiberty/libiberty.a
stage1/xgcc -Bstage1/ -B/opt/gcc-3.4.6/x86_64-unknown-linux-gnu/bin/   -g -O2 -DIN_GCC   -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long -Wold-style-definition     -DHAVE_CONFIG_H -DGENERATOR_FILE  -o gencheck \
 gencheck.o ../libiberty/libiberty.a
./genmodes -h > tmp-modes.h
/bin/sh: ./genmodes: No such file or directory
make[2]: *** [s-modes] Error 127
make[2]: *** Waiting for unfinished jobs....
/bin/sh ../../gcc/move-if-change tmp-mlib.h multilib.h
multilib.h is unchanged
echo timestamp > s-mlib
make[2]: Leaving directory `/tmp/gcc-3.4.6/gcc-build/gcc'
make[1]: *** [stage2_build] Error 2
make[1]: Leaving directory `/tmp/gcc-3.4.6/gcc-build/gcc'
make: *** [bootstrap] Error 2
I used these configure options:
Code:
CFLAGS="-march=x86-64 -mtune=generic -O2 -pipe" \
  ../configure \
    --prefix=/opt/gcc-$VERSION \
    --libexecdir=/opt/gcc-$VERSION/lib \
    --mandir=/opt/gcc-$VERSION/share/man \
    --infodir=/opt/gcc-$VERSION/share/info \
    --enable-shared \
    --enable-threads=posix \
    --enable-__cxa_atexit \
    --enable-clocale=gnu \
    --enable-languages=c,f77 \
    --disable-multilib
I of course build a separate build directory from where I run the configure and make commands (I searched online and found that not building from within a separate build directory would cause this). But it hasn't helped. What could be wrong? I used these instructions while building.

EDIT: gcc-3.4.6 compiles fine on every 64-bit machine I ran it on. They ( the OS's on those machines )also have the same CFLAGS, CHOST and CTARGET values as the CLFS system.

Last edited by corbis_demon; 11-27-2010 at 02:13 AM. Reason: Information added
 
Old 11-27-2010, 06:37 AM   #2
crts
Senior Member
 
Registered: Jan 2010
Posts: 1,604

Rep: Reputation: 446Reputation: 446Reputation: 446Reputation: 446Reputation: 446
Quote:
Originally Posted by corbis_demon View Post
I used these instructions while building.
Hi,

according to what you posted
Code:
CFLAGS="-march=x86-64 -mtune=generic -O2 -pipe" \
  ../configure \
    --prefix=/opt/gcc-$VERSION \
    --libexecdir=/opt/gcc-$VERSION/lib \
    --mandir=/opt/gcc-$VERSION/share/man \
    --infodir=/opt/gcc-$VERSION/share/info \
    --enable-shared \
    --enable-threads=posix \
    --enable-__cxa_atexit \
    --enable-clocale=gnu \
    --enable-languages=c,f77 \
    --disable-multilib
you did not use the same instructions as in the link you provided. Look at the location of the 'configure' command. If this is not a typo in your post then it appears that your build directory is a subdirectory in your gcc source directory:
Code:
- gcc-3.4.6
| - gcc-build
This is not correct. The folder structure should look like
Code:
- gcc-3.4.6
- gcc-build
So the 'configure' command should be something like
Code:
  ../gcc-3.4.6/configure \
    --prefix=/opt/gcc-$VERSION \
....
 
Old 11-27-2010, 09:15 AM   #3
corbis_demon
Member
 
Registered: Jun 2004
Location: India
Distribution: Slack 13
Posts: 494

Original Poster
Rep: Reputation: 35
Yeah, sorry, I just pasted the instructions from the LFS page "as is". I did of course use a build dir outside of the source tree.
 
Old 11-28-2010, 10:26 AM   #4
crts
Senior Member
 
Registered: Jan 2010
Posts: 1,604

Rep: Reputation: 446Reputation: 446Reputation: 446Reputation: 446Reputation: 446
Quote:
Originally Posted by corbis_demon View Post
Yeah, sorry, I just pasted the instructions from the LFS page "as is". I did of course use a build dir outside of the source tree.
Well, your output
Code:
make[2]: Leaving directory `/tmp/gcc-3.4.6/gcc-build/gcc'
make[1]: *** [stage2_build] Error 2
make[1]: Leaving directory `/tmp/gcc-3.4.6/gcc-build/gcc'
also implicates that your build directory is a subfolder in your source directory. So it is not outside of the source tree - according to your output.
 
Old 11-29-2010, 02:06 AM   #5
corbis_demon
Member
 
Registered: Jun 2004
Location: India
Distribution: Slack 13
Posts: 494

Original Poster
Rep: Reputation: 35
Very sorry to post confusing and erroneous information. Actually the error in the case when the build dir is in the source dir, was from when I used a script to automate the process. I had posted those same intructions in the first post. I had since corrected it and still got the same error. The solution seems to be to use the complete gcc-3.4.6 tarball instead of only the gcc-core and gcc-g77 sources. Now the build finishes without errors. Thank you for your observations.
 
  


Reply


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
Building CLFS with LFS? ProtoformX Linux From Scratch 2 04-07-2010 02:28 PM
how to install git (CLFS Pure64) charlie_lab Linux From Scratch 4 03-29-2010 11:07 AM
gcc problem (chapter 6.4.1 of the Pure64 CLFS book) charlie_lab Linux From Scratch 0 03-14-2010 08:51 AM
g77 compiler for opensuse 11.1 pratyuze Linux - Software 4 04-30-2009 04:06 AM
Building g77 on Suse 8.1 dovkruger Linux - Software 1 01-26-2004 11:29 AM


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

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