42a58a9bcb
Rebased patch 0001 and removed another hardening flag. Removed patch 0002 which was backported from upstream commit. Renumbered and rebased patch 0003. Reformatted hashes. Reworked X11 support as it is an optional dependency: https://github.com/intel/media-driver/pull/494 Release notes: https://github.com/intel/media-driver/releases/tag/intel-media-21.2.3 Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
72 lines
3.2 KiB
Diff
72 lines
3.2 KiB
Diff
From 8916c8480eb3483c2ffb41ad8961cd0c2b0fb1c4 Mon Sep 17 00:00:00 2001
|
|
From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
|
|
Date: Mon, 15 Apr 2019 22:48:21 +0200
|
|
Subject: [PATCH] Drop hardening-related flags
|
|
|
|
These will be set by Buildroot depending on toolchain capabilities and
|
|
global Buildroot options.
|
|
|
|
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
|
|
---
|
|
cmrtlib/linux/CMakeLists.txt | 8 ++++----
|
|
media_driver/cmake/linux/media_compile_flags_linux.cmake | 1 -
|
|
media_driver/media_top_cmake.cmake | 2 +-
|
|
3 files changed, 5 insertions(+), 6 deletions(-)
|
|
|
|
diff --git a/cmrtlib/linux/CMakeLists.txt b/cmrtlib/linux/CMakeLists.txt
|
|
index 44ce4f08..b462fbea 100644
|
|
--- a/cmrtlib/linux/CMakeLists.txt
|
|
+++ b/cmrtlib/linux/CMakeLists.txt
|
|
@@ -32,11 +32,11 @@
|
|
endif()
|
|
|
|
# Set up compile options that will be used for the Linux build
|
|
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CPP_STANDARD_OPTION} -fPIC -fpermissive -fstack-protector-all -Werror")
|
|
-set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fno-strict-aliasing -D_FORTIFY_SOURCE=2")
|
|
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CPP_STANDARD_OPTION} -fPIC -fpermissive -Werror")
|
|
+set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fno-strict-aliasing")
|
|
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG -D__DEBUG -O0")
|
|
-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CPP_STANDARD_OPTION} -fPIC -fpermissive -fstack-protector-all -Werror")
|
|
-set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -fno-strict-aliasing -D_FORTIFY_SOURCE=2")
|
|
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CPP_STANDARD_OPTION} -fPIC -fpermissive -Werror")
|
|
+set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -fno-strict-aliasing")
|
|
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D_DEBUG -D__DEBUG -O0")
|
|
|
|
set(GCC_SECURE_LINK_FLAGS "-z relro -z now")
|
|
diff --git a/media_driver/cmake/linux/media_compile_flags_linux.cmake b/media_driver/cmake/linux/media_compile_flags_linux.cmake
|
|
index 9e85fdb2..c45ce11b 100755
|
|
--- a/media_driver/cmake/linux/media_compile_flags_linux.cmake
|
|
+++ b/media_driver/cmake/linux/media_compile_flags_linux.cmake
|
|
@@ -47,7 +47,6 @@ set(MEDIA_COMPILER_FLAGS_COMMON
|
|
# Other common flags
|
|
-fmessage-length=0
|
|
-fvisibility=hidden
|
|
- -fstack-protector
|
|
-fdata-sections
|
|
-ffunction-sections
|
|
-Wl,--gc-sections
|
|
@@ -119,7 +118,6 @@
|
|
set(MEDIA_COMPILER_FLAGS_RELEASE
|
|
${MEDIA_COMPILER_FLAGS_RELEASE}
|
|
-O2
|
|
- -D_FORTIFY_SOURCE=2
|
|
-fno-omit-frame-pointer
|
|
)
|
|
endif()
|
|
diff --git a/media_driver/media_top_cmake.cmake b/media_driver/media_top_cmake.cmake
|
|
index 3491db1e..b30fa04a 100755
|
|
--- a/media_driver/media_top_cmake.cmake
|
|
+++ b/media_driver/media_top_cmake.cmake
|
|
@@ -105,7 +105,7 @@ if(MEDIA_BUILD_FATAL_WARNINGS)
|
|
set_target_properties(${LIB_NAME_OBJ} PROPERTIES COMPILE_FLAGS "-Werror")
|
|
endif()
|
|
|
|
-set_target_properties(${LIB_NAME} PROPERTIES LINK_FLAGS "-Wl,--no-as-needed -Wl,--gc-sections -z relro -z now -fstack-protector -fPIC")
|
|
+set_target_properties(${LIB_NAME} PROPERTIES LINK_FLAGS "-Wl,--no-as-needed -Wl,--gc-sections -fPIC")
|
|
set_target_properties(${LIB_NAME} PROPERTIES PREFIX "")
|
|
set_target_properties(${LIB_NAME_STATIC} PROPERTIES PREFIX "")
|
|
|
|
--
|
|
2.20.1
|
|
|