Skip to contentSkip to conversation

Revert "package/supertux: fix build with RELRO"

PATCH New Romain Naour 2 participants 6 messages Oct 3, 2020 – Oct 10, 2020

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/2 Revert "package/supertux: fix build with RELRO"

From: Fabrice Fontaine <[email protected]>

This reverts commit 80be040817e008a021219bf4423df7550723d912 because libsquirrel.so.0 and libsqstdlib.so.0 are missing in TARGET_DIR.

---
 ...ass-DISABLE_STATIC-to-external-squir.patch | 52 -------------------
 1 file changed, 52 deletions(-)
 delete mode 100644 package/supertux/0001-CMakeLists.txt-pass-DISABLE_STATIC-to-external-squir.patch
package/supertux/0001-CMakeLists.txt-pass-DISABLE_STATIC-to-external-squir.patch deleted +0 -52
deleted file mode 100644
index 43652d0906..0000000000
@@ -1,52 +0,0 @@
-From 95590485d7cd95611eeac1fc06226d45f235c63a Mon Sep 17 00:00:00 2001
-From: Fabrice Fontaine <[email protected]>
-Date: Sun, 13 Sep 2020 22:09:49 +0200
-Subject: [PATCH] CMakeLists.txt: pass DISABLE_STATIC to external/squirrel
-
-external/squirrel will always build a static binary and library except
-if DISABLE_STATIC is defined so define it to avoid the following build
-failure with RELRO_FULL:
-
-/home/peko/autobuild/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/x86_64-buildroot-linux-musl/8.3.0/../../../../x86_64-buildroot-linux-musl/bin/ld: CMakeFiles/sq_static.dir/sq.c.o: relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a PIE object; recompile with -fPIC
-/home/peko/autobuild/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/x86_64-buildroot-linux-musl/8.3.0/../../../../x86_64-buildroot-linux-musl/bin/ld: final link failed: nonrepresentable section on output
-collect2: error: ld returned 1 exit status
-
-Fixes:
- - http://autobuild.buildroot.org/results/46e8f5e622ce450a89bc6d70f4bfd38182557901
- - http://autobuild.buildroot.org/results/a43720492d817e4555d728546da9114e3ccba952
-
-Signed-off-by: Fabrice Fontaine <[email protected]>
----
- CMakeLists.txt | 9 +++++----
- 1 file changed, 5 insertions(+), 4 deletions(-)
-
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 1ae0d653b..bb4358b01 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -411,6 +411,7 @@ ExternalProject_Add(squirrel
-   -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
-   -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
-   -DCMAKE_INSTALL_PREFIX=${SQUIRREL_PREFIX}
-+  -DDISABLE_STATIC=ON
-   -DINSTALL_INC_DIR=include)
- 
- if(WIN32)
-@@ -424,10 +425,10 @@ if(WIN32)
-   #For debug run purposes
-   configure_file("${CMAKE_CURRENT_SOURCE_DIR}/mk/msvc/run_supertux.bat.in" "${PROJECT_BINARY_DIR}/run_supertux.bat")
- else()
--  add_library(squirrel_lib STATIC IMPORTED)
--  set_target_properties(squirrel_lib PROPERTIES IMPORTED_LOCATION "${SQUIRREL_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}squirrel_static${CMAKE_STATIC_LIBRARY_SUFFIX}")
--  add_library(sqstdlib_lib STATIC IMPORTED)
--  set_target_properties(sqstdlib_lib PROPERTIES IMPORTED_LOCATION "${SQUIRREL_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}sqstdlib_static${CMAKE_STATIC_LIBRARY_SUFFIX}")
-+  add_library(squirrel_lib SHARED IMPORTED)
-+  set_target_properties(squirrel_lib PROPERTIES IMPORTED_LOCATION "${SQUIRREL_PREFIX}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}squirrel${CMAKE_SHARED_LIBRARY_SUFFIX}")
-+  add_library(sqstdlib_lib SHARED IMPORTED)
-+  set_target_properties(sqstdlib_lib PROPERTIES IMPORTED_LOCATION "${SQUIRREL_PREFIX}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}sqstdlib${CMAKE_SHARED_LIBRARY_SUFFIX}")
- endif()
- 
- include_directories(SYSTEM ${SQUIRREL_PREFIX}/include)
--- 
-2.28.0
-
Signature · 1 line
2.25.4
#1 lore raw

PATCH v2 2/2 package/supertux: build squirrel builtin library with fPIC

Ensure that squirrel is compiled with -fPIC to allow linking the static libraries with dynamically linked programs. This is not a requirement for most architectures but is mandatory for ARM.

Fixes:
http://autobuild.buildroot.org/results/46e8f5e622ce450a89bc6d70f4bfd38182557901
http://autobuild.buildroot.org/results/a43720492d817e4555d728546da9114e3ccba952

Cc Fabrice Fontaine <[email protected]>
---
 ...Lists.txt-compile-squirrel-with-fPIC.patch | 35 +++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 package/supertux/0001-CMakeLists.txt-compile-squirrel-with-fPIC.patch
package/supertux/0001-CMakeLists.txt-compile-squirrel-with-fPIC.patch new file +35 -0
new file mode 100644
index 0000000000..9fac20a3f8
@@ -0,0 +1,35 @@
+From 23d0bb0ef0fde52d1cffe235edead09287326fb4 Mon Sep 17 00:00:00 2001
+From: Romain Naour <[email protected]>
+Date: Sun, 4 Oct 2020 01:11:30 +0200
+Subject: [PATCH] CMakeLists.txt: compile squirrel with -fPIC
+
+Ensure that squirrel is compiled with -fPIC to allow linking the static
+libraries with dynamically linked programs. This is not a requirement
+for most architectures but is mandatory for ARM.
+
+Fixes:
+x86_64-buildroot-linux-musl/bin/ld: CMakeFiles/sq_static.dir/sq.c.o: relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a PIE object; recompile with -fPIC
+x86_64-buildroot-linux-musl/bin/ld: final link failed: nonrepresentable section on output
+
+Signed-off-by: Romain Naour <[email protected]>
+---
+ CMakeLists.txt | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 8b1dafa1e..07c603cce 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -412,7 +412,8 @@ ExternalProject_Add(squirrel
+   -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
+   -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
+   -DCMAKE_INSTALL_PREFIX=${SQUIRREL_PREFIX}
+-  -DINSTALL_INC_DIR=include)
++  -DINSTALL_INC_DIR=include
++  -DCMAKE_POSITION_INDEPENDENT_CODE=ON)
+ 
+ if(WIN32)
+   add_library(squirrel_lib SHARED IMPORTED)
+-- 
+2.25.4
+
Signature · 1 line
2.25.4
#4 lore raw

PATCH v2 1/2 Revert "package/supertux: fix build with RELRO"

In reply to Romain Naour
Quoted 8 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Romain" == Romain Naour <[email protected]> writes:

From: Fabrice Fontaine <[email protected]>
This reverts commit 80be040817e008a021219bf4423df7550723d912 because libsquirrel.so.0 and libsqstdlib.so.0 are missing in TARGET_DIR.

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard
#2 lore raw

PATCH v2 2/2 package/supertux: build squirrel builtin library with fPIC

In reply to Romain Naour
Quoted 6 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Romain" == Romain Naour <[email protected]> writes:

Ensure that squirrel is compiled with -fPIC to allow linking the static libraries with dynamically linked programs. This is not a requirement for most architectures but is mandatory for ARM.

Quoted 6 lines

Fixes:
http://autobuild.buildroot.org/results/46e8f5e622ce450a89bc6d70f4bfd38182557901
http://autobuild.buildroot.org/results/a43720492d817e4555d728546da9114e3ccba952

Cc Fabrice Fontaine <[email protected]>

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard
#5 lore raw

PATCH v2 1/2 Revert "package/supertux: fix build with RELRO"

In reply to Romain Naour
Quoted 8 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Romain" == Romain Naour <[email protected]> writes:

From: Fabrice Fontaine <[email protected]>
This reverts commit 80be040817e008a021219bf4423df7550723d912 because libsquirrel.so.0 and libsqstdlib.so.0 are missing in TARGET_DIR.

Committed to 2020.02.x, 2020.05.x and 2020.08.x, thanks.

Signature · 1 line
Bye, Peter Korsgaard
#3 lore raw

PATCH v2 2/2 package/supertux: build squirrel builtin library with fPIC

In reply to Romain Naour
Quoted 6 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Romain" == Romain Naour <[email protected]> writes:

Ensure that squirrel is compiled with -fPIC to allow linking the static libraries with dynamically linked programs. This is not a requirement for most architectures but is mandatory for ARM.

Quoted 6 lines

Fixes:
http://autobuild.buildroot.org/results/46e8f5e622ce450a89bc6d70f4bfd38182557901
http://autobuild.buildroot.org/results/a43720492d817e4555d728546da9114e3ccba952

Cc Fabrice Fontaine <[email protected]>

Committed to 2020.02.x, 2020.05.x and 2020.08.x, thanks.

Signature · 1 line
Bye, Peter Korsgaard