kumquat-buildroot/package/rpi-userland/0006-don-t-override-CMAKE_EXE_LINKER_FLAGS.patch
Fabrice Fontaine bc4cc27705 package/rpi-userland: fix build with libexecinfo
Fix the following build failure raised on uclibc and musl since the
addition of libexecinfo package in commit
eea8ba446c:

/home/peko/autobuild/instance-1/output-1/host/opt/ext-toolchain/bin/../lib/gcc/arm-buildroot-linux-uclibcgnueabi/10.3.0/../../../../arm-buildroot-linux-uclibcgnueabi/bin/ld: ../../build/lib/libvcos.so: undefined reference to `backtrace_symbols'

Fixes:
 - http://autobuild.buildroot.org/results/93d3b8cc2ac5dfa9d4b44946c0b4d8171e8f52a1

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
2022-03-14 13:17:40 +01:00

59 lines
3.1 KiB
Diff

From 87febf8b7b1c0a6d0ea1d26770d3665008d66fd2 Mon Sep 17 00:00:00 2001
From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Date: Fri, 25 Feb 2022 19:21:06 +0100
Subject: [PATCH] don't override CMAKE_EXE_LINKER_FLAGS
Don't override CMAKE_EXE_LINKER_FLAGS as it could be used by the user to
pass additional flags such as -lexecinfo on musl and uclibc-ng
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
[Upstream status: https://github.com/raspberrypi/userland/pull/719]
---
host_applications/android/apps/vidtex/CMakeLists.txt | 2 +-
host_applications/linux/apps/raspicam/CMakeLists.txt | 2 +-
makefiles/cmake/arm-linux.cmake | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/host_applications/android/apps/vidtex/CMakeLists.txt b/host_applications/android/apps/vidtex/CMakeLists.txt
index e7206cc..16c64db 100644
--- a/host_applications/android/apps/vidtex/CMakeLists.txt
+++ b/host_applications/android/apps/vidtex/CMakeLists.txt
@@ -5,7 +5,7 @@ SET(COMPILE_DEFINITIONS -Werror -Wall)
# Set --no-as-needed to stop the linker discarding mmal_vc_client
# as it can't see that the constructor registers a load of functionality
# with the MMAL core.
-SET( CMAKE_EXE_LINKER_FLAGS "-Wl,--no-as-needed" )
+SET( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--no-as-needed" )
include_directories(${PROJECT_SOURCE_DIR}/host_applications/linux/libs/bcm_host/include)
diff --git a/host_applications/linux/apps/raspicam/CMakeLists.txt b/host_applications/linux/apps/raspicam/CMakeLists.txt
index e6bd373..2f72eb2 100644
--- a/host_applications/linux/apps/raspicam/CMakeLists.txt
+++ b/host_applications/linux/apps/raspicam/CMakeLists.txt
@@ -6,7 +6,7 @@ SET(COMPILE_DEFINITIONS -Werror)
# Set --no-as-needed to stop the linker discarding mmal_vc_client
# as it can't see that the constructor registers a load of functionality
# with the MMAL core.
-SET( CMAKE_EXE_LINKER_FLAGS "-Wl,--no-as-needed" )
+SET( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--no-as-needed" )
include_directories(${PROJECT_SOURCE_DIR}/host_applications/linux/libs/bcm_host/include)
include_directories(${PROJECT_SOURCE_DIR}/host_applications/linux/apps/raspicam/)
diff --git a/makefiles/cmake/arm-linux.cmake b/makefiles/cmake/arm-linux.cmake
index 957846a..e172282 100644
--- a/makefiles/cmake/arm-linux.cmake
+++ b/makefiles/cmake/arm-linux.cmake
@@ -93,7 +93,7 @@ if(ANDROID)
set(CMAKE_SHARED_LINKER_FLAGS "-nostdlib ${ANDROID_CRTBEGIN} -Wl,-Bdynamic -Wl,-T${ANDROID_LDSCRIPTS}/armelf.x")
link_directories(${ANDROID_LIBS})
- set(CMAKE_EXE_LINKER_FLAGS "-nostdlib ${ANDROID_CRTBEGIN} -nostdlib -Wl,-z,noexecstack")
+ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -nostdlib ${ANDROID_CRTBEGIN} -nostdlib -Wl,-z,noexecstack")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-dynamic-linker,/system/bin/linker -Wl,-rpath,${CMAKE_INSTALL_PREFIX}/lib")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-T${ANDROID_LDSCRIPTS}/armelf.x -Wl,--gc-sections")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-z,nocopyreloc -Wl,-z,noexecstack -Wl,--fix-cortex-a8 -Wl,--no-undefined")
--
2.34.1