use -march=native by default with a disable toggle
parent
00915521a3
commit
5bee717134
6
Makefile
6
Makefile
|
@ -1,3 +1,4 @@
|
||||||
|
CONFIG_NATIVE := true
|
||||||
CONFIG_CXX_ALLOCATOR := true
|
CONFIG_CXX_ALLOCATOR := true
|
||||||
CONFIG_UBSAN := false
|
CONFIG_UBSAN := false
|
||||||
CONFIG_SEAL_METADATA := false
|
CONFIG_SEAL_METADATA := false
|
||||||
|
@ -8,6 +9,11 @@ endef
|
||||||
|
|
||||||
CPPFLAGS := -D_GNU_SOURCE
|
CPPFLAGS := -D_GNU_SOURCE
|
||||||
SHARED_FLAGS := -O2 -flto -fPIC -fvisibility=hidden -fno-plt -pipe -Wall -Wextra $(call safe_flag,-Wcast-align=strict) -Wcast-qual -Wwrite-strings
|
SHARED_FLAGS := -O2 -flto -fPIC -fvisibility=hidden -fno-plt -pipe -Wall -Wextra $(call safe_flag,-Wcast-align=strict) -Wcast-qual -Wwrite-strings
|
||||||
|
|
||||||
|
ifeq ($(CONFIG_NATIVE),true)
|
||||||
|
SHARED_FLAGS += -march=native
|
||||||
|
endif
|
||||||
|
|
||||||
CFLAGS := -std=c11 $(SHARED_FLAGS) -Wmissing-prototypes
|
CFLAGS := -std=c11 $(SHARED_FLAGS) -Wmissing-prototypes
|
||||||
CXXFLAGS := -std=c++14 $(SHARED_FLAGS)
|
CXXFLAGS := -std=c++14 $(SHARED_FLAGS)
|
||||||
LDFLAGS := -Wl,-z,defs,-z,relro,-z,now,-z,nodlopen,-z,text
|
LDFLAGS := -Wl,-z,defs,-z,relro,-z,now,-z,nodlopen,-z,text
|
||||||
|
|
|
@ -60,6 +60,10 @@ make command as follows:
|
||||||
|
|
||||||
The available configuration options are the following:
|
The available configuration options are the following:
|
||||||
|
|
||||||
|
* `CONFIG_NATIVE`: `true` (default) or `false` to control whether the code is
|
||||||
|
optimized for the detected CPU on the host. If this is disabled, setting up a
|
||||||
|
custom `-march` higher than the baseline architecture is highly recommended
|
||||||
|
due to substantial performance benefits for this code.
|
||||||
* `CONFIG_CXX_ALLOCATOR`: `true` (default) or `false` to control whether the
|
* `CONFIG_CXX_ALLOCATOR`: `true` (default) or `false` to control whether the
|
||||||
C++ allocator is replaced for slightly improved performance and detection of
|
C++ allocator is replaced for slightly improved performance and detection of
|
||||||
mismatched sizes for sized deallocation (often type confusion bugs). This
|
mismatched sizes for sized deallocation (often type confusion bugs). This
|
||||||
|
|
Loading…
Reference in New Issue