summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarlos Rafael Giani <crg7475@mailbox.org>2022-03-29 09:51:01 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-04-05 22:24:33 +0100
commitee994c89b68925ad2297b01a840c8ead8ef4a55d (patch)
treed12d27967a9c38aa91bdaebd940e1a0eef6f254b
parent91d6c0346487eefddc0b5355e2c5c77c580a33d1 (diff)
downloadpoky-ee994c89b68925ad2297b01a840c8ead8ef4a55d.tar.gz
libsdl2: Disable libunwind dependency in native builds
libunwind-native currently cannot be added to the class-native DEPENDS due to the following problem: https://autobuilder.yoctoproject.org/typhoon/#/builders/91/builds/5624/steps/12/logs/stdio And without libunwind-native, libsdl2-native config fails errors like: | -- Checking for one of the modules 'libunwind' | CMake Error at [...]/build/tmp/work/x86_64-linux/libsdl2-native/2.0.20-r0/recipe-sysroot-native/usr/share/cmake-3.22/Modules/FindPkgConfig.cmake:890 (message): | None of the required 'libunwind' found | Call Stack (most recent call first): | CMakeLists.txt:1367 (pkg_search_module) Ideally, the libunwind issue would be fixed, and then this could be added to the libsdl2 recipe: DEPENDS:append:class-native = " libunwind-native" However, the libunwind problem is not trivial to fix, and requires a specific setup to reproduce. As an alternative workaround, turn off libunwind support in the native SDL2 build by disabling the unwind.h check in the CMake script (this subsequently turns off all the other libunwind checks). The main user of libsdl2-native is qemu-native, which does not need libunwind support in SDL2. (From OE-Core rev: ecd044b09f8715353cbf20b39ce2b1fe9e620631) Signed-off-by: Carlos Rafael Giani <crg7475@mailbox.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-graphics/libsdl2/libsdl2/0001-Disable-libunwind-in-native-OE-builds-by-not-looking.patch38
-rw-r--r--meta/recipes-graphics/libsdl2/libsdl2_2.0.20.bb1
2 files changed, 39 insertions, 0 deletions
diff --git a/meta/recipes-graphics/libsdl2/libsdl2/0001-Disable-libunwind-in-native-OE-builds-by-not-looking.patch b/meta/recipes-graphics/libsdl2/libsdl2/0001-Disable-libunwind-in-native-OE-builds-by-not-looking.patch
new file mode 100644
index 0000000000..214664f621
--- /dev/null
+++ b/meta/recipes-graphics/libsdl2/libsdl2/0001-Disable-libunwind-in-native-OE-builds-by-not-looking.patch
@@ -0,0 +1,38 @@
1From 50c691e83f81b235bb96ef996dd4568ffaae256f Mon Sep 17 00:00:00 2001
2From: Carlos Rafael Giani <crg7475@mailbox.org>
3Date: Fri, 18 Mar 2022 12:06:23 +0100
4Subject: [PATCH] Disable libunwind in native OE builds by not looking for
5 libunwind
6
7This is a workaround for this build error:
8
9| -- Checking for one of the modules 'libunwind'
10| CMake Error at [...]/build/tmp/work/x86_64-linux/libsdl2-native/2.0.20-r0/recipe-sysroot-native/usr/share/cmake-3.22/Modules/FindPkgConfig.cmake:890 (message):
11| None of the required 'libunwind' found
12| Call Stack (most recent call first):
13| CMakeLists.txt:1367 (pkg_search_module)
14
15By not looking for the libunwind header, the rest of the libunwind
16specific bits in the CMake build script are disabled.
17
18Upstream-Status: Inappropriate [OE specific]
19---
20 CMakeLists.txt | 2 +-
21 1 file changed, 1 insertion(+), 1 deletion(-)
22
23diff --git a/CMakeLists.txt b/CMakeLists.txt
24index 64f9fbf..12a4d8f 100644
25--- a/CMakeLists.txt
26+++ b/CMakeLists.txt
27@@ -862,7 +862,7 @@ if(SDL_LIBC)
28 check_include_file(sys/types.h HAVE_SYS_TYPES_H)
29 foreach(_HEADER
30 stdio.h stdlib.h stddef.h stdarg.h malloc.h memory.h string.h limits.h float.h
31- strings.h wchar.h inttypes.h stdint.h ctype.h math.h iconv.h signal.h libunwind.h)
32+ strings.h wchar.h inttypes.h stdint.h ctype.h math.h iconv.h signal.h)
33 string(TOUPPER "HAVE_${_HEADER}" _UPPER)
34 string(REPLACE "." "_" _HAVE_H ${_UPPER})
35 check_include_file("${_HEADER}" ${_HAVE_H})
36--
372.32.0
38
diff --git a/meta/recipes-graphics/libsdl2/libsdl2_2.0.20.bb b/meta/recipes-graphics/libsdl2/libsdl2_2.0.20.bb
index 58bc94cc86..4ba22c1fe6 100644
--- a/meta/recipes-graphics/libsdl2/libsdl2_2.0.20.bb
+++ b/meta/recipes-graphics/libsdl2/libsdl2_2.0.20.bb
@@ -20,6 +20,7 @@ SRC_URI = "http://www.libsdl.org/release/SDL2-${PV}.tar.gz \
20 file://optional-libunwind-generic.patch \ 20 file://optional-libunwind-generic.patch \
21 file://0001-sdlchecks.cmake-pass-cflags-to-the-appropriate-cmake.patch \ 21 file://0001-sdlchecks.cmake-pass-cflags-to-the-appropriate-cmake.patch \
22 " 22 "
23SRC_URI:append:class-native = " file://0001-Disable-libunwind-in-native-OE-builds-by-not-looking.patch"
23 24
24S = "${WORKDIR}/SDL2-${PV}" 25S = "${WORKDIR}/SDL2-${PV}"
25 26