Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 273768 - GCC 4.2.3-r4 softfloat patch incorrectly forces FPA format
Summary: GCC 4.2.3-r4 softfloat patch incorrectly forces FPA format
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: ARM Linux
: High normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-06-11 19:24 UTC by Thomas Beaman
Modified: 2009-06-22 13:30 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Beaman 2009-06-11 19:24:56 UTC
sys-devel/gcc-4.2.3-r4 softfloat patch incorrectly forces FPA format.  Xgcc compiles softfloat in FPA format (-mfpu=[soft]fpa or something) when BOOT_FLAGS, CFLAGS, and STAGE1_FLAGS set -mfpu=fpe3.  Although I don't immediately follow the patch syntax I believe it forces softfloat into FPA mode.

My arm system was cross-compiled for arm-linux-softfloat-gnu (-mfloat-abi=soft) which seems to tell gcc-4.1.2 to compile in soft VFP format (I'm guessing from objdump -p) which is really FPE2/3 since floats don't work with -mfloat-abi=soft -mfpu=vfp.

So in conclusion:
1)  Xgcc shouldn't be told to force one format?  I'm thinking this should be an option or I missed the option.
2)  If FPA is the new standard format, crossdev GCC 4.1.2 should create soft FPA toolchains by default.


(Build log in results)

Please let me know if you need more build log (I'm not able to send the whole thing at the moment.)

Reproducible: Always

Steps to Reproduce:
1. Use crossdev to build an arm softfloat chain
2. Crosscompile system packages to arm softfloat chain
3. Chroot into arm gentoo softfloat root
4. EXTRA_CONF="-mfloat-abi=soft -mfpu=fpe3 -pipe" STAGE1_CFLAGS="-mfloat-abi=soft -mfpu=fpe3 -pipe" BOOT_CFLAGS="-mfloat-abi=soft -mfpu=fpe3 -pipe" emerge -1 gcc
(This is clearly wrong... I will give an update with the following #4 but I think the patch is still at fault.)
4.  EXTRA_ECONF="--with-float=soft --with-fpu=fpe3" STAGE1_CFLAGS="-mfloat-abi=soft -mfpu=fpe3 -pipe" BOOT_CFLAGS="-mfloat-abi=soft -mfpu=fpe3 -pipe" emerge -1 gcc
Actual Results:  
Compilation fails:
/var/tmp/portage/sys-devel/gcc-4.3.2-r4/work/build/./gcc/xgcc -B/var/tmp/portage/sys-devel/gcc-4.3.2-r4/work/build/./gcc/ -B/usr/arm-softfloat-linux-gnu/bin/ -B/usr/arm-softfloat-linux-gnu/lib/ -isystem /usr/arm-softfloat-linux-gnu/include -isystem /usr/arm-softfloat-linux-gnu/sys-include -O2  -O2 -g -pipe -march=armv5te -mtune=arm926ej-s -mfpu=fpe3 -O2   -DIN_GCC    -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include  -fomit-frame-pointer -fPIC -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -fno-stack-protector  -shared -nodefaultlibs -Wl,--soname=libgcc_s.so.1 -Wl,--version-script=libgcc.map -o ./libgcc_s.so.1.tmp -mfloat-abi=soft -mfpu=fpe3 -pipe -B./ _udivsi3_s.o _divsi3_s.o _umodsi3_s.o _modsi3_s.o _dvmd_lnx_s.o _muldi3_s.o _negdi2_s.o _lshrdi3_s.o _ashldi3_s.o _ashrdi3_s.o _cmpdi2_s.o _ucmpdi2_s.o _clear_cache_s.o _enable_execute_stack_s.o _trampoline_s.o __main_s.o _absvsi2_s.o _absvdi2_s.o _addvsi3_s.o _addvdi3_s.o _subvsi3_s.o _subvdi3_s.o _mulvsi3_s.o _mulvdi3_s.o _negvsi2_s.o _negvdi2_s.o _ctors_s.o _ffssi2_s.o _ffsdi2_s.o _clz_s.o _clzsi2_s.o _clzdi2_s.o _ctzsi2_s.o _ctzdi2_s.o _popcount_tab_s.o _popcountsi2_s.o _popcountdi2_s.o _paritysi2_s.o _paritydi2_s.o _powisf2_s.o _powidf2_s.o _powixf2_s.o _powitf2_s.o _mulsc3_s.o _muldc3_s.o _mulxc3_s.o _multc3_s.o _divsc3_s.o _divdc3_s.o _divxc3_s.o _divtc3_s.o _bswapsi2_s.o _bswapdi2_s.o _fixunssfsi_s.o _fixunsdfsi_s.o _fixunsxfsi_s.o _fixsfdi_s.o _fixdfdi_s.o _fixxfdi_s.o _fixtfdi_s.o _fixunssfdi_s.o _fixunsdfdi_s.o _fixunsxfdi_s.o _fixunstfdi_s.o _floatdisf_s.o _floatdidf_s.o _floatdixf_s.o _floatditf_s.o _floatundisf_s.o _floatundidf_s.o _floatundixf_s.o _floatunditf_s.o _divdi3_s.o _moddi3_s.o _udivdi3_s.o _umoddi3_s.o _udiv_w_sdiv_s.o _udivmoddi4_s.o unwind-dw2_s.o unwind-dw2-fde-glibc_s.o unwind-sjlj_s.o gthr-gnat_s.o unwind-c_s.o emutls_s.o -lc && rm -f ./libgcc_s.so && if [ -f ./libgcc_s.so.1 ]; then mv -f ./libgcc_s.so.1 ./libgcc_s.so.1.backup; else true; fi && mv ./libgcc_s.so.1.tmp ./libgcc_s.so.1 && ln -s libgcc_s.so.1 ./libgcc_s.so
/usr/arm-softfloat-linux-gnu/bin/ranlib libgcc.a
/usr/arm-softfloat-linux-gnu/bin/ld: ERROR: /var/tmp/portage/sys-devel/gcc-4.3.2-r4/work/build/./gcc/crtbeginS.o uses FPA instructions, whereas ./libgcc_s.so.1.tmp does not
/usr/arm-softfloat-linux-gnu/bin/ld: failed to merge target specific data of file /var/tmp/portage/sys-devel/gcc-4.3.2-r4/work/build/./gcc/crtbeginS.o
/usr/arm-softfloat-linux-gnu/bin/ld: ERROR: _udivsi3_s.o uses FPA instructions, whereas ./libgcc_s.so.1.tmp does not
/usr/arm-softfloat-linux-gnu/bin/ld: failed to merge target specific data of file _udivsi3_s.o
/usr/arm-softfloat-linux-gnu/bin/ld: ERROR: _divsi3_s.o uses FPA instructions, whereas ./libgcc_s.so.1.tmp does not
/usr/arm-softfloat-linux-gnu/bin/ld: failed to merge target specific data of file _divsi3_s.o
/usr/arm-softfloat-linux-gnu/bin/ld: ERROR: _umodsi3_s.o uses FPA instructions, whereas ./libgcc_s.so.1.tmp does not
/usr/arm-softfloat-linux-gnu/bin/ld: failed to merge target specific data of file _umodsi3_s.o

Expected Results:  
Compiles cleanly.

Emerge Info:
# emerge --info
Portage 2.1.6.13 (default/linux/arm/2008.0, gcc-4.1.2, glibc-2.8_p20080602-r1, 2.6.12.6-arm1 armv5tejl)
=================================================================
System uname: Linux-2.6.12.6-arm1-armv5tejl-with-glibc2.0
Timestamp of tree: Tue, 09 Jun 2009 05:00:01 +0000
distcc 3.1 arm-softfloat-linux-gnu [enabled]
ccache version 2.4 [disabled]
app-shells/bash:     3.2_p39
dev-lang/python:     2.5.4-r2
dev-util/ccache:     2.4-r7
sys-apps/baselayout: 1.12.11.1
sys-apps/sandbox:    1.6-r2
sys-devel/autoconf:  2.63
sys-devel/automake:  1.10.2
sys-devel/binutils:  2.18-r3
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.27-r2
ACCEPT_KEYWORDS="arm"
CBUILD="arm-softfloat-linux-gnu"
CFLAGS="-pipe -O3 -march=armv5te -mtune=arm926ej-s -mfloat-abi=soft -mfpu=fpe3"
CHOST="arm-softfloat-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-pipe -O3 -march=armv5te -mtune=arm926ej-s -mfloat-abi=soft -mfpu=fpe3"
DISTDIR="/usr/portage/distfiles"
FEATURES="distcc distlocks fixpackages parallel-fetch protect-owned sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LDFLAGS="-Wl,-O1"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="acl arm berkdb bzip2 cli crypt cups fortran gdbm gpm isdnlog midi mudflap ncurses nptl nptlonly openmp pam pcre perl pppd python readline reflection session spl ssl sysfs tcpd unicode xorg 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 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" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="fbdev glint mach64 mga nv r128 radeon savage sis tdfx trident        vga voodoo"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY
Comment 1 SpanKY gentoo-dev 2009-06-22 13:30:40 UTC
your tuple is wrong.  it is arm-softfloat-linux-gnu.  the embedded documentation already explains this.

also, we dont particularly care about gcc-4.2.x.  make sure the problem still exists in gcc-4.4.x.