From c2c91e09b4893cb81314774557f728a95080f81e Mon Sep 17 00:00:00 2001 From: Jeff Hammond Date: Tue, 25 Oct 2016 21:15:26 -0700 Subject: [PATCH] never use libm with Intel compilers Intel compilers include a highly optimized math library (libimf) that should be used instead of GNU libm. yes, this change is for ALL targets, including those that are not supported by the Intel compiler. there is no harm in doing this, and it is future-proof in the event that the Intel compilers support other architectures. --- config/armv7a/make_defs.mk | 2 ++ config/armv8a/make_defs.mk | 2 ++ config/bulldozer/make_defs.mk | 2 ++ config/carrizo/make_defs.mk | 2 ++ config/cortex-a15/make_defs.mk | 2 ++ config/cortex-a9/make_defs.mk | 2 ++ config/dunnington/make_defs.mk | 2 ++ config/haswell/make_defs.mk | 2 ++ config/knl/make_defs.mk | 6 +++++- config/loongson3a/make_defs.mk | 2 ++ config/mic/make_defs.mk | 4 ++++ config/piledriver/make_defs.mk | 2 ++ config/pnacl/make_defs.mk | 2 ++ config/power7/make_defs.mk | 2 ++ config/reference/make_defs.mk | 2 ++ config/sandybridge/make_defs.mk | 2 ++ config/template/make_defs.mk | 2 ++ 17 files changed, 39 insertions(+), 1 deletion(-) diff --git a/config/armv7a/make_defs.mk b/config/armv7a/make_defs.mk index 40b6c179a..2b4125f3a 100644 --- a/config/armv7a/make_defs.mk +++ b/config/armv7a/make_defs.mk @@ -77,7 +77,9 @@ ARFLAGS := cru # --- Determine the linker and related flags --- LINKER := $(CC) SOFLAGS := -shared +ifneq ($(CC_VENDOR),icc) LDFLAGS := -lm +endif diff --git a/config/armv8a/make_defs.mk b/config/armv8a/make_defs.mk index 654a9ff92..3dc88e913 100644 --- a/config/armv8a/make_defs.mk +++ b/config/armv8a/make_defs.mk @@ -77,7 +77,9 @@ ARFLAGS := cru # --- Determine the linker and related flags --- LINKER := $(CC) SOFLAGS := -shared +ifneq ($(CC_VENDOR),icc) LDFLAGS := -lm +endif diff --git a/config/bulldozer/make_defs.mk b/config/bulldozer/make_defs.mk index 78f47d908..90d14d56b 100644 --- a/config/bulldozer/make_defs.mk +++ b/config/bulldozer/make_defs.mk @@ -77,7 +77,9 @@ ARFLAGS := cru # --- Determine the linker and related flags --- LINKER := $(CC) SOFLAGS := -shared +ifneq ($(CC_VENDOR),icc) LDFLAGS := -lm +endif diff --git a/config/carrizo/make_defs.mk b/config/carrizo/make_defs.mk index aaecb2d2c..fd6b84cb0 100644 --- a/config/carrizo/make_defs.mk +++ b/config/carrizo/make_defs.mk @@ -77,7 +77,9 @@ ARFLAGS := cru # --- Determine the linker and related flags --- LINKER := $(CC) SOFLAGS := -shared +ifneq ($(CC_VENDOR),icc) LDFLAGS := -lm +endif diff --git a/config/cortex-a15/make_defs.mk b/config/cortex-a15/make_defs.mk index ec5360da4..52ab7a7c9 100644 --- a/config/cortex-a15/make_defs.mk +++ b/config/cortex-a15/make_defs.mk @@ -77,7 +77,9 @@ ARFLAGS := cru # --- Determine the linker and related flags --- LINKER := $(CC) SOFLAGS := -shared +ifneq ($(CC_VENDOR),icc) LDFLAGS := -lm +endif diff --git a/config/cortex-a9/make_defs.mk b/config/cortex-a9/make_defs.mk index ec5360da4..52ab7a7c9 100644 --- a/config/cortex-a9/make_defs.mk +++ b/config/cortex-a9/make_defs.mk @@ -77,7 +77,9 @@ ARFLAGS := cru # --- Determine the linker and related flags --- LINKER := $(CC) SOFLAGS := -shared +ifneq ($(CC_VENDOR),icc) LDFLAGS := -lm +endif diff --git a/config/dunnington/make_defs.mk b/config/dunnington/make_defs.mk index fed36506b..f8faa3b5b 100644 --- a/config/dunnington/make_defs.mk +++ b/config/dunnington/make_defs.mk @@ -88,7 +88,9 @@ ARFLAGS := cru # --- Determine the linker and related flags --- LINKER := $(CC) SOFLAGS := -shared +ifneq ($(CC_VENDOR),icc) LDFLAGS := -lm +endif diff --git a/config/haswell/make_defs.mk b/config/haswell/make_defs.mk index 1640a40b9..4c144846d 100644 --- a/config/haswell/make_defs.mk +++ b/config/haswell/make_defs.mk @@ -88,7 +88,9 @@ ARFLAGS := cru # --- Determine the linker and related flags --- LINKER := $(CC) SOFLAGS := -shared +ifneq ($(CC_VENDOR),icc) LDFLAGS := -lm +endif diff --git a/config/knl/make_defs.mk b/config/knl/make_defs.mk index e0385e6d5..6a750223d 100644 --- a/config/knl/make_defs.mk +++ b/config/knl/make_defs.mk @@ -95,7 +95,11 @@ ARFLAGS := cru # --- Determine the linker and related flags --- LINKER := $(CC) SOFLAGS := -shared -LDFLAGS := -lm -lmemkind +ifeq ($(CC_VENDOR),icc) +LDFLAGS := -lmemkind +else +LDFLAGS := -lmemkind -lm +endif diff --git a/config/loongson3a/make_defs.mk b/config/loongson3a/make_defs.mk index bb1248d37..2c7e9c58c 100644 --- a/config/loongson3a/make_defs.mk +++ b/config/loongson3a/make_defs.mk @@ -77,7 +77,9 @@ ARFLAGS := cru # --- Determine the linker and related flags --- LINKER := $(CC) SOFLAGS := -shared +ifneq ($(CC_VENDOR),icc) LDFLAGS := -lm +endif diff --git a/config/mic/make_defs.mk b/config/mic/make_defs.mk index 21af9e2e2..339112570 100644 --- a/config/mic/make_defs.mk +++ b/config/mic/make_defs.mk @@ -77,7 +77,11 @@ ARFLAGS := cru # --- Determine the linker and related flags --- LINKER := $(CC) SOFLAGS := -shared +ifeq ($(CC_VENDOR),icc) +LDFLAGS := -mmic +else LDFLAGS := -mmic -lm +endif diff --git a/config/piledriver/make_defs.mk b/config/piledriver/make_defs.mk index e241789dd..db46bd124 100644 --- a/config/piledriver/make_defs.mk +++ b/config/piledriver/make_defs.mk @@ -77,7 +77,9 @@ ARFLAGS := cru # --- Determine the linker and related flags --- LINKER := $(CC) SOFLAGS := -shared +ifneq ($(CC_VENDOR),icc) LDFLAGS := -lm +endif diff --git a/config/pnacl/make_defs.mk b/config/pnacl/make_defs.mk index e957cf429..9e2a3b4c5 100644 --- a/config/pnacl/make_defs.mk +++ b/config/pnacl/make_defs.mk @@ -63,7 +63,9 @@ ARFLAGS := rcs # --- Determine the linker and related flags --- LINKER := $(CC) SOFLAGS := +ifneq ($(CC_VENDOR),icc) LDFLAGS := -lm +endif # --- Determine the finalizer and related flags --- FINALIZER := pnacl-finalize diff --git a/config/power7/make_defs.mk b/config/power7/make_defs.mk index d03857a44..da4e5bff1 100644 --- a/config/power7/make_defs.mk +++ b/config/power7/make_defs.mk @@ -77,7 +77,9 @@ ARFLAGS := cru # --- Determine the linker and related flags --- LINKER := $(CC) SOFLAGS := -shared +ifneq ($(CC_VENDOR),icc) LDFLAGS := -lm +endif diff --git a/config/reference/make_defs.mk b/config/reference/make_defs.mk index 736e5ee4d..f2f86ba07 100644 --- a/config/reference/make_defs.mk +++ b/config/reference/make_defs.mk @@ -77,7 +77,9 @@ ARFLAGS := cru # --- Determine the linker and related flags --- LINKER := $(CC) SOFLAGS := -shared +ifneq ($(CC_VENDOR),icc) LDFLAGS := -lm +endif diff --git a/config/sandybridge/make_defs.mk b/config/sandybridge/make_defs.mk index 082a73f92..0a779b188 100644 --- a/config/sandybridge/make_defs.mk +++ b/config/sandybridge/make_defs.mk @@ -88,7 +88,9 @@ ARFLAGS := cru # --- Determine the linker and related flags --- LINKER := $(CC) SOFLAGS := -shared +ifneq ($(CC_VENDOR),icc) LDFLAGS := -lm +endif diff --git a/config/template/make_defs.mk b/config/template/make_defs.mk index 37de32882..98f3222e0 100644 --- a/config/template/make_defs.mk +++ b/config/template/make_defs.mk @@ -77,7 +77,9 @@ ARFLAGS := cru # --- Determine the linker and related flags --- LINKER := $(CC) SOFLAGS := -shared +ifneq ($(CC_VENDOR),icc) LDFLAGS := -lm +endif