Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved] gcc > 4.6.3 emerge fails, computing EOF failed
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
xbittwiddler
n00b
n00b


Joined: 26 Feb 2014
Posts: 15

PostPosted: Wed Feb 26, 2014 12:24 pm    Post subject: [Solved] gcc > 4.6.3 emerge fails, computing EOF failed Reply with quote

Hello all,

I've been trying to emerge gcc ever since the gentoo devs deprecated the mudflap USE flag, but whenever I run `emerge -aNv =sys-devel/gcc-4.6.3`, I get the following error during configure-target-libstdc++-v3:

Code:

checking for the value of EOF... configure: error: computing EOF failed
make[1]: *** [configure-target-libstdc++-v3] Error 1
make[1]: Leaving directory `/var/tmp/portage/sys-devel/gcc-4.6.3/work/build'
make: *** [bootstrap-lean] Error 2


the odd thing is that in prior parts of the compilation process, EOF is detected just fine. I've read that this issue can affect cross-compiler builds, especially when using newlib and that it has to do with the compiler not finidng stdio.h.

However, I am using glibc-2.15-r3 I have stdio.h in /usr/include, defining EOF as -1.

Has anyone else dealt with this before?

Architecture: x86_64, glibc-2.15-r3, gcc-4.6.3.


Last edited by xbittwiddler on Tue Mar 04, 2014 8:20 pm; edited 5 times in total
Back to top
View user's profile Send private message
GentooWiz
n00b
n00b


Joined: 26 Feb 2014
Posts: 5

PostPosted: Wed Feb 26, 2014 3:02 pm    Post subject: Reply with quote

Hey, this is pretty basic stuff. Have you tried a distro like Ubuntu first? Beginners should usually start there or with something more simplistic to warm up to Gentoo. Good Luck!
Back to top
View user's profile Send private message
xbittwiddler
n00b
n00b


Joined: 26 Feb 2014
Posts: 15

PostPosted: Wed Feb 26, 2014 3:13 pm    Post subject: Reply with quote

I've unmasked the entire Gnome3 overlay before and upgraded gcc a few times as well...
I've been using Gentoo for a little more than a year now, so obviously I'm still learning, but I'm not a *total* newbie.

I'm not going back to Ubuntu, and haven't used it for about 2 years now.
Canonical has taken that in a terrible direction with Unity and the constant overhaul and bloating of the default install. Not to mention I like OpenRC and they had that whole upstart and systemd fiasco.

If this is as basic as you say it is, can you point me in the right direction?

Here is my emerge --info:

Code:
Portage 2.2.7 (default/linux/amd64/13.0/desktop, gcc-4.6.3, glibc-2.15-r3, 3.10.25-gentoo x86_64)
=================================================================
System uname: Linux-3.10.25-gentoo-x86_64-AMD_FX-tm-8150_Eight-Core_Processor-with-gentoo-2.2
KiB Mem:    16339236 total,   6141784 free
KiB Swap:    4194132 total,   4194132 free
Timestamp of tree: Sat, 22 Feb 2014 01:30:01 +0000
ld GNU ld (GNU Binutils) 2.23.2
ccache version 3.1.9 [disabled]
app-shells/bash:          4.2_p45
dev-java/java-config:     2.1.12-r1
dev-lang/python:          2.6.8-r3, 2.7.5-r3, 3.2.5-r3, 3.3.3
dev-util/ccache:          3.1.9-r3
dev-util/cmake:           2.8.11.2
dev-util/pkgconfig:       0.28
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.12.4
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.9.6-r3, 1.10.3, 1.11.6, 1.12.6, 1.13.4
sys-devel/binutils:       2.23.2
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4.2
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.9 (virtual/os-headers)
sys-libs/glibc:           2.15-r3
Repositories: gentoo custom-desktop development my-games
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="@FREE freedist as-is CCPL-Attribution-ShareAlike-3.0 CCPL-Attribution-ShareAlike-2.0 CCPL-Attribution-3.0"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O0 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt /usr/share/maven-bin-2.2/conf /usr/share/maven-bin-3.0/conf"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O0 -pipe"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-l 8.5 -j"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage/custom-desktop /usr/local/portage/development /usr/local/portage/my-games"
SYNC="rsync://rsync.us.gentoo.org/gentoo-portage"
USE="X a52 aac acl acpi alsa amd64 berkdb bluetooth branding bzip2 cairo cdda cdr cli consolekit cracklib crypt cups cxx dbus dri dts dvd dvdr emboss encode exif fam firefox flac fortran gdbm gif gpm gtk iconv ipv6 jpeg lcms ldap libnotify mad mmx mng modules mp3 mp4 mpeg multilib ncurses nls nptl ogg opengl openmp pam pango pcre pdf png policykit ppds qt3support qt4 readline sdl session spell sse sse2 ssl startup-notification svg tcpd tiff truetype udev udisks unicode upower usb vorbis wxwidgets x264 xcb xml xv xvid zlib" ABI_X86="64" ALSA_CARDS="hda-intel" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="evdev mouse keyboard" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_3" RUBY_TARGETS="ruby19 ruby18" USERLAND="GNU" VIDEO_CARDS="nouveau virtualbox" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON


Last edited by xbittwiddler on Tue Mar 04, 2014 8:20 pm; edited 1 time in total
Back to top
View user's profile Send private message
GentooWiz
n00b
n00b


Joined: 26 Feb 2014
Posts: 5

PostPosted: Wed Feb 26, 2014 3:25 pm    Post subject: Reply with quote

It's a pretty simple fix. If you look in ccache, there is improper bit ordering causing the EOF error. May have mixed versions. Do a quick google search and you should find what you need. Best of luck. Let me know if that doesn't return anything helpful
Back to top
View user's profile Send private message
xbittwiddler
n00b
n00b


Joined: 26 Feb 2014
Posts: 15

PostPosted: Wed Feb 26, 2014 3:51 pm    Post subject: Reply with quote

Ah, I suspected ccache, so I took out the line in my /etc/make.conf that enabled ccache. I'm now suspecting that maybe that didn't really disable it... I'm going to look up some documentation on that.

Thanks for the pointer. :)
Back to top
View user's profile Send private message
GentooWiz
n00b
n00b


Joined: 26 Feb 2014
Posts: 5

PostPosted: Wed Feb 26, 2014 3:59 pm    Post subject: Reply with quote

Oh after looking at your info again, I see that you actually had ccache enable, so I apologize. You should try enabling that.
Back to top
View user's profile Send private message
GentooWiz
n00b
n00b


Joined: 26 Feb 2014
Posts: 5

PostPosted: Wed Feb 26, 2014 4:05 pm    Post subject: Reply with quote

Enabling and disabling ccache constantly can really cause many problems with the integrity of gcc itself. If you check the bit order I was talking about you may have flipped a bit here and a bit there and then a few over here. Just take all the bits and put them on the pizza
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10587
Location: Somewhere over Atlanta, Georgia

PostPosted: Wed Feb 26, 2014 5:37 pm    Post subject: Reply with quote

xbittwiddler wrote:
Ah, I suspected ccache, so I took out the line in my /etc/make.conf that enabled ccache. I'm now suspecting that maybe that didn't really disable it...
If you took "ccache" out of the FEATURES variable in make.conf then you've disabled it. Is your system otherwise up to date?

- John
_________________
I can confirm that I have received between 0 and 499 National Security Letters.
Back to top
View user's profile Send private message
mv
Watchman
Watchman


Joined: 20 Apr 2005
Posts: 6747

PostPosted: Wed Feb 26, 2014 6:07 pm    Post subject: Reply with quote

GentooWiz wrote:
Enabling and disabling ccache constantly can really cause many problems with the integrity of gcc itself

This is not true, of course. You are probably joking, as you were already when you claim that a failed gcc compile is "basic stuff". Nobody should be expected to know full details of the involved gcc build system just to be able to emerge gcc. There is probably some strange incompatibility with some installed version (glibc, linux-headers, or 32 bit library) there. Perhaps looking at the error in config.log might be enlightening.
Is it visible from the output whether the error occurs when building the x86_64 library or maybe only when building the 32-bit library? In the latter case, are you using the binary emul-linux-x86-* packages or have you unmasked the experimental USE=abi_x86_32?
Back to top
View user's profile Send private message
GentooWiz
n00b
n00b


Joined: 26 Feb 2014
Posts: 5

PostPosted: Wed Feb 26, 2014 8:14 pm    Post subject: Reply with quote

http://www.reactionface.info/sites/default/files/imagecache/Node_Page/images/1287666826226.png
Back to top
View user's profile Send private message
xbittwiddler
n00b
n00b


Joined: 26 Feb 2014
Posts: 15

PostPosted: Wed Feb 26, 2014 8:14 pm    Post subject: Reply with quote

John R. Graham wrote:
xbittwiddler wrote:
Ah, I suspected ccache, so I took out the line in my /etc/make.conf that enabled ccache. I'm now suspecting that maybe that didn't really disable it...
If you took "ccache" out of the FEATURES variable in make.conf then you've disabled it. Is your system otherwise up to date?

- John


Other than my being unable to compile glibc 2.17...
I'm trying to tackle one issue at a time, :( lol

mv wrote:
GentooWiz wrote:
Enabling and disabling ccache constantly can really cause many problems with the integrity of gcc itself

This is not true, of course. You are probably joking, as you were already when you claim that a failed gcc compile is "basic stuff". Nobody should be expected to know full details of the involved gcc build system just to be able to emerge gcc.


Ignore him, he's just a troll.

mv wrote:

There is probably some strange incompatibility with some installed version (glibc, linux-headers, or 32 bit library) there. Perhaps looking at the error in config.log might be enlightening.
Is it visible from the output whether the error occurs when building the x86_64 library or maybe only when building the 32-bit library? In the latter case, are you using the binary emul-linux-x86-* packages or have you unmasked the experimental USE=abi_x86_32?


AFAIK, I havent even touched the x86_32 ABI...


Here's my config.log

I've uploaded the ebuild's build.log, and the environment file, if it helps anyone.


edit: Turns out I had this defined... not sure if this is helpful. ABI_X86="64"


Last edited by xbittwiddler on Tue Mar 04, 2014 8:20 pm; edited 1 time in total
Back to top
View user's profile Send private message
mv
Watchman
Watchman


Joined: 20 Apr 2005
Posts: 6747

PostPosted: Thu Feb 27, 2014 7:38 am    Post subject: Reply with quote

xbittwiddler wrote:
Here's my config.log

I would expect that there is another config.log related to the "configure-target-libstdc++-v3": The one you attached appears to contain no error at all. According to the build log, it seems to me that the compiler was succesfully built and that building fails for the first library (on x86_64), so the 32 bit issue was probably a red herring. (However, I am not expert of the toolchain.)
Back to top
View user's profile Send private message
xbittwiddler
n00b
n00b


Joined: 26 Feb 2014
Posts: 15

PostPosted: Thu Feb 27, 2014 2:37 pm    Post subject: Reply with quote

mv wrote:
xbittwiddler wrote:
Here's my config.log

I would expect that there is another config.log related to the "configure-target-libstdc++-v3":


Whoops. Thats from the gcc work directory root. My bad, like I said, I'm kind of new to troubleshooting the compiler build process.

Here's the config.log from libstdc++.

Thank you for taking the time to look into this. :)
Back to top
View user's profile Send private message
mv
Watchman
Watchman


Joined: 20 Apr 2005
Posts: 6747

PostPosted: Thu Feb 27, 2014 10:26 pm    Post subject: Reply with quote

I am not sure but it appears to me that this also looks fine.
The last message
Code:
configure:66467: result: /usr/lib/gcc/x86_64-pc-linux-gnu/4.7.3/include/g++-v4
might indicate that it is perhaps the logfile for -v4 and not for -v3. Does
Code:
grep -R "the value of EOF" ~portage
give perhaps another log?
Back to top
View user's profile Send private message
xbittwiddler
n00b
n00b


Joined: 26 Feb 2014
Posts: 15

PostPosted: Fri Feb 28, 2014 3:06 am    Post subject: Reply with quote

I actually searched for "computing EOF failed", and found work/build/x86_64-pc-linux-gnu/32/libstdc++-v3/config.log. Seems the issue is with the 32-bit version of the c++ library.

I think i found it at line 1201:
Code:

configure:18740: ./conftest
/var/tmp/portage/sys-devel/gcc-4.6.3/work/gcc-4.6.3/libstdc++-v3/configure: line 1887:  2272 Segmentation fault      ./conftest$ac_exeext
configure:18740: $? = 139
configure: program exited with status 139
configure: failed program was:


So, the test program is segfaulting.

However, when i compile the test program using the old version of gcc on my system, it runs fine. It must be that the xgcc binary is producing bad code?


Last edited by xbittwiddler on Tue Mar 04, 2014 8:21 pm; edited 1 time in total
Back to top
View user's profile Send private message
mv
Watchman
Watchman


Joined: 20 Apr 2005
Posts: 6747

PostPosted: Fri Feb 28, 2014 11:04 am    Post subject: Reply with quote

Just now I realize that you have -O0 in your CFLAGS/CXXFLAGS. This is usually less tested than -O2, and I also had some segfaults with it in connection with the hardened patches. Might be that this is related. (This flag is not used in the offending call but was perhaps used to build gcc before.)

Besides that, I am confused about the combination of -m32 and linking with */x86_64-pc-linux-gnu/* only, but as I said, I am not an expert in the gcc build system.
Back to top
View user's profile Send private message
xbittwiddler
n00b
n00b


Joined: 26 Feb 2014
Posts: 15

PostPosted: Fri Feb 28, 2014 11:11 am    Post subject: Reply with quote

I've only had -O0 set for a few days now to try to rule out an issue with optimization. I believe one of the first things you see when you emerge gcc is that the ebuild replaces -O0 with -O2 -pipe... I will double check but it doesnt sound like this would cause an issue...

But then, you are also telling me you see it set to -O0 for libstdc+++.... i will play with CGLAGS and get back to you.

Edit: Made no difference


Last edited by xbittwiddler on Tue Mar 04, 2014 8:21 pm; edited 4 times in total
Back to top
View user's profile Send private message
xbittwiddler
n00b
n00b


Joined: 26 Feb 2014
Posts: 15

PostPosted: Sat Mar 01, 2014 5:19 am    Post subject: Interesting finding Reply with quote

I added xgcc's folder to my $PATH and used the command line parameters that ./configure was using, and compiled the EOF test program.

I executed:
Code:

xgcc -shared-libgcc -B/var/tmp/portage/sys-devel/gcc-4.6.3/work/build/./gcc -nostdinc++ -L/var/tmp/portage/sys-devel/gcc-4.6.3/work/build/x86_64-pc-linux-gnu/32/libstdc++-v3/src -L/var/tmp/portage/sys-devel/gcc-4.6.3/work/build/x86_64-pc-linux-gnu/32/libstdc++-v3/src/.libs -B/usr/x86_64-pc-linux-gnu/bin/ -B/usr/x86_64-pc-linux-gnu/lib/ -isystem /usr/x86_64-pc-linux-gnu/include -isystem /usr/x86_64-pc-linux-gnu/sys-include  -m32 -ggdb test.cpp


and ran the a.out in gdb.

Code:

rogram received signal SIGSEGV, Segmentation fault.
0x00000000 in ?? ()
(gdb) bt
#0  0x00000000 in ?? ()
#1  0xf7f1aa81 in _dl_addr () from /mnt/gentoo32/lib/libc.so.6
#2  0xf7e7dede in ?? () from /mnt/gentoo32/lib/libc.so.6
#3  0xffffd0f8 in ?? ()


It's attempting to use libc.so from my 32-bit chroot!. 8O

D'oh!!!
When I followed the tutorial to setup my chroot, I suppose I naïvely created a file /etc/ld.so.conf.d/06-chroot32.conf containing the /mnt/gentoo32 directories. And I did so not realizing that the author was probably not using a multilib profile!

Edit 1: I took the file out and ran ldconfig, and now ./a.out no longer segfaults. Going to recompile gcc now.
Edit 2: It worked! Thanks for your guidance. I couldn't have known where to even start looking without you guys. :)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum