This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Move -mlong-double-128 away from platform-agnostic files


The compiler flag -mlong-double-128 is platform-specific and shouldn't
be used in platform-agnostic directories, such as ldbl-128ibm and
ldbl-opt.
This was not a problem because all the architectures implying these
directories had to use -mlong-double-128 to set their long double type.
As powerpc64le is changing its default long double type to be binary
compatible with IEEE 128-bit floating point, this will have to change.

Tested on powerpc, powerpc64 and powerpc64le.
Tested with build-many-glibcs.py on alpha and s390x.

2018-05-28  Tulio Magno Quites Machado Filho  <tuliom@linux.ibm.com>

	* sysdeps/ieee754/ldbl-128ibm/Makefile: Move sysdeps-CFLAGS
	definition to...
	* sysdeps/powerpc/powerpc32/Makefile: ... here.
	* sysdeps/powerpc/powerpc64/be/Makefile: ... here.
	* sysdeps/powerpc/powerpc64/le/Makefile: ... and here.
	* sysdeps/ieee754/ldbl-opt/Makefile: Move sysdeps-CFLAGS
	definition to...
	* sysdeps/unix/sysv/linux/alpha/Makefile: ... here.
	* sysdeps/unix/sysv/linux/s390/Makefile: ... here.
	* sysdeps/unix/sysv/linux/sparc/sparc32/Makefile: ... and here.

Signed-off-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
---
 sysdeps/ieee754/ldbl-128ibm/Makefile           | 1 -
 sysdeps/ieee754/ldbl-opt/Makefile              | 3 ---
 sysdeps/powerpc/powerpc32/Makefile             | 2 ++
 sysdeps/powerpc/powerpc64/be/Makefile          | 1 +
 sysdeps/powerpc/powerpc64/le/Makefile          | 2 ++
 sysdeps/unix/sysv/linux/alpha/Makefile         | 4 ++++
 sysdeps/unix/sysv/linux/s390/Makefile          | 4 ++++
 sysdeps/unix/sysv/linux/sparc/sparc32/Makefile | 4 ++++
 8 files changed, 17 insertions(+), 4 deletions(-)
 create mode 100644 sysdeps/powerpc/powerpc64/be/Makefile

diff --git a/sysdeps/ieee754/ldbl-128ibm/Makefile b/sysdeps/ieee754/ldbl-128ibm/Makefile
index bdba6cc6b5..caf118566b 100644
--- a/sysdeps/ieee754/ldbl-128ibm/Makefile
+++ b/sysdeps/ieee754/ldbl-128ibm/Makefile
@@ -2,7 +2,6 @@
 # -mlong-double-128 option is used (or when it becomes a default
 # when -mlong-double-64 is not used).
 long-double-fcts = yes
-sysdep-CFLAGS += -mlong-double-128
 
 ifeq ($(subdir),stdlib)
 tests += tst-strtold-ldbl-128ibm
diff --git a/sysdeps/ieee754/ldbl-opt/Makefile b/sysdeps/ieee754/ldbl-opt/Makefile
index ef790adc77..92828cac0b 100644
--- a/sysdeps/ieee754/ldbl-opt/Makefile
+++ b/sysdeps/ieee754/ldbl-opt/Makefile
@@ -2,9 +2,6 @@
 # -mlong-double-128 option is used (or when it becomes a default
 # when -mlong-double-64 is not used).
 long-double-fcts = yes
-ifeq (,$(filter -mlong-double-128,$(sysdep-CFLAGS)))
-sysdep-CFLAGS += -mlong-double-128
-endif
 
 ifeq ($(subdir),math)
 libm-routines += s_nexttowardfd
diff --git a/sysdeps/powerpc/powerpc32/Makefile b/sysdeps/powerpc/powerpc32/Makefile
index cf620c8269..03c1be3e74 100644
--- a/sysdeps/powerpc/powerpc32/Makefile
+++ b/sysdeps/powerpc/powerpc32/Makefile
@@ -47,3 +47,5 @@ ifeq ($(subdir),elf)
 # extra shared linker files to link only into dl-allobjs.so
 sysdep-rtld-routines += dl-start
 endif
+
+sysdep-CFLAGS += -mlong-double-128
diff --git a/sysdeps/powerpc/powerpc64/be/Makefile b/sysdeps/powerpc/powerpc64/be/Makefile
new file mode 100644
index 0000000000..0ecff70b8d
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/be/Makefile
@@ -0,0 +1 @@
+sysdep-CFLAGS += -mlong-double-128
diff --git a/sysdeps/powerpc/powerpc64/le/Makefile b/sysdeps/powerpc/powerpc64/le/Makefile
index 14d39e28b1..1be614008d 100644
--- a/sysdeps/powerpc/powerpc64/le/Makefile
+++ b/sysdeps/powerpc/powerpc64/le/Makefile
@@ -79,3 +79,5 @@ CFLAGS-printf_fp.c = -mfloat128
 CFLAGS-printf_fphex.c = -mfloat128
 CFLAGS-printf_size.c = -mfloat128
 endif
+
+sysdep-CFLAGS += -mlong-double-128
diff --git a/sysdeps/unix/sysv/linux/alpha/Makefile b/sysdeps/unix/sysv/linux/alpha/Makefile
index 50f4fb1183..dd346002aa 100644
--- a/sysdeps/unix/sysv/linux/alpha/Makefile
+++ b/sysdeps/unix/sysv/linux/alpha/Makefile
@@ -1,3 +1,7 @@
+ifeq (,$(filter -mlong-double-128,$(sysdep-CFLAGS)))
+sysdep-CFLAGS += -mlong-double-128
+endif
+
 ifeq ($(subdir),stdlib)
 gen-as-const-headers += ucontext-offsets.sym
 endif
diff --git a/sysdeps/unix/sysv/linux/s390/Makefile b/sysdeps/unix/sysv/linux/s390/Makefile
index 77f38523b5..20ce8450e3 100644
--- a/sysdeps/unix/sysv/linux/s390/Makefile
+++ b/sysdeps/unix/sysv/linux/s390/Makefile
@@ -2,6 +2,10 @@ abi-variants := 32 64
 abi-32-condition := __WORDSIZE == 32
 abi-64-condition := __WORDSIZE == 64
 
+ifeq (,$(filter -mlong-double-128,$(sysdep-CFLAGS)))
+sysdep-CFLAGS += -mlong-double-128
+endif
+
 ifeq ($(subdir),rt)
 librt-routines += rt-sysdep
 librt-shared-only-routines += rt-sysdep
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/Makefile b/sysdeps/unix/sysv/linux/sparc/sparc32/Makefile
index 21c7dc1680..0dba32b698 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/Makefile
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/Makefile
@@ -5,6 +5,10 @@ asm-CPPFLAGS = -D__ASSEMBLY__
 ASFLAGS-.os += -fPIC
 LD += -melf32_sparc
 
+ifeq (,$(filter -mlong-double-128,$(sysdep-CFLAGS)))
+sysdep-CFLAGS += -mlong-double-128
+endif
+
 ifeq ($(subdir),stdlib)
 gen-as-const-headers += ucontext_i.sym
 endif
-- 
2.14.3


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]