Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/rpi-userland: fix libexecinfo workaround
@ 2022-06-08 19:11 Fabrice Fontaine
  2022-06-09 20:32 ` Thomas Petazzoni via buildroot
  2022-06-19 13:05 ` Peter Korsgaard
  0 siblings, 2 replies; 3+ messages in thread
From: Fabrice Fontaine @ 2022-06-08 19:11 UTC (permalink / raw)
  To: buildroot; +Cc: Mahyar Koshkouei, Fabrice Fontaine

Fix libexecinfo workaround to avoid the following ffmpeg build failure
with BR2_PACKAGE_RPI_USERLAND raised on uclibc and musl since commit
bc4cc27705de50356d7e9945e41bd989fdc56fe8:

/home/giuliobenetti/autobuild/run/instance-3/output-1/host/bin/arm-linux-gcc --sysroot=/home/giuliobenetti/autobuild/run/instance-3/output-1/host/arm-buildroot-linux-uclibcgnueabi/sysroot -mcpu=arm926ej-s -Wl,--as-needed -Wl,-z,noexecstack -o /tmp/ffconf.5K0cMIh3/test /tmp/ffconf.5K0cMIh3/test.o -lmmal_core -lmmal_util -lmmal_vc_client -lbcm_host -latomic
/home/giuliobenetti/autobuild/run/instance-3/output-1/host/opt/ext-toolchain/bin/../lib/gcc/arm-buildroot-linux-uclibcgnueabi/10.3.0/../../../../arm-buildroot-linux-uclibcgnueabi/bin/ld: /home/giuliobenetti/autobuild/run/instance-3/output-1/host/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib/libvcos.so: undefined reference to `backtrace_symbols'

[...]

ERROR: mmal not found

Fixes:
 - http://autobuild.buildroot.org/results/64d21872d25fef35b72106133ed2aed300f52f2f

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 ...on-t-override-CMAKE_EXE_LINKER_FLAGS.patch | 58 -------------------
 ...threads-CMakeLists.txt-fix-build-wit.patch | 45 ++++++++++++++
 package/rpi-userland/rpi-userland.mk          |  1 -
 3 files changed, 45 insertions(+), 59 deletions(-)
 delete mode 100644 package/rpi-userland/0006-don-t-override-CMAKE_EXE_LINKER_FLAGS.patch
 create mode 100644 package/rpi-userland/0006-interface-vcos-pthreads-CMakeLists.txt-fix-build-wit.patch

diff --git a/package/rpi-userland/0006-don-t-override-CMAKE_EXE_LINKER_FLAGS.patch b/package/rpi-userland/0006-don-t-override-CMAKE_EXE_LINKER_FLAGS.patch
deleted file mode 100644
index bf2a9eb6ea..0000000000
--- a/package/rpi-userland/0006-don-t-override-CMAKE_EXE_LINKER_FLAGS.patch
+++ /dev/null
@@ -1,58 +0,0 @@
-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
-
diff --git a/package/rpi-userland/0006-interface-vcos-pthreads-CMakeLists.txt-fix-build-wit.patch b/package/rpi-userland/0006-interface-vcos-pthreads-CMakeLists.txt-fix-build-wit.patch
new file mode 100644
index 0000000000..e799c82418
--- /dev/null
+++ b/package/rpi-userland/0006-interface-vcos-pthreads-CMakeLists.txt-fix-build-wit.patch
@@ -0,0 +1,45 @@
+From 220c37b496f5c883bbfa955ee7fee471e41c34d4 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] interface/vcos/pthreads/CMakeLists.txt: fix build with
+ libexecinfo
+
+interface/vcos/glibc/vcos_backtrace.c uses execinfo.h which can be
+provided by libexecinfo on uclibc or musl so link with it if needed to
+avoid the following build failure:
+
+/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>
+[Upstream status: https://github.com/raspberrypi/userland/pull/719]
+---
+ interface/vcos/pthreads/CMakeLists.txt | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/interface/vcos/pthreads/CMakeLists.txt b/interface/vcos/pthreads/CMakeLists.txt
+index 1d81ca3..43aca03 100644
+--- a/interface/vcos/pthreads/CMakeLists.txt
++++ b/interface/vcos/pthreads/CMakeLists.txt
+@@ -33,12 +33,14 @@ set (SOURCES
+    ../generic/vcos_generic_blockpool.c
+ )
+ 
++find_library (EXECINFO_LIBRARY execinfo)
++
+ if (VCOS_PTHREADS_BUILD_SHARED)
+    add_library (vcos SHARED ${SOURCES})
+-   target_link_libraries (vcos pthread dl rt)
++   target_link_libraries (vcos pthread dl rt ${EXECINFO_LIBRARY})
+ else ()
+    add_library (vcos ${SOURCES})
+-   target_link_libraries (vcos pthread rt)
++   target_link_libraries (vcos pthread rt ${EXECINFO_LIBRARY})
+ endif ()
+ 
+ 
+-- 
+2.35.1
+
diff --git a/package/rpi-userland/rpi-userland.mk b/package/rpi-userland/rpi-userland.mk
index 3564ec0703..1204196e19 100644
--- a/package/rpi-userland/rpi-userland.mk
+++ b/package/rpi-userland/rpi-userland.mk
@@ -15,7 +15,6 @@ RPI_USERLAND_PROVIDES = libegl libgles libopenmax libopenvg
 
 ifeq ($(BR2_PACKAGE_LIBEXECINFO),y)
 RPI_USERLAND_DEPENDENCIES += libexecinfo
-RPI_USERLAND_CONF_OPTS += -DCMAKE_EXE_LINKER_FLAGS=-lexecinfo
 endif
 
 ifeq ($(BR2_PACKAGE_RPI_USERLAND_HELLO),y)
-- 
2.35.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Buildroot] [PATCH 1/1] package/rpi-userland: fix libexecinfo workaround
  2022-06-08 19:11 [Buildroot] [PATCH 1/1] package/rpi-userland: fix libexecinfo workaround Fabrice Fontaine
@ 2022-06-09 20:32 ` Thomas Petazzoni via buildroot
  2022-06-19 13:05 ` Peter Korsgaard
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Petazzoni via buildroot @ 2022-06-09 20:32 UTC (permalink / raw)
  To: Fabrice Fontaine; +Cc: Mahyar Koshkouei, buildroot

On Wed,  8 Jun 2022 21:11:37 +0200
Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:

> Fix libexecinfo workaround to avoid the following ffmpeg build failure
> with BR2_PACKAGE_RPI_USERLAND raised on uclibc and musl since commit
> bc4cc27705de50356d7e9945e41bd989fdc56fe8:
> 
> /home/giuliobenetti/autobuild/run/instance-3/output-1/host/bin/arm-linux-gcc --sysroot=/home/giuliobenetti/autobuild/run/instance-3/output-1/host/arm-buildroot-linux-uclibcgnueabi/sysroot -mcpu=arm926ej-s -Wl,--as-needed -Wl,-z,noexecstack -o /tmp/ffconf.5K0cMIh3/test /tmp/ffconf.5K0cMIh3/test.o -lmmal_core -lmmal_util -lmmal_vc_client -lbcm_host -latomic
> /home/giuliobenetti/autobuild/run/instance-3/output-1/host/opt/ext-toolchain/bin/../lib/gcc/arm-buildroot-linux-uclibcgnueabi/10.3.0/../../../../arm-buildroot-linux-uclibcgnueabi/bin/ld: /home/giuliobenetti/autobuild/run/instance-3/output-1/host/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib/libvcos.so: undefined reference to `backtrace_symbols'
> 
> [...]
> 
> ERROR: mmal not found
> 
> Fixes:
>  - http://autobuild.buildroot.org/results/64d21872d25fef35b72106133ed2aed300f52f2f
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> ---
>  ...on-t-override-CMAKE_EXE_LINKER_FLAGS.patch | 58 -------------------
>  ...threads-CMakeLists.txt-fix-build-wit.patch | 45 ++++++++++++++
>  package/rpi-userland/rpi-userland.mk          |  1 -
>  3 files changed, 45 insertions(+), 59 deletions(-)
>  delete mode 100644 package/rpi-userland/0006-don-t-override-CMAKE_EXE_LINKER_FLAGS.patch
>  create mode 100644 package/rpi-userland/0006-interface-vcos-pthreads-CMakeLists.txt-fix-build-wit.patch

Applied to master, thanks.

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Buildroot] [PATCH 1/1] package/rpi-userland: fix libexecinfo workaround
  2022-06-08 19:11 [Buildroot] [PATCH 1/1] package/rpi-userland: fix libexecinfo workaround Fabrice Fontaine
  2022-06-09 20:32 ` Thomas Petazzoni via buildroot
@ 2022-06-19 13:05 ` Peter Korsgaard
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2022-06-19 13:05 UTC (permalink / raw)
  To: Fabrice Fontaine; +Cc: Mahyar Koshkouei, buildroot

>>>>> "Fabrice" == Fabrice Fontaine <fontaine.fabrice@gmail.com> writes:

 > Fix libexecinfo workaround to avoid the following ffmpeg build failure
 > with BR2_PACKAGE_RPI_USERLAND raised on uclibc and musl since commit
 > bc4cc27705de50356d7e9945e41bd989fdc56fe8:

 > /home/giuliobenetti/autobuild/run/instance-3/output-1/host/bin/arm-linux-gcc
 > --sysroot=/home/giuliobenetti/autobuild/run/instance-3/output-1/host/arm-buildroot-linux-uclibcgnueabi/sysroot
 > -mcpu=arm926ej-s -Wl,--as-needed -Wl,-z,noexecstack -o
 > /tmp/ffconf.5K0cMIh3/test /tmp/ffconf.5K0cMIh3/test.o -lmmal_core
 > -lmmal_util -lmmal_vc_client -lbcm_host -latomic
 > /home/giuliobenetti/autobuild/run/instance-3/output-1/host/opt/ext-toolchain/bin/../lib/gcc/arm-buildroot-linux-uclibcgnueabi/10.3.0/../../../../arm-buildroot-linux-uclibcgnueabi/bin/ld:
 > /home/giuliobenetti/autobuild/run/instance-3/output-1/host/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib/libvcos.so:
 > undefined reference to `backtrace_symbols'

 > [...]

 > ERROR: mmal not found

 > Fixes:
 >  - http://autobuild.buildroot.org/results/64d21872d25fef35b72106133ed2aed300f52f2f

 > Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>

Committed to 2022.05.x and 2022.02.x, thanks.

-- 
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-06-19 13:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-08 19:11 [Buildroot] [PATCH 1/1] package/rpi-userland: fix libexecinfo workaround Fabrice Fontaine
2022-06-09 20:32 ` Thomas Petazzoni via buildroot
2022-06-19 13:05 ` Peter Korsgaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox