Enable more hardening for libcpp

- _LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS: This macro is used to enable -Wthread-safety annotations on libc++’s std::mutex and std::lock_guard.
- _LIBCPP_ENABLE_HARDENED_MODE to enable the hardened mode.
This commit is contained in:
jvoisin 2023-08-21 13:34:34 +02:00
parent 28b97249fa
commit 65b5d578b2
1 changed files with 2 additions and 1 deletions

View File

@ -1,5 +1,6 @@
export CFLAGS="-Os -fstack-clash-protection -Wformat -Werror=format-security"
export CXXFLAGS="-Os -fstack-clash-protection -Wformat -Werror=format-security -D_GLIBCXX_ASSERTIONS=1"
export CXXFLAGS="-Os -fstack-clash-protection -Wformat -Werror=format-security"
export CXXFLAGS="$CXXFLAGS -D_GLIBCXX_ASSERTIONS=1 -D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS -D_LIBCPP_ENABLE_HARDENED_MODE"
export LDFLAGS="-Wl,--as-needed,-O1,--sort-common"
export GOFLAGS="-buildmode=pie -modcacherw -trimpath -buildvcs=false"
# Do note that these should work with at least GDC and LDC