From 15f79e19f58e561fbf766f607df13788cb612930 Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Tue, 6 Jun 2023 05:01:23 +0400 Subject: [PATCH] Enable control flow protection with Clang --- external/dispatch/CMakeLists.txt | 4 ++-- external/jemalloc/CMakeLists.txt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/external/dispatch/CMakeLists.txt b/external/dispatch/CMakeLists.txt index 11cc606..5d6dd62 100644 --- a/external/dispatch/CMakeLists.txt +++ b/external/dispatch/CMakeLists.txt @@ -17,8 +17,8 @@ if (NOT DESKTOP_APP_DISPATCH_LIBRARIES OR NOT DESKTOP_APP_DISPATCH_INCLUDE_DIRS) if (NOT DESKTOP_APP_USE_PACKAGED OR DESKTOP_APP_SPECIAL_TARGET) set(dispatch_extra_args -DCMAKE_BUILD_TYPE=Release - "-DCMAKE_C_FLAGS=-g -pipe -fPIC -fstack-protector-all -fstack-clash-protection -D_FORTIFY_SOURCE=3 -D_GLIBCXX_ASSERTIONS" - "-DCMAKE_CXX_FLAGS=-g -pipe -fPIC -fstack-protector-all -fstack-clash-protection -D_FORTIFY_SOURCE=3 -D_GLIBCXX_ASSERTIONS" + "-DCMAKE_C_FLAGS=-g -pipe -fPIC -fstack-protector-all -fstack-clash-protection -fcf-protection -D_FORTIFY_SOURCE=3 -D_GLIBCXX_ASSERTIONS" + "-DCMAKE_CXX_FLAGS=-g -pipe -fPIC -fstack-protector-all -fstack-clash-protection -fcf-protection -D_FORTIFY_SOURCE=3 -D_GLIBCXX_ASSERTIONS" ) elseif (DEFINED CMAKE_BUILD_TYPE) set(dispatch_extra_args diff --git a/external/jemalloc/CMakeLists.txt b/external/jemalloc/CMakeLists.txt index 809b828..70f2f1b 100644 --- a/external/jemalloc/CMakeLists.txt +++ b/external/jemalloc/CMakeLists.txt @@ -39,8 +39,8 @@ ExternalProject_Add(jemalloc CONFIGURE_COMMAND env CC=clang CXX=clang++ - "$>,$>,EXTRA_CFLAGS=-fstack-protector-all -fstack-clash-protection -DNDEBUG -D_FORTIFY_SOURCE=3 -D_GLIBCXX_ASSERTIONS,=>" - "$>,$>,EXTRA_CXXFLAGS=-fstack-protector-all -fstack-clash-protection -DNDEBUG -D_FORTIFY_SOURCE=3 -D_GLIBCXX_ASSERTIONS,=>" + "$>,$>,EXTRA_CFLAGS=-fstack-protector-all -fstack-clash-protection -fcf-protection -DNDEBUG -D_FORTIFY_SOURCE=3 -D_GLIBCXX_ASSERTIONS,=>" + "$>,$>,EXTRA_CXXFLAGS=-fstack-protector-all -fstack-clash-protection -fcf-protection -DNDEBUG -D_FORTIFY_SOURCE=3 -D_GLIBCXX_ASSERTIONS,=>" ./autogen.sh --disable-shared BUILD_COMMAND make $<$>:-j${N}> BUILD_IN_SOURCE 1