[arm] Fix architecture selection when building libatomic with automatic FPU selection
authorRichard Earnshaw <rearnsha@arm.com>
Fri, 20 Oct 2017 12:33:39 +0000 (12:33 +0000)
committerRichard Earnshaw <rearnsha@gcc.gnu.org>
Fri, 20 Oct 2017 12:33:39 +0000 (12:33 +0000)
Libatomic builds a few functions for Arm with an explicit -march
option.  This option does not specify an FPU, which can lead to
problems when targeting a hard-float or softfp environment since the
architecture appears to be incompatible with the selected ABI.

The fix is simple enough, just add +fp (the minimum floating point
option) to the architecture.  We don't use anything from the FP
architecture, so it shouldn't really change anything; and if we are
building for -mfloat-abi=soft the canonicalization process will remove
the unnecessary fp attributes anyway.

* Makefile.am: (IFUNC_OPTIONS): Set the architecture to
-march=armv7-a+fp on Linux/Arm.
* Makefile.in: Regenerated.

From-SVN: r253935

libatomic/ChangeLog
libatomic/Makefile.am
libatomic/Makefile.in

index 835ea6c5093690963821b0e029cbaa4f1589cd73..eed12e63a6880f50e69417c458d13e10dce87159 100644 (file)
@@ -1,3 +1,9 @@
+2017-10-20  Richard Earnshaw  <rearnsha@arm.com>
+
+       * Makefile.am: (IFUNC_OPTIONS): Set the architecture to
+       -march=armv7-a+fp on Linux/Arm.
+       * Makefile.in: Regenerated.
+
 2017-10-02  Martin Sebor  <msebor@redhat.com>
 
        PR c/81854
index d731406fdbd4b87df7e7dbddd886b008c2b84cf3..9c457008232dc6ead6d7ce1e4174b0101b705a0f 100644 (file)
@@ -123,7 +123,7 @@ libatomic_la_LIBADD = $(foreach s,$(SIZES),$(addsuffix _$(s)_.lo,$(SIZEOBJS)))
 ## On a target-specific basis, include alternates to be selected by IFUNC.
 if HAVE_IFUNC
 if ARCH_ARM_LINUX
-IFUNC_OPTIONS       = -march=armv7-a -DHAVE_KERNEL64
+IFUNC_OPTIONS       = -march=armv7-a+fp -DHAVE_KERNEL64
 libatomic_la_LIBADD += $(foreach s,$(SIZES),$(addsuffix _$(s)_1_.lo,$(SIZEOBJS)))
 libatomic_la_LIBADD += $(addsuffix _8_2_.lo,$(SIZEOBJS))
 endif
index f6eeab312ea2ada447e85c8f563f53f35dcbcc86..0f0382e0713f33eac0525c37717dc4427e9c5bf7 100644 (file)
@@ -346,7 +346,7 @@ M_SRC = $(firstword $(filter %/$(M_FILE), $(all_c_files)))
 libatomic_la_LIBADD = $(foreach s,$(SIZES),$(addsuffix \
        _$(s)_.lo,$(SIZEOBJS))) $(am__append_1) $(am__append_2) \
        $(am__append_3)
-@ARCH_ARM_LINUX_TRUE@@HAVE_IFUNC_TRUE@IFUNC_OPTIONS = -march=armv7-a -DHAVE_KERNEL64
+@ARCH_ARM_LINUX_TRUE@@HAVE_IFUNC_TRUE@IFUNC_OPTIONS = -march=armv7-a+fp -DHAVE_KERNEL64
 @ARCH_I386_TRUE@@HAVE_IFUNC_TRUE@IFUNC_OPTIONS = -march=i586
 @ARCH_X86_64_TRUE@@HAVE_IFUNC_TRUE@IFUNC_OPTIONS = -mcx16
 libatomic_convenience_la_SOURCES = $(libatomic_la_SOURCES)