diff --git a/fix-clang-build-error.patch b/fix-clang-build-error.patch new file mode 100644 index 0000000000000000000000000000000000000000..299dfec0960eba39548cd8d1e5dd15b15e131047 --- /dev/null +++ b/fix-clang-build-error.patch @@ -0,0 +1,94 @@ +diff -up a/component/secure_channel/enclave/CMakeLists.txt b/component/secure_channel/enclave/CMakeLists.txt +--- a/component/secure_channel/enclave/CMakeLists.txt 2023-05-09 17:55:50.430477315 +0800 ++++ b/component/secure_channel/enclave/CMakeLists.txt 2023-05-09 18:03:20.572026147 +0800 +@@ -38,10 +38,14 @@ if(CC_SGX) + endif() + + set(CMAKE_C_FLAGS "-W -Wall -fno-short-enums -fno-omit-frame-pointer -fstack-protector \ +- -Wstack-protector --param ssp-buffer-size=4 -frecord-gcc-switches -Wextra -nostdinc -nodefaultlibs\ +- -fno-peephole -fno-peephole2 -Wno-main -Wno-error=unused-parameter \ ++ -Wstack-protector --param ssp-buffer-size=4 -frecord-gcc-switches -Wextra -nostdinc \ ++ -nodefaultlibs -Wno-main -Wno-error=unused-parameter \ + -Wno-error=unused-but-set-variable -Wno-error=format-truncation= ") + ++if (CMAKE_COMPILER_IS_GNUCC) ++ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-peephole -fno-peephole2" PARENT_SCOPE) ++endif() ++ + set(COMMON_C_LINK_FLAGS "-Wl,-z,now -Wl,-z,relro -Wl,-z,noexecstack -Wl,-nostdlib -nodefaultlibs -nostartfiles") + + if(CC_GP) +diff -up a/component/secure_channel/host/CMakeLists.txt b/component/secure_channel/host/CMakeLists.txt +--- a/component/secure_channel/host/CMakeLists.txt 2023-05-10 15:33:38.565902158 +0800 ++++ b/component/secure_channel/host/CMakeLists.txt 2023-05-10 15:34:20.869781075 +0800 +@@ -33,7 +33,11 @@ if(CC_SGX) + --search-path ${SGX_SDK_PATH}/include) + endif() + +-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-maybe-uninitialized -fPIC") ++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") ++ ++if(CMAKE_COMPILER_IS_GNUCC) ++ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-maybe-uninitialized" PARENT_SCOPE) ++endif() + + if(CC_GP) + if(${CMAKE_VERSION} VERSION_LESS "3.13.0") +diff -up a/src/enclave_src/CMakeLists.txt b/src/enclave_src/CMakeLists.txt +--- a/src/enclave_src/CMakeLists.txt 2023-05-10 15:00:11.696559053 +0800 ++++ b/src/enclave_src/CMakeLists.txt 2023-05-10 15:21:54.319513810 +0800 +@@ -21,10 +21,12 @@ include_directories(${LOCAL_ROOT_PATH}/i + ${LOCAL_ROOT_PATH}/inc/enclave_inc) + + set(COMMON_C_FLAGS "-D_FORTIFY_SOURCE=2 -O2 -ftrapv -fstack-protector-all -fno-short-enums -fno-omit-frame-pointer \ +- --param ssp-buffer-size=4 -frecord-gcc-switches -nostdinc -nodefaultlibs \ +- -fno-peephole -fno-peephole2 -Wno-main -Wno-error=unused-parameter \ ++ --param ssp-buffer-size=4 -frecord-gcc-switches -nostdinc -nodefaultlibs -Wno-main -Wno-error=unused-parameter \ + -Wno-error=unused-but-set-variable -Wno-error=format-truncation=") + ++if(CMAKE_COMPILER_IS_GNUCC) ++ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-peephole -fno-peephole2" PARENT_SCOPE) ++endif() + + if(CC_GP) + add_subdirectory(gp/itrustee) +diff -up a/src/enclave_src/gp/itrustee/CMakeLists.txt b/src/enclave_src/gp/itrustee/CMakeLists.txt +--- a/src/enclave_src/gp/itrustee/CMakeLists.txt 2023-05-09 17:55:39.051430995 +0800 ++++ b/src/enclave_src/gp/itrustee/CMakeLists.txt 2023-05-09 18:00:23.939655291 +0800 +@@ -9,8 +9,8 @@ + # See the Mulan PSL v2 for more details. + + set(CMAKE_C_FLAGS "-W -Wall -fno-short-enums -fno-omit-frame-pointer -fstack-protector-strong -Wstack-protector \ +- --param ssp-buffer-size=4 -frecord-gcc-switches -Wextra -nostdinc -nodefaultlibs -fno-peephole \ +- -fno-peephole2 -Wno-main -Wno-error=unused-parameter -Wno-error=unused-but-set-variable \ ++ --param ssp-buffer-size=4 -frecord-gcc-switches -Wextra -nostdinc -nodefaultlibs -Wno-main \ ++ -Wno-error=unused-parameter -Wno-error=unused-but-set-variable \ + -Wno-error=format-truncation= -D_FORTIFY_SOURCE=2 -O2") + set(COMMON_C_LINK_FLAGS "-Wl,-z,now -Wl,-z,relro -Wl,-z,noexecstack -Wl,-nostdlib -nodefaultlibs -nostartfiles") + set(SOURCE_FILES ${SOURCE_FILES} ../gp.c ../gp_ocall.c itrustee_seal_data.c error_conversion.c bottom_memory_check.c +@@ -20,6 +20,7 @@ set(ITRUSTEE_TEEDIR ${SDK_PATH}/) + set(ITRUSTEE_LIBC ${SDK_PATH}/thirdparty/open_source/musl/libc) + + if (CMAKE_COMPILER_IS_GNUCC) ++ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-peephole -fno-peephole2" PARENT_SCOPE) + execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpfullversion -dumpversion + OUTPUT_VARIABLE GCC_VERSION) + string(REGEX MATCHALL "[0-9]+" GCC_VERSION_COMPONENTS ${GCC_VERSION}) +diff -up a/src/host_src/CMakeLists.txt b/src/host_src/CMakeLists.txt +--- a/src/host_src/CMakeLists.txt 2023-05-10 15:29:36.066048984 +0800 ++++ b/src/host_src/CMakeLists.txt 2023-05-10 15:31:09.903962169 +0800 +@@ -8,9 +8,13 @@ + # PURPOSE. + # See the Mulan PSL v2 for more details. + +-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden -fPIC -Wno-stringop-overflow -fstack-protector-strong \ ++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden -fPIC -fstack-protector-strong \ + -D_FORTIFY_SOURCE=2 -O2") + ++if(CMAKE_COMPILER_IS_GNUCC) ++ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-stringop-overflow" PARENT_SCOPE) ++endif() ++ + set(LIBRARY_INSTALL ${LOCAL_ROOT_PATH_INSTALL}/usr/lib64) + + include_directories(${LOCAL_ROOT_PATH}/inc/host_inc diff --git a/secGear.spec b/secGear.spec index 1a6bcb473ac3716cd7e5ce8687495bd36d6d3a03..a12b49180407c00f95943fba58304ec6be4e1d1b 100644 --- a/secGear.spec +++ b/secGear.spec @@ -1,6 +1,6 @@ Name: secGear Version: 0.1.0 -Release: 37 +Release: 38 Summary: secGear is an SDK to develop confidential computing apps based on hardware enclave features @@ -68,6 +68,7 @@ Patch55: 0056-destroy-enclave-release-remain-shared-memory.patch Patch56: 0057-new-feature-secure-channel-support.patch Patch57: 0058-refactor-cmake-SDK_PATH.patch Patch58: 0059-adapt-itrustee_sdk-openssl-path-modification.patch +Patch59: fix-clang-build-error.patch BuildRequires: gcc python automake autoconf libtool BUildRequires: glibc glibc-devel cmake ocaml-dune rpm gcc-c++ compat-openssl11-libs compat-openssl11-devel @@ -194,6 +195,9 @@ popd systemctl restart rsyslog %changelog +* Wed May 10 2023 jammyjellyfish - 0.1.0-38 +- fix clang build error + * Thu Apr 27 2023 houmingyong - 0.1.0-37 - backport some patchs