package/ogre: fix build with RELRO
PATCH 1/1 package/ogre: fix build with RELRO
Fixes:
- http://autobuild.buildroot.org/results/b64dfcd8e576666e8a4a52da81a2f5a92b779dc7
--- ...ompiledHeader.cmake-Add-c-argument-t.patch | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 package/ogre/0001-CMake-Utils-PrecompiledHeader.cmake-Add-c-argument-t.patch
package/ogre/0001-CMake-Utils-PrecompiledHeader.cmake-Add-c-argument-t.patch new file +57 -0
@@ -0,0 +1,57 @@ +From f480ac538eb69086d4b7db855c2a457d5d6420d4 Mon Sep 17 00:00:00 2001 +From: Fabrice Fontaine <[email protected]> +Date: Mon, 10 Feb 2020 14:05:12 +0100 +Subject: [PATCH] CMake/Utils/PrecompiledHeader.cmake: Add -c argument to build + precompiled headers + +Add "-c" argument when building precompiled headers to fix build with +RELRO. + +More information on a similar issue with domoticz can be found here: +https://patchwork.ozlabs.org/patch/1187328: + +"The problem AFAICS is that if no -c or similar option is given, GCC +decides what needs to be done based on the rest of the arguments. If the +rest of the arguments include a -Wl,... option, it decides that linking +needs to be done. If the rest of the arguments are just header files, it +decides to create a precompiled header." + +Fixes: + - http://autobuild.buildroot.org/results/8fabf8d270b9257c3a9db6a2f17f1c08ec9428d3 + +Signed-off-by: Fabrice Fontaine <[email protected]> +[Upstream status: https://github.com/OGRECave/ogre/pull/1454] +--- + CMake/Utils/PrecompiledHeader.cmake | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/CMake/Utils/PrecompiledHeader.cmake b/CMake/Utils/PrecompiledHeader.cmake +index a02d99acd..bfb0059db 100644 +--- a/CMake/Utils/PrecompiledHeader.cmake ++++ b/CMake/Utils/PrecompiledHeader.cmake +@@ -133,11 +133,11 @@ MACRO(_PCH_GET_COMPILE_COMMAND out_command _input _output) + STRING(REGEX REPLACE "^ +" "" pchsupport_compiler_cxx_arg1 ${CMAKE_CXX_COMPILER_ARG1}) + + SET(${out_command} +- ${CMAKE_CXX_COMPILER} ${pchsupport_compiler_cxx_arg1} ${_compile_FLAGS} -x c++-header -o ${_output} ${_input} ++ ${CMAKE_CXX_COMPILER} ${pchsupport_compiler_cxx_arg1} ${_compile_FLAGS} -x c++-header -c -o ${_output} ${_input} + ) + ELSE(CMAKE_CXX_COMPILER_ARG1) + SET(${out_command} +- ${CMAKE_CXX_COMPILER} ${_compile_FLAGS} -x c++-header -o ${_output} ${_input} ++ ${CMAKE_CXX_COMPILER} ${_compile_FLAGS} -x c++-header -c -o ${_output} ${_input} + ) + ENDIF(CMAKE_CXX_COMPILER_ARG1) + ELSE(CMAKE_COMPILER_IS_GNUCXX) +@@ -291,7 +291,7 @@ MACRO(ADD_PRECOMPILED_HEADER _targetName _input) + set_target_properties(${_targetName}_pch_dephelp PROPERTIES INCLUDE_DIRECTORIES "${DIRINC}") + + #MESSAGE("_compile_FLAGS: ${_compile_FLAGS}") +- #message("COMMAND ${CMAKE_CXX_COMPILER} ${_compile_FLAGS} -x c++-header -o ${_output} ${_input}") ++ #message("COMMAND ${CMAKE_CXX_COMPILER} ${_compile_FLAGS} -x c++-header -c -o ${_output} ${_input}") + + ADD_CUSTOM_COMMAND( + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${_name}" +-- +2.24.1 +
Signature · 1 line
2.24.1
PATCH 1/1 package/ogre: fix build with RELRO
Quoted 8 lines · On Mon, 10 Feb 2020 18:45:11 +0100 Fabrice Fontaine…
Fixes:
- http://autobuild.buildroot.org/results/b64dfcd8e576666e8a4a52da81a2f5a92b779dc7Signed-off-by Fabrice Fontaine <[email protected]>--- ...ompiledHeader.cmake-Add-c-argument-t.patch | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 package/ogre/0001-CMake-Utils-PrecompiledHeader.cmake-Add-c-argument-t.patch
Applied to master, thanks. Your patch has been merged upstream, on February 10, and upstream has released a new version 1.12.5 on February
16. There are some chances that bumping to 1.12.5 would allow to drop this patch.
Thanks!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
PATCH 1/1 package/ogre: fix build with RELRO
Quoted 5 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Thomas" == Thomas Petazzoni <[email protected]> writes:
On Mon, 10 Feb 2020 18:45:11 +0100
Fabrice Fontaine <[email protected]> wrote:
Quoted 8 lines
Quoted 8 lines
Fixes:
- http://autobuild.buildroot.org/results/b64dfcd8e576666e8a4a52da81a2f5a92b779dc7Signed-off-by Fabrice Fontaine <[email protected]>---
...ompiledHeader.cmake-Add-c-argument-t.patch | 57 +++++++++++++++++++1 file changed, 57 insertions(+)create mode 100644
package/ogre/0001-CMake-Utils-PrecompiledHeader.cmake-Add-c-argument-t.patch
Committed to 2020.02.x, thanks.
Signature · 1 line
Bye, Peter Korsgaard