]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
ldbl-128ibm-compat: Do not mix -mabi=*longdouble and -mlong-double-128
authorGabriel F. T. Gomes <gabrielftg@linux.ibm.com>
Tue, 10 Sep 2019 13:05:03 +0000 (08:05 -0500)
committerGabriel F. T. Gomes <gabrielftg@linux.ibm.com>
Fri, 13 Dec 2019 22:06:02 +0000 (19:06 -0300)
No changes since v3.

No changes since v2.

Changes since v1:

  - Do not try to remove -mabi=ieeelongdouble, since it hasn't been
    added.  The removal is a residue from our initial development.

-- 8< --
Some compiler versions, e.g. GCC 7, complain when -mlong-double-128 is
used together with -mabi=ibmlongdouble or -mabi=ieeelongdouble,
producing the following error message:

  cc1: error: ‘-mabi=ibmlongdouble’ requires ‘-mlong-double-128’

This patch removes -mlong-double-128 from the compilation lines that
explicitly request -mabi=*longdouble.

Tested for powerpc64le.

sysdeps/ieee754/ldbl-128ibm-compat/Makefile

index 8f6a09091a121c21cc5ec5f86ab8cc60d1c07b8b..7efbd00089dfa23d42dab771c57fcb53dcef60f7 100644 (file)
@@ -258,6 +258,13 @@ ldbl-extra-routines += err \
 CFLAGS-ieee128-qefgcvt.c += -mabi=ieeelongdouble -Wno-psabi -mno-gnu-attribute
 CFLAGS-ieee128-qefgcvt_r.c += -mabi=ieeelongdouble -Wno-psabi -mno-gnu-attribute
 
+# Remove -mlong-double-128 because it does not work correctly with
+# -mabi=ibmlongdoule in some GCC versions, e.g. GCC 7.
+$(foreach o,$(all-object-suffixes),$(objpfx)ieee128-qefgcvt$(o)): \
+  sysdep-CFLAGS := $(filter-out -mlong-double-128, $(sysdep-CFLAGS))
+$(foreach o,$(all-object-suffixes),$(objpfx)ieee128-qefgcvt_r$(o)): \
+  sysdep-CFLAGS := $(filter-out -mlong-double-128, $(sysdep-CFLAGS))
+
 tests-internal += tst-ibm128-warn tst-ieee128-warn
 tests-internal += tst-ibm128-error tst-ieee128-error
 tests-internal += tst-ibm128-efgcvt tst-ieee128-efgcvt
@@ -334,5 +341,12 @@ ldbl-ibm128-files := $(objpfx)test-%-ibm128^ \
                     $(foreach r,$(ldbl-extra-routines),$(objpfx)$(r)^) \
                     $(foreach r,$(ldbl-extra-routines),$(objpfx)$(r)-internal^)
 obj-suf-foreach = $(foreach suf,$(all-object-suffixes),$(subst ^,$(suf),$(1)))
+
+# Remove -mlong-double-128 because it does not work correctly with
+# -mabi=ibmlongdoule in some GCC versions, e.g. GCC 7.
+$(call obj-suf-foreach,$(ldbl-ibm128-files)): \
+  sysdep-CFLAGS := $(filter-out -mlong-double-128, $(sysdep-CFLAGS))
+
+# Explicitly add -mabi=ibm-long-double to required files.
 $(call obj-suf-foreach,$(ldbl-ibm128-files)): \
   sysdep-CFLAGS += -mabi=ibmlongdouble