@@ -45,27 +45,31 @@ AR := $(call toolset_exe,ar,ar)
4545
4646# uname_m := $(shell uname -m)
4747
48- cxxflags.gcc.debug := -Og -march=native -fstack-protector-all -fno-omit-frame-pointer # -D_GLIBCXX_DEBUG
49- cxxflags.gcc.release := -O3 -march=native -mtune=native -falign-{functions,loops}=64 -DNDEBUG
50- cxxflags.gcc.sanitize := ${cxxflags.gcc.release} -fsanitize=thread
51- cxxflags.gcc := -g -f{no-plt,no-math-errno,finite-math-only,message-length=0} -W{all,extra,error,no-{array-bounds,maybe-uninitialized,unused-variable,unused-function,unused-local-typedefs}} ${cxxflags.gcc.${BUILD}}
52- ldflags.gcc.sanitize := ${ldflags.gcc.release} -fsanitize=thread
53- ldflags.gcc := -g ${ldflags.gcc.${BUILD}}
48+ cxxflags.gcc.debug := -Og -f{stack-protector-all,no-omit-frame-pointer} # -D_GLIBCXX_DEBUG
49+ cxxflags.gcc.release := -O3 -mtune=native -falign-{functions,loops}=64 -DNDEBUG
50+ cxxflags.gcc.sanitize := ${cxxflags.gcc.debug} -fsanitize=thread
51+ cxxflags.gcc.sanitize2 := ${cxxflags.gcc.debug} -fsanitize=undefined,address
52+ cxxflags.gcc := -march=native -f{no-plt,no-math-errno,finite-math-only,message-length=0} -W{all,extra,error,no-{array-bounds,maybe-uninitialized,unused-variable,unused-function,unused-local-typedefs}} ${cxxflags.gcc.${BUILD}}
53+ ldflags.gcc.sanitize := ${ldflags.gcc.debug} -fsanitize=thread
54+ ldflags.gcc.sanitize2 := ${ldflags.gcc.debug} -fsanitize=undefined,address
55+ ldflags.gcc := -fuse-ld=gold ${ldflags.gcc.${BUILD}}
5456
5557# clang-14 for arm doesn't support -march=native.
5658has_native := $(if $(and $(findstring clang,${CXX}) , $(findstring aarch64,$(shell uname -m) ) , $(shell ${CXX} -march=native -c -xc++ -o/dev/null /dev/null 2>&1) ) ,,1)
5759cxxflags.clang.debug := -O0 -fstack-protector-all $(and ${has_native},-march=native)
5860cxxflags.clang.release := -O3 -falign-functions=64 -DNDEBUG $(and ${has_native},-march=native -mtune=native)
59- cxxflags.clang.sanitize := ${cxxflags.clang.release } -fsanitize=thread
60- cxxflags.clang := -g -stdlib=libstdc++ -f{no-plt,no-math-errno,finite-math-only,message-length=0} -W{all,extra,error,no-{unused-variable,unused-function,unused-local-typedefs}} ${cxxflags.clang.${BUILD}}
61- ldflags .clang.sanitize := ${ldflags .clang.release} -fsanitize=thread
61+ cxxflags.clang.sanitize := ${cxxflags.clang.debug } -fsanitize=thread
62+ cxxflags.clang.sanitize2 := ${cxxflags.clang.debug} -fsanitize=undefined,address
63+ cxxflags .clang := -stdlib=libstdc++ -f{no-plt,no-math-errno,finite-math-only,message-length=0} -W{all,extra,error,no-{unused-variable,unused-function,unused-local-typedefs}} ${cxxflags .clang.${BUILD}}
6264ldflags.clang.debug := -latomic # A work-around for clang bug.
63- ldflags.clang := -g -stdlib=libstdc++ ${ldflags.clang.${BUILD}}
65+ ldflags.clang.sanitize := ${ldflags.clang.debug} -fsanitize=thread
66+ ldflags.clang.sanitize2 := ${ldflags.clang.debug} -fsanitize=undefined,address
67+ ldflags.clang := -stdlib=libstdc++ ${ldflags.clang.${BUILD}}
6468
6569# Additional CPPFLAGS, CXXFLAGS, LDLIBS, LDFLAGS can come from the command line, e.g. make CPPFLAGS='-I<my-include-dir>', or from environment variables.
66- cxxflags := -std=c++14 -pthread $(call toolset_flags,cxxflags) ${CXXFLAGS}
70+ cxxflags := -std=c++14 -pthread -g $(call toolset_flags,cxxflags) ${CXXFLAGS}
6771cppflags := -Iinclude ${CPPFLAGS}
68- ldflags := -fuse-ld=gold -pthread $(call toolset_flags,ldflags) ${LDFLAGS}
72+ ldflags := -pthread -g $(call toolset_flags,ldflags) ${LDFLAGS}
6973ldlibs := -lrt ${LDLIBS}
7074
7175cppflags.tbb :=
0 commit comments