diff options
author | Waldemar Brodkorb <wbx@uclibc-ng.org> | 2016-02-16 22:15:39 +0100 |
---|---|---|
committer | Waldemar Brodkorb <wbx@uclibc-ng.org> | 2016-02-16 22:15:39 +0100 |
commit | 77f9d57de4989f5012b1651df6512c4828144d93 (patch) | |
tree | b6d0410896bdb3ec19f13c7ecff5747dcfb6edec | |
parent | 3f8f308a7f967deedea6771723346ba0cb3002d0 (diff) |
rework ARM NEON support
Don't build C library with -ffast-math when NEON is globally enabled.
Disable NEON support by default.
Remove dangerous -funsafe-math-optimizations.
Most suggestions from Rich Felker after analyzing libc-test
failures in my setup.
-rw-r--r-- | mk/vars.mk | 4 | ||||
-rw-r--r-- | target/config/Config.in.fpu | 2 | ||||
-rw-r--r-- | toolchain/musl/Makefile | 2 | ||||
-rw-r--r-- | toolchain/uclibc-ng/Makefile | 6 |
4 files changed, 9 insertions, 5 deletions
diff --git a/mk/vars.mk b/mk/vars.mk index 38a2e9393..67aa42206 100644 --- a/mk/vars.mk +++ b/mk/vars.mk @@ -264,8 +264,8 @@ endif ifeq ($(ADK_TARGET_ARCH_ARM),y) ifeq ($(ADK_TARGET_ARCH_ARM_WITH_NEON),y) -TARGET_CFLAGS+= -funsafe-math-optimizations -ffast-math -TARGET_CXXFLAGS+= -funsafe-math-optimizations -ffast-math +TARGET_CFLAGS+= -ffast-math +TARGET_CXXFLAGS+= -ffast-math endif ifeq ($(ADK_TARGET_ARCH_ARM_WITH_THUMB),y) TARGET_CFLAGS+= -mthumb -Wa,-mimplicit-it=thumb -mno-thumb-interwork diff --git a/target/config/Config.in.fpu b/target/config/Config.in.fpu index 0c3acbade..b3b64bf96 100644 --- a/target/config/Config.in.fpu +++ b/target/config/Config.in.fpu @@ -4,7 +4,7 @@ config ADK_TARGET_ARCH_ARM_WITH_NEON bool "enable NEON SIMD support" depends on ADK_TARGET_ARCH_ARM && ADK_TARGET_CPU_WITH_NEON - default y + default n help Enable support for NEON SIMD CPU extensions. diff --git a/toolchain/musl/Makefile b/toolchain/musl/Makefile index 8390b13a7..0c628806a 100644 --- a/toolchain/musl/Makefile +++ b/toolchain/musl/Makefile @@ -12,6 +12,8 @@ endif # not yet possible TARGET_CFLAGS:= $(filter-out -fstack-protector-all,$(TARGET_CFLAGS)) TARGET_LDFLAGS:= $(filter-out -fstack-protector-all,$(TARGET_LDFLAGS)) +# don't use fast-math for C library +TARGET_CFLAGS:= $(filter-out -ffast-math,$(TARGET_CFLAGS)) $(WRKBUILD)/.configured: (cd $(WRKBUILD); CC='$(TARGET_CC)' CROSS_COMPILE='$(TARGET_CROSS)' \ diff --git a/toolchain/uclibc-ng/Makefile b/toolchain/uclibc-ng/Makefile index 5882dd7e2..981843c82 100644 --- a/toolchain/uclibc-ng/Makefile +++ b/toolchain/uclibc-ng/Makefile @@ -9,10 +9,12 @@ include Makefile.inc include ${ADK_TOPDIR}/mk/buildhlp.mk # disable LTO -TARGET_CFLAGS:=$(filter-out -flto,$(TARGET_CFLAGS)) +TARGET_CFLAGS:= $(filter-out -flto,$(TARGET_CFLAGS)) # handled by uClibc-ng makefiles -TARGET_CFLAGS:=$(filter-out -fstack-protector-all,$(TARGET_CFLAGS)) +TARGET_CFLAGS:= $(filter-out -fstack-protector-all,$(TARGET_CFLAGS)) TARGET_LDFLAGS:=$(filter-out -fstack-protector-all,$(TARGET_LDFLAGS)) +# don't use fast-math for C library +TARGET_CFLAGS:= $(filter-out -ffast-math,$(TARGET_CFLAGS)) ifeq ($(ADK_TARGET_HARD_FLOAT),y) ifeq ($(ADK_TARGET_ARCH_ARM),y) |