Arch Linux

Please read this before reporting a bug:

Do NOT report bugs when a package is just outdated, or it is in Unsupported. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!

FS#2299 - gcc-g77 creates "bad" executables

Attached to Project: Arch Linux
Opened by Eric Belanger (Snowman) - Monday, 28 February 2005, 22:23 GMT
Last edited by Jan de Groot (JGC) - Wednesday, 02 March 2005, 07:46 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Jan de Groot (JGC)
Architecture not specified
Severity High
Priority Normal
Reported Version 0.7 Wombat
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No


gcc-g77 can compile the program without error but when I try to run it, the hard drive starts acting up thus slowing the computer. According to gkrellm, MBs of data are written to the hard drive. It is definitely not due to my small program. And, I'm pretty sure that it is not due to any background task. I also tried with a different program with same results.
If I use my version of gcc-g77 or the Intel compiler, the programs are compiled and executed in less than 5 seconds.
Here is a working PKGBUILD:
pkgdesc="The GNU Fortran Compiler"
depends=('glibc' 'gcc=3.4.3')

build() {
cd $startdir/src/gcc-$pkgver
# changing maximum number of file unit
sed -i 's/#define MXUNIT 100/#define MXUNIT 1000/' libf2c/libI77/fio.h
mkdir ../gcc-build
cd ../gcc-build
../gcc-$pkgver/configure --prefix=/usr \
--enable-shared \
--enable-languages=f77 \
--enable-threads=posix \
make bootstrap || return 1
make DESTDIR=$startdir/pkg install || return 1
mkdir -p $startdir/pkg/lib

# get rid of the references to my build dir
chmod 644 $startdir/pkg/usr/lib/*.la

# removing files provided by gcc
rm -r $startdir/pkg/usr/lib/{*,libiberty.a}
rm $startdir/pkg/usr/lib/gcc/i686-pc-linux-gnu/$pkgver/{*.o,*.a,specs}
rm $startdir/pkg/usr/lib/gcc/i686-pc-linux-gnu/$pkgver/include/{README,emmintrin.h,float.h,iso646.h,limits.h,mmintrin.h,pmmintrin.h,s*,unwind.h,varargs.h,xmmintrin.h,dbm/ncompat.h}
rm $startdir/pkg/usr/lib/gcc/i686-pc-linux-gnu/$pkgver/install-tools/*
rm -r $startdir/pkg/usr/lib/gcc/i686-pc-linux-gnu/$pkgver/install-tools/include/*
rm -r $startdir/pkg/usr/share/locale/{be,ca,da,de,el,es,fr,ja,nl,sv,tr}/LC_MESSAGES/*
rm -r $startdir/pkg/usr/libexec/gcc/i686-pc-linux-gnu/$pkgver/install-tools/*
rm -r $startdir/pkg/usr/libexec/gcc/i686-pc-linux-gnu/$pkgver/c*
rm $startdir/pkg/usr/bin/{cpp,gcc,gccbug,gcov,i686*}
rm $startdir/pkg/usr/man/man1/{gc*,cpp.1}
rm $startdir/pkg/usr/man/man7/*

The main differences with the one from Arch CVS are:
1. The use of the gcc-core-$pkgver.tar.bz2 sources (reason=?)
2. The official PKGBUILD compiles with:
make || return 1
while the working PKGBUILD compiles with:
make bootstrap || return 1

That might be the problem.
This task depends upon

Closed by  Jan de Groot (JGC)
Thursday, 03 March 2005, 10:09 GMT
Reason for closing:  Fixed
Comment by Jan de Groot (JGC) - Monday, 28 February 2005, 23:55 GMT
I compiled at least one package with it without problems, but the make bootstrap makes a point here. The gcc-core tarball vs the two I use doesn't make a difference, it only pulls much more bandwidth from the GNU download servers in your PKGBUILD.
Comment by Eric Belanger (Snowman) - Tuesday, 01 March 2005, 17:44 GMT
As for the sources, I haven't realized that, apart from the gcc-core tarball, you were using the gcc-g77 and not the whole gcc tarball.

I did extra tests with a "hello world" program. I found out that, after the string is printed (almost instantly), the program starts to use a LOTS of memory. It used the remaining 110 MB of my RAM plus another 230 MB of swap. This explains the high disk activity. After a while, the program stops without any error message.
Comment by Jan de Groot (JGC) - Wednesday, 02 March 2005, 07:46 GMT
Please verify if this package fixes your problem:
Comment by jan willem (jw) - Wednesday, 02 March 2005, 13:40 GMT
I do not know about the compile problems, but the new pakage does fix breakage of "octave" on my system:

With gcc-g77-3.4.3-1 octave would crash complaining about an error loading the shared library "". With the new pakage octave runs fine.