Patchwork do_compile of gcc-cross-sdk-4.5 fails with -mfloat-abi=hard

login
register
mail settings
Submitter Khem Raj
Date March 29, 2011, 10:39 p.m.
Message ID <20110329223949.GA6899@sakrah.homelinux.org>
Download mbox | patch
Permalink /patch/1861/
State New, archived
Headers show

Comments

Khem Raj - March 29, 2011, 10:39 p.m.
On (29/03/11 23:54), Julian Pietron wrote:
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Hey,
> 
> some more information for you in the hope that it will help you to
> find the cause for these problems. I attached the Makefile from the
> gcc-cross-4.5 build, libgcc-subdirectory, and the Makefile from the
> gcc-cross-sdk-4.5, libgcc subdirectory. As you can see in line 67
> where CC is set, the former Makefile includes the correct
> TARGET_CC_ARCH (-mtune=armv7-a etc.), while the latter doesn't contain
> this and especially doesn't contain the -mfloat-abi=hard which would
> be required to perform the correct hard float compilation. I guess
> there is something missing in the call to ./configure for the
> gcc-cross-sdk-build, perhaps you could point me to the directive that
> has to be added to have the correct CFLAGS for building libgcc.

OK here is untested patch. Please apply it on top of current OE and
rebuild from scratch to make sure it builds new toolchain correctly.

and let me know if it helps

-Khem
Julian Pietron - March 29, 2011, 11:15 p.m.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hallo,

please see the patch in reply to your other response and tell me
whether the fix is correct. For me it works at least, as I have a
working toolchain now and bitbake meta-toolchain completed successfully.

Best Regards,
Julian
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.16 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJNkmgUAAoJENidYKvYQHlQjgEP/iNU3Bwi0L80TWzdg+JnaqGN
DAAxRY3Q1FQiohtYdTA+28fq6PquJ57+RtUri4wsqval9tUDu5CX9Pj1+tj4btYk
77rulmkmbIbWpYNlaMsMPKr1Ag46YIHmXHwwJVikpLBd+wNWMFvlPliiv69KT7Q9
TH/LgfVNmRMchAVoqPoEQ8WZu4Sqqaf7ZrQJdN+nCcVW5muytFD0ATHoNyffn0pU
r07VS0vimlNQQzXmBEZalBaRlcJGd2CxSrFioPgmr0O3V/zR3sLRorru+sDVM6vc
dFuBnHTQdIKgWwOCFnSQrR1Z/4OGqmXXH+8kT64Wu+GtWFXG7LP0if7luZj1Lzvj
4WPmLPYMlsWX8NNMi+/eYU1QP4lEBaybE5r2kt9dGOrFyqwiuWdIzT3iwUAIcaln
BhhdZ7IBuIJ/Caw+/A0GgQTb1D1i3tBXhx8QcgKgzNouu+SaRbJ0ZkG4kgByjcEt
Hoswy0cNJqW9dzbcpdjxoMi0Chy39Akdn73n8ycUzuQxxhcyuFeS+Q9QYj+hsjEc
6C+9zrXHt1+PvbpppEwDQPJrRJdZ7yLPj8Mt0auaRB3oBzgkxUqUQuCLDkcx4JcJ
3VIoDDxoaHIltGROfgpQxN6IuFg9BFxD2mTwA4zcgr+8lhzyTvs7xrS68VJ9QIN1
4OWlLlgJkoWFOfP5+Rwb
=EiSW
-----END PGP SIGNATURE-----

Patch

diff --git a/conf/machine/include/tune-cortexa8.inc b/conf/machine/include/tune-cortexa8.inc
index 2ac0ebf..e07bf16 100644
--- a/conf/machine/include/tune-cortexa8.inc
+++ b/conf/machine/include/tune-cortexa8.inc
@@ -4,9 +4,9 @@ 
 # [3] https://support.codesourcery.com/GNUToolchain/kbentry29
 
 # Can be 'softfp' or 'hardfp'
-ARM_FP_MODE ?= "softfp"
+ARM_FP_ABI ?= "softfp"
 
-ARM_FP_OPT = "${@['-mfloat-abi=softfp', '-mfloat-abi=hard'][bb.data.getVar('ARM_FP_MODE', d, 1) == 'hardfp']}"
+ARM_FP_OPT = "${@['-mfloat-abi=softfp', '-mfloat-abi=hard'][bb.data.getVar('ARM_FP_ABI', d, 1) == 'hardfp']}"
 ARM_FP_PACKAGESUFFIX = "${@['', '-hardfp'][bb.data.getVar('ARM_FP_MODE', d, 1) == 'hardfp']}"
 
 TARGET_CC_ARCH = "-march=armv7-a -mtune=cortex-a8 -mfpu=neon ${ARM_FP_OPT}"
diff --git a/recipes/gcc/gcc-common.inc b/recipes/gcc/gcc-common.inc
index 9fd433b..d32b2ba 100644
--- a/recipes/gcc/gcc-common.inc
+++ b/recipes/gcc/gcc-common.inc
@@ -15,8 +15,16 @@  COMPATIBLE_TARGET_SYS ?= "(?!nios2)"
 # for building for the new host part.  So only obey TARGET_FPU for the
 # real target.
 def get_gcc_fpu_setting(bb, d):
-    if bb.data.getVar('TARGET_FPU', d, 1) in [ 'soft' ] and bb.data.getVar('TARGET_OS', d, 1).find('linux') >= 0 :
-        return "--with-float=soft"
+    if bb.data.getVar('TARGET_FPU', d, True) in [ 'soft', 'hard'] and bb.data.getVar('TARGET_OS', d, True).find('linux') >= 0 :
+        # ARM_FP_ABI could be either 'hardfp' or 'softfp'
+        arm_fpabi = bb.data.getVar('ARM_FP_ABI', d, True) or ""
+        if arm_fpabi != "":
+	    if arm_fpabi  == "hardfp":
+	        # reset it to whatever gcc --with-float configure expects which is either 'softfp' or 'hard'
+	        arm_fpabi = "hard"
+            return "--with-float=" + arm_fpabi
+	else:
+	    return "--with-float=" + bb.data.getVar('TARGET_FPU', d, True)
     return ""
 
 def get_gcc_mips_plt_setting(bb, d):