Disable CFI in FIPS module
This fixes the build with -DCFI=1 -DFIPS=1, but not all tests pass yet.
Change-Id: I89904284482981aeed040800dde69697542c15fa
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/78867
Reviewed-by: David Benjamin <davidben@google.com>
Auto-Submit: Peter Collingbourne <pcc@google.com>
Commit-Queue: David Benjamin <davidben@google.com>
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4211db0..bb01da1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -541,6 +541,10 @@
# Clang warns when passing both -c (from CMake) and -S.
target_compile_options(bcm_c_generated_asm PRIVATE "-Wno-unused-command-line-argument")
endif()
+ if(CFI)
+ # Delocate needs real assembly code so we need to disable CFI and LTO in the FIPS module.
+ target_compile_options(bcm_c_generated_asm PRIVATE "-fno-lto" "-fno-sanitize=cfi")
+ endif()
set(TARGET_FLAG "")
if(CMAKE_ASM_COMPILER_TARGET)