Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Floating point errors reemerging gcc on arm (BeagleBone)
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
zomnut
n00b
n00b


Joined: 25 Aug 2012
Posts: 8

PostPosted: Sat Aug 25, 2012 1:49 pm    Post subject: Floating point errors reemerging gcc on arm (BeagleBone) Reply with quote

Ran "emerge -u --newuse world" which tries to reemerge gcc 4.5.3-r2. Build fails while linking libgcc with multipe errors of the following type, all ending with: "./libgcc_s.so.1.tmp does not"
Code:
/usr/armv7a-unknown-linux-gnueabi/bin/ld: error: _muldi3_s.o uses VFP register arguments, ./libgcc_s.so.1.tmp does not

The only USE change I notice is a change from -libffi to (-libffi%)
All other packages have updated without error.

Additional information:
Code:
$ emerge --info '=sys-devel/gcc-4.5.3-r2'
Portage 2.1.11.9 (default/linux/arm/10.0/armv7a, gcc-4.5.3, glibc-2.14.1-r3, 3.1.0-00010-g66bfbd2 armv7l)
=================================================================
                        System Settings
=================================================================
System uname: Linux-3.1.0-00010-g66bfbd2-armv7l-ARMv7_Processor_rev_2_-v7l-with-gentoo-2.1
Timestamp of tree: Fri, 24 Aug 2012 16:15:01 +0000
app-shells/bash:          4.2_p37
dev-lang/python:          2.7.3-r2, 3.2.3
dev-util/pkgconfig:       0.27
sys-apps/baselayout:      2.1-r1
sys-apps/openrc:          0.9.8.4
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.68
sys-devel/automake:       1.11.6
sys-devel/binutils:       2.22-r1
sys-devel/gcc:            4.5.3-r2
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82-r3
sys-kernel/linux-headers: 3.4-r2 (virtual/os-headers)
sys-libs/glibc:           2.14.1-r3
Repositories: gentoo
ACCEPT_KEYWORDS="arm"
ACCEPT_LICENSE="* -@EULA"
CBUILD="armv7a-unknown-linux-gnueabi"
CFLAGS="-O2 -pipe -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=softfp"
CHOST="armv7a-unknown-linux-gnueabi"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.4/ext-active/ /etc/php/cgi-php5.4/ext-active/ /etc/php/cli-php5.4/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=softfp"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=softfp"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles news parallel-fetch parse-eapi-ebuild-head protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS="-O2 -pipe -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=softfp"
GENTOO_MIRRORS="http://mirror.csclub.uwaterloo.ca/gentoo-distfiles/"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --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=""
SYNC="rsync://rsync4.ca.gentoo.org/gentoo-portage"
USE="acl arm berkdb bzip2 cli cracklib crypt cups cxx fortran gdbm gpm iconv ipv6 modules mudflap ncurses nls nptl openmp pam pcre pppd readline session ssl tcpd unicode zlib" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="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" 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 ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" PHP_TARGETS="php5-4" PYTHON_TARGETS="python2_7" RUBY_TARGETS="ruby18 ruby19" USERLAND="GNU" VIDEO_CARDS="exynos fbdev omap omapfb dummy v4l" 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, LANG, LC_ALL, LINGUAS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON

=================================================================
                        Package Settings
=================================================================

sys-devel/gcc-4.5.3-r2 was built with the following:
USE="cxx fortran mudflap nls nptl openmp (-altivec) -bootstrap -build -doc (-fixed-point) -gcj -graphite -gtk (-hardened) -libffi (-libssp) -lto (-multilib) -multislot -nocxx -nopie -nossp -objc -objc++ -objc-gc -test -vanilla"
CFLAGS="-O2 -pipe -march=armv7-a -mfpu=vfpv3-d16"
CXXFLAGS="-O2 -pipe -march=armv7-a -mfpu=vfpv3-d16"

Code:
$ emerge -pqv '=sys-devel/gcc-4.5.3-r2'
[ebuild   R   ] sys-devel/gcc-4.5.3-r2  USE="cxx fortran mudflap nls nptl openmp (-altivec) -bootstrap -build -doc (-fixed-point) -gcj -graphite -gtk (-hardened) (-libssp) -lto (-multilib) -multislot -nocxx -nopie -nossp -objc -objc++ -objc-gc -test -vanilla (-libffi%)"
Back to top
View user's profile Send private message
loki_val
Retired Dev
Retired Dev


Joined: 13 Nov 2006
Posts: 418
Location: Denmark

PostPosted: Sat Aug 25, 2012 3:28 pm    Post subject: Reply with quote

Look at your CFLAGS and those the previous GCC were built with. Looks like you're trying to change ABI, which is a non-trivial operation. I think what you're looking for is a new install using a armv7a-softfloat-linux-gnueabi toolchain. I've never tried going from one ABI to another "on the fly", but something tells me it will be easier to use the correct stage to begin with.
Back to top
View user's profile Send private message
zomnut
n00b
n00b


Joined: 25 Aug 2012
Posts: 8

PostPosted: Sat Aug 25, 2012 3:28 pm    Post subject: Reply with quote

Searching the changelogs for the gcc package I found this, which falls after my last build of gcc (March 1) and pertains to hard/soft floating points in gcc-4.5.3-r2. Could this be the source of the issue?
Code:
10 May 2012; Mike Frysinger <vapier@gentoo.org> gcc-4.5.3-r2.ebuild, gcc-4.6.3.ebuild:
Push out hppa 64bit fix #382075 by Jeroen Roovers, and new arm hardfp ldso path.
Back to top
View user's profile Send private message
zomnut
n00b
n00b


Joined: 25 Aug 2012
Posts: 8

PostPosted: Sat Aug 25, 2012 3:35 pm    Post subject: Reply with quote

loki_val wrote:
Look at your CFLAGS and those the previous GCC were built with. Looks like you're trying to change ABI, which is a non-trivial operation. I think what you're looking for is a new install using a armv7a-softfloat-linux-gnueabi toolchain. I've never tried going from one ABI to another "on the fly", but something tells me it will be easier to use the correct stage to begin with.


That's odd... I've never (read: don't recall ever) changed the mfloat-abi cflags value in make.conf... now I have to dig around more...
Back to top
View user's profile Send private message
zomnut
n00b
n00b


Joined: 25 Aug 2012
Posts: 8

PostPosted: Sat Aug 25, 2012 5:33 pm    Post subject: Reply with quote

Removing the mfloat-abi CFLAG does not fix the problem. Also in reading the errors (and using the representative error line quoted earlier)
Code:
/usr/armv7a-unknown-linux-gnueabi/bin/ld: error: _muldi3_s.o uses VFP register arguments, ./libgcc_s.so.1.tmp does not

_muldi3_s.o is in the current build directory "/var/tmp/portage/sys-devel/gcc-4.5.3-r2/work/build/armv7a-unknown-linux-gnueabi/libgcc" and ./libgcc_s.so.1.tmp would also be in the current build, so why would they be built with different ABIs?

Code:
/usr/armv7a-unknown-linux-gnueabi/bin/ar  rc libgcc_eh.a $objects
/usr/armv7a-unknown-linux-gnueabi/bin/ranlib libgcc_eh.a
/usr/armv7a-unknown-linux-gnueabi/bin/ld: error: /var/tmp/portage/sys-devel/gcc-4.5.3-r2/work/build/./gcc/crtbeginS.o uses VFP register arguments, ./libgcc_s.so.1.tmp does not
/usr/armv7a-unknown-linux-gnueabi/bin/ld: failed to merge target specific data of file /var/tmp/portage/sys-devel/gcc-4.5.3-r2/work/build/./gcc/crtbeginS.o
/usr/armv7a-unknown-linux-gnueabi/bin/ld: error: _muldi3_s.o uses VFP register arguments, ./libgcc_s.so.1.tmp does not
/usr/armv7a-unknown-linux-gnueabi/bin/ld: failed to merge target specific data of file _muldi3_s.o
/usr/armv7a-unknown-linux-gnueabi/bin/ld: error: _negdi2_s.o uses VFP register arguments, ./libgcc_s.so.1.tmp does not
/usr/armv7a-unknown-linux-gnueabi/bin/ld: failed to merge target specific data of file _negdi2_s.o
/usr/armv7a-unknown-linux-gnueabi/bin/ld: error: _cmpdi2_s.o uses VFP register arguments, ./libgcc_s.so.1.tmp does not
/usr/armv7a-unknown-linux-gnueabi/bin/ld: failed to merge target specific data of file _cmpdi2_s.o
/usr/armv7a-unknown-linux-gnueabi/bin/ld: error: _ucmpdi2_s.o uses VFP register arguments, ./libgcc_s.so.1.tmp does not
/usr/armv7a-unknown-linux-gnueabi/bin/ld: failed to merge target specific data of file _ucmpdi2_s.o
...
...
...
/usr/armv7a-unknown-linux-gnueabi/bin/ld: error: /var/tmp/portage/sys-devel/gcc-4.5.3-r2/work/build/./gcc/crtendS.o uses VFP register arguments, ./libgcc_s.s
o.1.tmp does not
/usr/armv7a-unknown-linux-gnueabi/bin/ld: failed to merge target specific data of file /var/tmp/portage/sys-devel/gcc-4.5.3-r2/work/build/./gcc/crtendS.o
collect2: ld returned 1 exit status
make[3]: *** [libgcc_s.so] Error 1
make[3]: Leaving directory `/var/tmp/portage/sys-devel/gcc-4.5.3-r2/work/build/armv7a-unknown-linux-gnueabi/libgcc'
make[2]: *** [all-stage1-target-libgcc] Error 2
make[2]: Leaving directory `/var/tmp/portage/sys-devel/gcc-4.5.3-r2/work/build'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/var/tmp/portage/sys-devel/gcc-4.5.3-r2/work/build'
make: *** [bootstrap-lean] Error 2
emake failed
 * ERROR: sys-devel/gcc-4.5.3-r2 failed (compile phase):
 *   emake failed with bootstrap-lean
 *
 * Call stack:
 *     ebuild.sh, line   85:  Called src_compile
 *   environment, line 3997:  Called toolchain_src_compile
 *   environment, line 4637:  Called gcc_do_make
 *   environment, line 2325:  Called die
 * The specific snippet of code:
 *       emake LDFLAGS="${LDFLAGS}" STAGE1_CFLAGS="${STAGE1_CFLAGS}" LIBPATH="${LIBPATH}" BOOT_CFLAGS="${BOOT_CFLAGS}" ${GCC_MAKE_TARGET} || die "emake failed with ${GCC_MAKE_TARGET}";
 *
 * If you need support, post the output of `emerge --info '=sys-devel/gcc-4.5.3-r2'`,
 * the complete build log and the output of `emerge -pqv '=sys-devel/gcc-4.5.3-r2'`.
 *
 * Please include /var/tmp/portage/sys-devel/gcc-4.5.3-r2/work/build/gcc-build-logs.tar.bz2 in your bug report
 *
 * The complete build log is located at '/var/tmp/portage/sys-devel/gcc-4.5.3-r2/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/sys-devel/gcc-4.5.3-r2/temp/environment'.
 * Working directory: '/var/tmp/portage/sys-devel/gcc-4.5.3-r2/work/build'
 * S: '/var/tmp/portage/sys-devel/gcc-4.5.3-r2/work/build'
Back to top
View user's profile Send private message
loki_val
Retired Dev
Retired Dev


Joined: 13 Nov 2006
Posts: 418
Location: Denmark

PostPosted: Sat Aug 25, 2012 10:41 pm    Post subject: Reply with quote

http://archives.gentoo.org/gentoo-dev/msg_4475b26b1a715a81900c37f91ee04465.xml

This is going deeper and deeper down the rabbit hole. Does the above help?

Your toolchain sure is acting like you're trying to change ABI, but I can only guess at the reason. It may be that someone transposed a letter on Gentoo's end.
Back to top
View user's profile Send private message
zomnut
n00b
n00b


Joined: 25 Aug 2012
Posts: 8

PostPosted: Sun Aug 26, 2012 10:33 am    Post subject: Reply with quote

So I've determined that the mfloat-abi=softfp CFLAG has been in /etc/portage/make.conf since before I last successfully compiled gcc, but that portage strips it out when compiling gcc. That leaves me back at square one.
Back to top
View user's profile Send private message
zomnut
n00b
n00b


Joined: 25 Aug 2012
Posts: 8

PostPosted: Mon Aug 27, 2012 2:42 pm    Post subject: Reply with quote

gcc-4.5.4 has now been marked stable, but still fails me with the same error. Rebuilt glibc and binutils (successfully) to no avail. Everything builds except gcc. /etc/portage/make.conf has not been changed since the system was first installed in January, so the CFLAGS and CHOST have not changed from the stage3 extraction.

Code:
$ cat /etc/portage/make.conf
# These settings were set by the catalyst build script that automatically
# built this stage.
# Please consult /usr/share/portage/config/make.conf.example for a more
# detailed example.
CFLAGS="-O2 -pipe -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=softfp"
CXXFLAGS="${CFLAGS}"
# WARNING: Changing your CHOST is not something that should be done lightly.
# Please consult http://www.gentoo.org/doc/en/change-chost.xml before changing.
CHOST="armv7a-unknown-linux-gnueabi"

$ ls -l /etc/portage/make.conf
-rw-r--r-- 1 root root 470 Jan 19  2012 /etc/portage/make.conf
Back to top
View user's profile Send private message
zomnut
n00b
n00b


Joined: 25 Aug 2012
Posts: 8

PostPosted: Mon Aug 27, 2012 3:05 pm    Post subject: Reply with quote

Full build log https://dl.dropbox.com/u/19641110/build.log

Despite the CFLAG -mfloat-abi=softfp (which is trimmed from the CFLAGS when building gcc) gcc is being configured with --with-float=hard. Is there a way portage can be told to force a configure flag so I can try forcing it to softfp?
Back to top
View user's profile Send private message
zomnut
n00b
n00b


Joined: 25 Aug 2012
Posts: 8

PostPosted: Thu Aug 30, 2012 1:44 pm    Post subject: Reply with quote

As an epitaph to this issue if anyone comes accross this issue, do not do this:
Code:
EXTRA_ECONF="--with-float=softfp" emerge gcc

Gcc compiled completely, and started to install. As soon as libgcc was installed the installation started to fall apart. Bash crashed and could not start due to not being able to find libgcc (it was still looking for it in the 4.5.3 location). I took the disk and mounted it on another box, added some symlinks to allow bash to find the new 4.5.4 libgcc. That allowed me to log back on, but the system was unable to build. Gcc was non-functional due to the incomplete installation (and likely an ABI mismatch), and that renders portage pretty much borked. I just started over with a new stage3 after that.
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