diff --git a/.bazelrc b/.bazelrc index 31f816697a..b6dced503f 100644 --- a/.bazelrc +++ b/.bazelrc @@ -215,9 +215,6 @@ build:windows --host_copt=-DNOGDI build:windows --copt=/Zc:preprocessor build:windows --host_copt=/Zc:preprocessor -# Misc build options we need for windows. -build:windows --linkopt=/DEBUG -build:windows --host_linkopt=/DEBUG build:windows --linkopt=/OPT:REF build:windows --host_linkopt=/OPT:REF build:windows --linkopt=/OPT:ICF diff --git a/common_settings.bzl b/common_settings.bzl index 1f64026c09..976439432b 100644 --- a/common_settings.bzl +++ b/common_settings.bzl @@ -132,6 +132,19 @@ LINUX_COMMON_STATIC_LIBS_COPTS = [ "-Werror", # ov::Tensor::data method call results in deprecated warning and we use it in multiple places "-Wno-deprecated-declarations", + "-Werror", + "-Wimplicit-fallthrough", + "-fcf-protection=full", + "-Wformat", + "-Wformat-security", + "-Werror=format-security", + "-Wl,-z,noexecstack", + "-fPIC", + "-D_GLIBCXX_ASSERTIONS", + "-Wl,-z,relro", + "-Wl,-z,relro,-z,now", + "-Wl,-z,nodlopen", + "-fstack-protector-strong", ] WINDOWS_COMMON_STATIC_LIBS_COPTS = [ @@ -157,6 +170,7 @@ WINDOWS_COMMON_STATIC_LIBS_COPTS = [ "/wd4702", "/wd4267", "/wd4996", + "/guard:cf", ] COMMON_STATIC_LIBS_COPTS = select({