Skip to content

Commit

Permalink
Enforce Werror when building samples on Linux
Browse files Browse the repository at this point in the history
Signed-off-by: Ming-Wei Shih <mishih@microsoft.com>
  • Loading branch information
mingweishih committed Feb 2, 2021
1 parent 6f4becb commit e5424c4
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
6 changes: 5 additions & 1 deletion enclave/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,11 @@ if (OE_SGX)
# user. There are valid reasons for an end user to use built-ins.
$<BUILD_INTERFACE:-fno-builtin-malloc
-fno-builtin-calloc
-fno-builtin>)
-fno-builtin>
# Treat warnings as errors by default. Application based on OE SDK
# will inhere this flag, which is consistent to the behavior of the
# clangw script.
-Werror)
elseif (OE_TRUSTZONE)
enclave_compile_options(oecore PUBLIC -fvisibility=hidden ${OE_TZ_TA_C_FLAGS})
endif ()
Expand Down
22 changes: 15 additions & 7 deletions pkgconfig/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ set(ENCLAVE_CFLAGS_LIST
-fstack-protector-strong
-fno-omit-frame-pointer
-ffunction-sections
-fdata-sections)
-fdata-sections
# Treat warnings as errors by default, which is consistent to the behavior
# of the clangw script.
-Werror)

set(ENCLAVE_CFLAGS_CLANG_LIST ${ENCLAVE_CFLAGS_LIST}
${SPECTRE_MITIGATION_FLAGS})
Expand Down Expand Up @@ -214,10 +217,15 @@ endfunction ()
##
##==============================================================================

set(PACKAGE_CONFIG_FILES_LIST oehost-gcc.pc oehost-g++.pc
oehost-clang.pc oehost-clang++.pc
oeenclave-gcc.pc oeenclave-g++.pc
oeenclave-clang.pc oeenclave-clang++.pc)
set(PACKAGE_CONFIG_FILES_LIST
oehost-gcc.pc
oehost-g++.pc
oehost-clang.pc
oehost-clang++.pc
oeenclave-gcc.pc
oeenclave-g++.pc
oeenclave-clang.pc
oeenclave-clang++.pc)

##==============================================================================
##
Expand All @@ -236,8 +244,8 @@ set(LVI_MITIGATION_PACKAGE_CONFIG_FILES_LIST
##==============================================================================

set(HOST_VERIFY_PACKAGE_CONFIG_FILES_LIST
oehostverify-gcc.pc oehostverify-g++.pc
oehostverify-clang.pc oehostverify-clang++.pc)
oehostverify-gcc.pc oehostverify-g++.pc oehostverify-clang.pc
oehostverify-clang++.pc)

foreach (file_name ${PACKAGE_CONFIG_FILES_LIST})
configure_and_install_pkg_config(${file_name} "")
Expand Down

0 comments on commit e5424c4

Please sign in to comment.