diff --git a/make/bsd/makefiles/amd64.make b/make/bsd/makefiles/amd64.make index ecdac17ee3ab571b3064ddf1592fef88c8000217..6ff63ec299998299f8adb0aa1e3893b2a402bde4 100644 --- a/make/bsd/makefiles/amd64.make +++ b/make/bsd/makefiles/amd64.make @@ -22,11 +22,16 @@ # # -# The copied fdlibm routines in sharedRuntimeTrig.o must not be optimized -OPT_CFLAGS/sharedRuntimeTrig.o = $(OPT_CFLAGS/NOOPT) -# The copied fdlibm routines in sharedRuntimeTrans.o must not be optimized -OPT_CFLAGS/sharedRuntimeTrans.o = $(OPT_CFLAGS/NOOPT) -# Must also specify if CPU is little endian +# If FDLIBM_CFLAGS is non-empty it holds CFLAGS needed to be passed to +# the compiler so as to be able to produce optimized objects +# without losing precision. +ifneq ($(FDLIBM_CFLAGS),) + OPT_CFLAGS/sharedRuntimeTrig.o = $(OPT_CFLAGS/SPEED) $(FDLIBM_CFLAGS) + OPT_CFLAGS/sharedRuntimeTrans.o = $(OPT_CFLAGS/SPEED) $(FDLIBM_CFLAGS) +else + OPT_CFLAGS/sharedRuntimeTrig.o = $(OPT_CFLAGS/NOOPT) + OPT_CFLAGS/sharedRuntimeTrans.o = $(OPT_CFLAGS/NOOPT) +endif CFLAGS += -DVM_LITTLE_ENDIAN CFLAGS += -D_LP64=1 diff --git a/make/bsd/makefiles/i486.make b/make/bsd/makefiles/i486.make index 86e825d3e9db62c2bc0f708044fd427091a6a892..eac85d233497da2e15525891d5572c8af34819b3 100644 --- a/make/bsd/makefiles/i486.make +++ b/make/bsd/makefiles/i486.make @@ -24,10 +24,16 @@ # TLS helper, assembled from .s file -# The copied fdlibm routines in sharedRuntimeTrig.o must not be optimized -OPT_CFLAGS/sharedRuntimeTrig.o = $(OPT_CFLAGS/NOOPT) -# The copied fdlibm routines in sharedRuntimeTrans.o must not be optimized -OPT_CFLAGS/sharedRuntimeTrans.o = $(OPT_CFLAGS/NOOPT) +# If FDLIBM_CFLAGS is non-empty it holds CFLAGS needed to be passed to +# the compiler so as to be able to produce optimized objects +# without losing precision. +ifneq ($(FDLIBM_CFLAGS),) + OPT_CFLAGS/sharedRuntimeTrig.o = $(OPT_CFLAGS/SPEED) $(FDLIBM_CFLAGS) + OPT_CFLAGS/sharedRuntimeTrans.o = $(OPT_CFLAGS/SPEED) $(FDLIBM_CFLAGS) +else + OPT_CFLAGS/sharedRuntimeTrig.o = $(OPT_CFLAGS/NOOPT) + OPT_CFLAGS/sharedRuntimeTrans.o = $(OPT_CFLAGS/NOOPT) +endif # Must also specify if CPU is little endian CFLAGS += -DVM_LITTLE_ENDIAN diff --git a/make/bsd/makefiles/ppc.make b/make/bsd/makefiles/ppc.make index 92957f963f93fa742097a565787ebd74e8f19647..4c361df11893174602f1b812d0090d8a9c152e3e 100644 --- a/make/bsd/makefiles/ppc.make +++ b/make/bsd/makefiles/ppc.make @@ -22,8 +22,16 @@ # # -# The copied fdlibm routines in sharedRuntimeTrig.o must not be optimized -OPT_CFLAGS/sharedRuntimeTrig.o = $(OPT_CFLAGS/NOOPT) +# If FDLIBM_CFLAGS is non-empty it holds CFLAGS needed to be passed to +# the compiler so as to be able to produce optimized objects +# without losing precision. +ifneq ($(FDLIBM_CFLAGS),) + OPT_CFLAGS/sharedRuntimeTrig.o = $(OPT_CFLAGS/SPEED) $(FDLIBM_CFLAGS) + OPT_CFLAGS/sharedRuntimeTrans.o = $(OPT_CFLAGS/SPEED) $(FDLIBM_CFLAGS) +else + OPT_CFLAGS/sharedRuntimeTrig.o = $(OPT_CFLAGS/NOOPT) + OPT_CFLAGS/sharedRuntimeTrans.o = $(OPT_CFLAGS/NOOPT) +endif # Must also specify if CPU is big endian CFLAGS += -DVM_BIG_ENDIAN diff --git a/make/bsd/makefiles/zeroshark.make b/make/bsd/makefiles/zeroshark.make index 12c41981904a921a942502ab2075c1ab2b851b6c..e7335694b31041a133056cdecacbced419e07c20 100644 --- a/make/bsd/makefiles/zeroshark.make +++ b/make/bsd/makefiles/zeroshark.make @@ -25,10 +25,16 @@ # Setup common to Zero (non-Shark) and Shark versions of VM -# The copied fdlibm routines in sharedRuntimeTrig.o must not be optimized -OPT_CFLAGS/sharedRuntimeTrig.o = $(OPT_CFLAGS/NOOPT) -# The copied fdlibm routines in sharedRuntimeTrans.o must not be optimized -OPT_CFLAGS/sharedRuntimeTrans.o = $(OPT_CFLAGS/NOOPT) +# If FDLIBM_CFLAGS is non-empty it holds CFLAGS needed to be passed to +# the compiler so as to be able to produce optimized objects +# without losing precision. +ifneq ($(FDLIBM_CFLAGS),) + OPT_CFLAGS/sharedRuntimeTrig.o = $(OPT_CFLAGS/SPEED) $(FDLIBM_CFLAGS) + OPT_CFLAGS/sharedRuntimeTrans.o = $(OPT_CFLAGS/SPEED) $(FDLIBM_CFLAGS) +else + OPT_CFLAGS/sharedRuntimeTrig.o = $(OPT_CFLAGS/NOOPT) + OPT_CFLAGS/sharedRuntimeTrans.o = $(OPT_CFLAGS/NOOPT) +endif # Specify that the CPU is little endian, if necessary ifeq ($(ZERO_ENDIANNESS), little) diff --git a/make/linux/makefiles/amd64.make b/make/linux/makefiles/amd64.make index 2b77dbab605e8be4a1d0b1c5deb258cdbcb69df8..28761af9f45c16d499e8f4a2538175f1c9eae2c2 100644 --- a/make/linux/makefiles/amd64.make +++ b/make/linux/makefiles/amd64.make @@ -22,10 +22,16 @@ # # -# The copied fdlibm routines in sharedRuntimeTrig.o must not be optimized -OPT_CFLAGS/sharedRuntimeTrig.o = $(OPT_CFLAGS/NOOPT) -# The copied fdlibm routines in sharedRuntimeTrans.o must not be optimized -OPT_CFLAGS/sharedRuntimeTrans.o = $(OPT_CFLAGS/NOOPT) +# If FDLIBM_CFLAGS is non-empty it holds CFLAGS needed to be passed to +# the compiler so as to be able to produce optimized objects +# without losing precision. +ifneq ($(FDLIBM_CFLAGS),) + OPT_CFLAGS/sharedRuntimeTrig.o = $(OPT_CFLAGS/SPEED) $(FDLIBM_CFLAGS) + OPT_CFLAGS/sharedRuntimeTrans.o = $(OPT_CFLAGS/SPEED) $(FDLIBM_CFLAGS) +else + OPT_CFLAGS/sharedRuntimeTrig.o = $(OPT_CFLAGS/NOOPT) + OPT_CFLAGS/sharedRuntimeTrans.o = $(OPT_CFLAGS/NOOPT) +endif # Must also specify if CPU is little endian CFLAGS += -DVM_LITTLE_ENDIAN diff --git a/make/linux/makefiles/i486.make b/make/linux/makefiles/i486.make index 86e825d3e9db62c2bc0f708044fd427091a6a892..eac85d233497da2e15525891d5572c8af34819b3 100644 --- a/make/linux/makefiles/i486.make +++ b/make/linux/makefiles/i486.make @@ -24,10 +24,16 @@ # TLS helper, assembled from .s file -# The copied fdlibm routines in sharedRuntimeTrig.o must not be optimized -OPT_CFLAGS/sharedRuntimeTrig.o = $(OPT_CFLAGS/NOOPT) -# The copied fdlibm routines in sharedRuntimeTrans.o must not be optimized -OPT_CFLAGS/sharedRuntimeTrans.o = $(OPT_CFLAGS/NOOPT) +# If FDLIBM_CFLAGS is non-empty it holds CFLAGS needed to be passed to +# the compiler so as to be able to produce optimized objects +# without losing precision. +ifneq ($(FDLIBM_CFLAGS),) + OPT_CFLAGS/sharedRuntimeTrig.o = $(OPT_CFLAGS/SPEED) $(FDLIBM_CFLAGS) + OPT_CFLAGS/sharedRuntimeTrans.o = $(OPT_CFLAGS/SPEED) $(FDLIBM_CFLAGS) +else + OPT_CFLAGS/sharedRuntimeTrig.o = $(OPT_CFLAGS/NOOPT) + OPT_CFLAGS/sharedRuntimeTrans.o = $(OPT_CFLAGS/NOOPT) +endif # Must also specify if CPU is little endian CFLAGS += -DVM_LITTLE_ENDIAN diff --git a/make/linux/makefiles/ppc64.make b/make/linux/makefiles/ppc64.make index f3392de49a63fedbf28f567725798fa810b88e4b..6c09312239f4c384acd0ba76afaba798fee085e7 100644 --- a/make/linux/makefiles/ppc64.make +++ b/make/linux/makefiles/ppc64.make @@ -49,3 +49,14 @@ else # Use Power8, this is the first CPU to support PPC64 LE with ELFv2 ABI. CFLAGS += -mcpu=power7 -mtune=power8 -minsert-sched-nops=regroup_exact -mno-multiple -mno-string endif + +# If FDLIBM_CFLAGS is non-empty it holds CFLAGS needed to be passed to +# the compiler so as to be able to produce optimized objects +# without losing precision. +ifneq ($(FDLIBM_CFLAGS),) + OPT_CFLAGS/sharedRuntimeTrig.o = $(OPT_CFLAGS/SPEED) $(FDLIBM_CFLAGS) + OPT_CFLAGS/sharedRuntimeTrans.o = $(OPT_CFLAGS/SPEED) $(FDLIBM_CFLAGS) +else + OPT_CFLAGS/sharedRuntimeTrig.o = $(OPT_CFLAGS/NOOPT) + OPT_CFLAGS/sharedRuntimeTrans.o = $(OPT_CFLAGS/NOOPT) +endif diff --git a/make/linux/makefiles/zeroshark.make b/make/linux/makefiles/zeroshark.make index 3c10770d42a07c27e0d79a534fe2878cd7b3be53..4480740e0393f88e7b1940c1c8bfc035615a17a3 100644 --- a/make/linux/makefiles/zeroshark.make +++ b/make/linux/makefiles/zeroshark.make @@ -28,10 +28,16 @@ # override this from the main file because some version of llvm do not like -Wundef WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wunused-function -Wunused-value -# The copied fdlibm routines in sharedRuntimeTrig.o must not be optimized -OPT_CFLAGS/sharedRuntimeTrig.o = $(OPT_CFLAGS/NOOPT) -# The copied fdlibm routines in sharedRuntimeTrans.o must not be optimized -OPT_CFLAGS/sharedRuntimeTrans.o = $(OPT_CFLAGS/NOOPT) +# If FDLIBM_CFLAGS is non-empty it holds CFLAGS needed to be passed to +# the compiler so as to be able to produce optimized objects +# without losing precision. +ifneq ($(FDLIBM_CFLAGS),) + OPT_CFLAGS/sharedRuntimeTrig.o = $(OPT_CFLAGS/SPEED) $(FDLIBM_CFLAGS) + OPT_CFLAGS/sharedRuntimeTrans.o = $(OPT_CFLAGS/SPEED) $(FDLIBM_CFLAGS) +else + OPT_CFLAGS/sharedRuntimeTrig.o = $(OPT_CFLAGS/NOOPT) + OPT_CFLAGS/sharedRuntimeTrans.o = $(OPT_CFLAGS/NOOPT) +endif # Specify that the CPU is little endian, if necessary ifeq ($(ZERO_ENDIANNESS), little)