LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (https://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   Errors while building g77 compiler on a CLFS pure64 system (https://www.linuxquestions.org/questions/linux-from-scratch-13/errors-while-building-g77-compiler-on-a-clfs-pure64-system-846827/)

corbis_demon 11-27-2010 02:00 AM

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.

crts 11-27-2010 06:37 AM

Quote:

Originally Posted by corbis_demon (Post 4172451)
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 \
....


corbis_demon 11-27-2010 09:15 AM

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.

crts 11-28-2010 10:26 AM

Quote:

Originally Posted by corbis_demon (Post 4172712)
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.

corbis_demon 11-29-2010 02:06 AM

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.


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