Add hardening linker options.

PiperOrigin-RevId: 347367335
Change-Id: Ia7d707bd3e7e58021fc3bb14df13a9f06c5e2735
This commit is contained in:
Anton D. Kachalov 2020-12-14 05:39:05 -08:00 committed by Copybara-Service
parent c3ac45be3e
commit 8924b63d5a

View File

@ -60,6 +60,7 @@ add_compile_options(-fno-exceptions)
if(SAPI_HARDENED_SOURCE) if(SAPI_HARDENED_SOURCE)
add_compile_options(-fstack-protector -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2) add_compile_options(-fstack-protector -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2)
add_link_options(-Wl,-z,relro -Wl,-z,now)
endif() endif()
# Make Bazel-style includes work # Make Bazel-style includes work