Compile GCC 4.9.2 with Intel and AMD support? [SOLVED]

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
User avatar
battleshooter
Posts: 1378
Joined: Wed 14 May 2008, 05:10
Location: Australia

Compile GCC 4.9.2 with Intel and AMD support? [SOLVED]

#1 Post by battleshooter »

Gonna cheat a little tonight and recruit direct assistance from the old hands of the forum.

So, I compiled GCC 4.9.2... but the resultant build only builds with AMD (the processor I compiled with) and not Intel. I used the instructions from LFS and this is the third or fourth pass, at least second with the matching tool chain.

Using this configure nicked from LFS:

Code: Select all

SED=sed                       \
../gcc-4.9.2/configure        \
     --prefix=/usr            \
     --enable-languages=c,c++ \
     --disable-bootstrap      \
     --with-system-zlib
make -k -j5 check returns only 7 unexpected failures and it seems to compile fine on AMD processors as I've compiled "XORG and friends" and Billtoo has also confirmed compiling on AMD but not Intel.

The error I get when compiling on an Intel processor:

Code: Select all

_=/usr/bin/make: In function 'net_loss':
_=/usr/bin/make:913:3: internal compiler error: Segmentation fault
mv -f .deps/split.Tpo .deps/split.Po
gcc -DHAVE_CONFIG_H  -I.     -g -O2 -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng12 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/X11R7/include/pixman-1 -I/usr/X11R7/include  -Wall -Wno-pointer-sign -MT report.o -MD -MP -MF .deps/report.Tpo -c -o report.o report.c
mv -f .deps/display.Tpo .deps/display.Po
bin/bash: In function 'report_close':
bin/bash:167:3: internal compiler error: Segmentation fault
gcc -DHAVE_CONFIG_H  -I.     -g -O2 -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng12 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/X11R7/include/pixman-1 -I/usr/X11R7/include  -Wall -Wno-pointer-sign -MT getopt.o -MD -MP -MF .deps/getopt.Tpo -c -o getopt.o getopt.c
mv -f .deps/mtr.Tpo .deps/mtr.Po
mv -f .deps/getopt.Tpo .deps/getopt.Po
gcc -DHAVE_CONFIG_H  -I.     -g -O2 -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng12 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/X11R7/include/pixman-1 -I/usr/X11R7/include  -Wall -Wno-pointer-sign -MT getopt1.o -MD -MP -MF .deps/getopt1.Tpo -c -o getopt1.o getopt1.c
gcc -DHAVE_CONFIG_H  -I.     -g -O2 -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng12 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/X11R7/include/pixman-1 -I/usr/X11R7/include  -Wall -Wno-pointer-sign -MT select.o -MD -MP -MF .deps/select.Tpo -c -o select.o select.c
0xb749fdc7 ???
	/mnt/sda3/Saluki/Chrome/GCC-GLIBC/glibc-2.20/signal/../sysdeps/unix/sysv/linux/i386/sigaction.c:0
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
0xb74abdc7 ???
	/mnt/sda3/Saluki/Chrome/GCC-GLIBC/glibc-2.20/signal/../sysdeps/unix/sysv/linux/i386/sigaction.c:0
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
Makefile:491: recipe for target 'report.o' failed
make[2]: *** [report.o] Error 1
make[2]: *** Waiting for unfinished jobs....
Makefile:491: recipe for target 'net.o' failed
make[2]: *** [net.o] Error 1
mv -f .deps/getopt1.Tpo .deps/getopt1.Po
mv -f .deps/select.Tpo .deps/select.Po
mv -f .deps/dns.Tpo .deps/dns.Po
make[2]: Leaving directory '/root/mtr-master'
Makefile:554: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/root/mtr-master'
Makefile:368: recipe for target 'all' failed
make: *** [all] Error 2
Not sure if that's relevant as I'm fairly sure it's an incompatible processor deal.

So what am I missing?
Last edited by battleshooter on Thu 01 Jan 2015, 14:11, edited 1 time in total.
[url=http://www.murga-linux.com/puppy/viewtopic.php?t=94580]LMMS 1.0.2[/url], [url=http://www.murga-linux.com/puppy/viewtopic.php?t=94593]Ardour 3.5.389[/url], [url=http://www.murga-linux.com/puppy/viewtopic.php?t=94629]Kdenlive 0.9.8[/url]

User avatar
Iguleder
Posts: 2026
Joined: Tue 11 Aug 2009, 09:36
Location: Israel, somewhere in the beautiful desert
Contact:

#2 Post by Iguleder »

This has nothing to do with the processor. Just upgrade the host GCC and GNU make to the latest stable version.
[url=http://dimakrasner.com/]My homepage[/url]
[url=https://github.com/dimkr]My GitHub profile[/url]

User avatar
battleshooter
Posts: 1378
Joined: Wed 14 May 2008, 05:10
Location: Australia

#3 Post by battleshooter »

Iguleder wrote:This has nothing to do with the processor. Just upgrade the host GCC and GNU make to the latest stable version.
GCC is at 4.9.2 and make is at 4.1.

Also running the same remaster with versions GCC 4.9.2, make 4.1, binutils 2.24, glibc-2.20 on an AMD produces a successful compilation, but same package, same remaster on an Intel produces the error. Thanks for the reply Iguleder.
[url=http://www.murga-linux.com/puppy/viewtopic.php?t=94580]LMMS 1.0.2[/url], [url=http://www.murga-linux.com/puppy/viewtopic.php?t=94593]Ardour 3.5.389[/url], [url=http://www.murga-linux.com/puppy/viewtopic.php?t=94629]Kdenlive 0.9.8[/url]

User avatar
battleshooter
Posts: 1378
Joined: Wed 14 May 2008, 05:10
Location: Australia

#4 Post by battleshooter »

Can anyone show me what options they normally use when configuring GCC?
[url=http://www.murga-linux.com/puppy/viewtopic.php?t=94580]LMMS 1.0.2[/url], [url=http://www.murga-linux.com/puppy/viewtopic.php?t=94593]Ardour 3.5.389[/url], [url=http://www.murga-linux.com/puppy/viewtopic.php?t=94629]Kdenlive 0.9.8[/url]

amigo
Posts: 2629
Joined: Mon 02 Apr 2007, 06:52

#5 Post by amigo »

Code: Select all

../gcc-${VERSION}/configure --prefix=/usr \
		--libdir=/usr/lib${LIBDIRSUFFIX} \
		--enable-shared \
		--enable-bootstrap \
		--enable-languages=c,c++ \
		--enable-threads=posix \
		--enable-checking=release \
		--with-system-zlib \
		--with-python-dir=/lib${LIBDIRSUFFIX}/python2.6/site-packages \
		--disable-libunwind-exceptions \
		--enable-__cxa_atexit \
		--enable-libssp \
		--enable-lto \
		--with-gnu-ld \
		${GCC_ARCHOPTS} \
		--build=${TARGET} \
		--target=${TARGET} \
		--host=${TARGET}
That's for 32bit. Building for 64bit and/or multilib support will use more options and, possibly, tricks.
More important than the version of 'make', is the version of binutils and glibc.

User avatar
battleshooter
Posts: 1378
Joined: Wed 14 May 2008, 05:10
Location: Australia

#6 Post by battleshooter »

Thanks amigo.

What's the value of TARGET?
amigo wrote:That's for 32bit. Building for 64bit and/or multilib support will use more options and, possibly, tricks.
I'm building for 32bit. For the Carolina Vanguard project. Just trying to upgrade Carolina.

I don't think I need multilibs. I misunderstood it initially, thinking it it was the cause of my error, but now I think enables compiling for 32-bit or 64 bit?.
[url=http://www.murga-linux.com/puppy/viewtopic.php?t=94580]LMMS 1.0.2[/url], [url=http://www.murga-linux.com/puppy/viewtopic.php?t=94593]Ardour 3.5.389[/url], [url=http://www.murga-linux.com/puppy/viewtopic.php?t=94629]Kdenlive 0.9.8[/url]

amigo
Posts: 2629
Joined: Mon 02 Apr 2007, 06:52

#7 Post by amigo »

Yes, multilib creates a compiler which can compile for 32 or 64 bit. TARGET should be the proper triplet of the existing toolchain, unless you are cross-compiling or creating an auxiliary compiler. You can find the current triplet with:
gcc -dumpmachine
assuming that your main compiler is the first one found in your PATH.

User avatar
Billtoo
Posts: 3720
Joined: Tue 07 Apr 2009, 13:47
Location: Ontario Canada

#8 Post by Billtoo »

battleshooter wrote:Can anyone show me what options they normally use when configuring GCC?
I compiled gcc-4.9.2 in Racy 5.5 by following the instructions at this
web site:

http://www.linuxfromscratch.org/blfs/vi ... l/gcc.html

It took a long time and I also compiled these:

dejagnu-1.5.1-i686.pet,expect5.45-i686.pet,gmp-6.0.0-i686.pet,mpc-1.0.2-i686.pet,
mpfr-3.1.2-i686.pet, and tcl8.6.3-i686.pet

# uname -ra
Linux puppypc24626 3.0.66 #1 SMP Wed Feb 27 21:59:56 GMT-8 2013 i686 GNU/Linux

# gcc --version
gcc (GCC) 4.9.2
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#

It's working fine I think, I compiled links-2.8,fltk and dillo-3.0.4
and they are working fine.

User avatar
battleshooter
Posts: 1378
Joined: Wed 14 May 2008, 05:10
Location: Australia

#9 Post by battleshooter »

amigo wrote:Yes, multilib creates a compiler which can compile for 32 or 64 bit. TARGET should be the proper triplet of the existing toolchain, unless you are cross-compiling or creating an auxiliary compiler. You can find the current triplet with:
gcc -dumpmachine
assuming that your main compiler is the first one found in your PATH.
Ahh, okay, thank you very much.
Billtoo wrote:I compiled gcc-4.9.2 in Racy 5.5 by following the instructions at this
web site
I've been using LFS, can't image there being much of a difference except BLFS has more languages. Anyway, I'll give it a go using BLFS, I'll also reextract gcc-4.9.2, didn't do that last compile, just deleted gcc-build. Thanks for the tip.
[url=http://www.murga-linux.com/puppy/viewtopic.php?t=94580]LMMS 1.0.2[/url], [url=http://www.murga-linux.com/puppy/viewtopic.php?t=94593]Ardour 3.5.389[/url], [url=http://www.murga-linux.com/puppy/viewtopic.php?t=94629]Kdenlive 0.9.8[/url]

User avatar
battleshooter
Posts: 1378
Joined: Wed 14 May 2008, 05:10
Location: Australia

#10 Post by battleshooter »

As an update, I tried compiling GCC on an Intel machine, but for some reason, half way through compilation make fails with

Code: Select all

../../../gcc-4.9.2/libgomp/config/linux/proc.c:202:2: error: floating constant truncated to zero [-Werror=overflow]
  loadavg = dloadavg[2] + 0.1;
  ^
cc1: all warnings being treated as errors 
It gives the same error in both Carolina (without any glibc updates, make, etc) and Racy 5.5.

--disable-werror, doesn't seem to make a difference, but I suppose I'd rather not have the warning at all versus just ignoring it unless someone can verify it's not a big deal.
[url=http://www.murga-linux.com/puppy/viewtopic.php?t=94580]LMMS 1.0.2[/url], [url=http://www.murga-linux.com/puppy/viewtopic.php?t=94593]Ardour 3.5.389[/url], [url=http://www.murga-linux.com/puppy/viewtopic.php?t=94629]Kdenlive 0.9.8[/url]

User avatar
battleshooter
Posts: 1378
Joined: Wed 14 May 2008, 05:10
Location: Australia

#11 Post by battleshooter »

Right. The issue was incorrectly compiled GCC dependencies.

Specifically mpfr-3.1.2, gmp-6.0.0.

While I haven't tested it, I suspect I missed a patch for mpfr, I'm not really sure what went wrong with gmp.

Many thanks to Billtoo who helped me solve this issue.

http://www.murga-linux.com/puppy/viewto ... 272#818272
[url=http://www.murga-linux.com/puppy/viewtopic.php?t=94580]LMMS 1.0.2[/url], [url=http://www.murga-linux.com/puppy/viewtopic.php?t=94593]Ardour 3.5.389[/url], [url=http://www.murga-linux.com/puppy/viewtopic.php?t=94629]Kdenlive 0.9.8[/url]

amigo
Posts: 2629
Joined: Mon 02 Apr 2007, 06:52

#12 Post by amigo »

Getting rid of '-Werror' wil let compiling proceed, although those warnings may be fatal at run-time. I see you posting output with the same problem 'floating constant truncated to zero' in other threads. You are using an unsane toolchain. gmp, mpfr, mpc, binutils and gcc itself must be compiled in a certain order in order to create a sane toolchain. Read up on how to bootstrap a system toolchain.

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#13 Post by technosaurus »

The last time I built gcc, I used the combined tree method. I probably should have written some notes because it made the process go a lot smoother than the sequential method. I also made a few libs shared that are normally static because binutils can't figure out versioning. I may add another gcc fork of 4.7.4 and corresponding binutils to my github page (I already forked the last gpl2 version so may as well fork the last c version). Should I just go ahead and do it as a combined tree to make it simpler to bootstrap?
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

Post Reply