Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1 | From 89ac299e0d9436f1effaa07711458d616574cc8f Mon Sep 17 00:00:00 2001 |
Patrick Williams | 03907ee | 2022-05-01 06:28:52 -0500 | [diff] [blame] | 2 | From: Alexander Kanavin <alex@linutronix.de> |
| 3 | Date: Mon, 4 Apr 2022 21:20:05 +0200 |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 4 | Subject: [PATCH] Propagate CFLAGS to introspection targets |
Patrick Williams | 03907ee | 2022-05-01 06:28:52 -0500 | [diff] [blame] | 5 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 6 | Otherwise, important things do not get passed to the compiler in cross compiling with a sysroot scenario: |
Patrick Williams | 03907ee | 2022-05-01 06:28:52 -0500 | [diff] [blame] | 7 | |
| 8 | In file included from /srv/work/alex/poky/build-64-alt/tmp/work/core2-64-poky-linux/webkitgtk/2.36.0-r0/recipe-sysroot-native/usr/lib/x86_64-poky-linux/gcc/x86_64-poky-linux/11.2.0/include-fixed/syslimits.h:7, |
| 9 | from /srv/work/alex/poky/build-64-alt/tmp/work/core2-64-poky-linux/webkitgtk/2.36.0-r0/recipe-sysroot-native/usr/lib/x86_64-poky-linux/gcc/x86_64-poky-linux/11.2.0/include-fixed/limits.h:34, |
| 10 | from /srv/work/alex/poky/build-64-alt/tmp/work/core2-64-poky-linux/webkitgtk/2.36.0-r0/recipe-sysroot/usr/lib/glib-2.0/include/glibconfig.h:11, |
| 11 | from /srv/work/alex/poky/build-64-alt/tmp/work/core2-64-poky-linux/webkitgtk/2.36.0-r0/recipe-sysroot/usr/include/glib-2.0/glib/gtypes.h:32, |
| 12 | from /srv/work/alex/poky/build-64-alt/tmp/work/core2-64-poky-linux/webkitgtk/2.36.0-r0/recipe-sysroot/usr/include/glib-2.0/glib/galloca.h:32, |
| 13 | from /srv/work/alex/poky/build-64-alt/tmp/work/core2-64-poky-linux/webkitgtk/2.36.0-r0/recipe-sysroot/usr/include/glib-2.0/glib.h:30, |
| 14 | from /srv/work/alex/poky/build-64-alt/tmp/work/core2-64-poky-linux/webkitgtk/2.36.0-r0/build/Source/JavaScriptCore/tmp-introspectb51ks33n/JavaScriptCore-4.0.c:2: |
| 15 | /srv/work/alex/poky/build-64-alt/tmp/work/core2-64-poky-linux/webkitgtk/2.36.0-r0/recipe-sysroot-native/usr/lib/x86_64-poky-linux/gcc/x86_64-poky-linux/11.2.0/include-fixed/limits.h:203:75: error: no include path in which to search for limits.h |
| 16 | 203 | #include_next <limits.h> /* recurse down to the real one */ |
| 17 | | ^ |
| 18 | In file included from /srv/work/alex/poky/build-64-alt/tmp/work/core2-64-poky-linux/webkitgtk/2.36.0-r0/recipe-sysroot/usr/include/glib-2.0/glib/galloca.h:32, |
| 19 | from /srv/work/alex/poky/build-64-alt/tmp/work/core2-64-poky-linux/webkitgtk/2.36.0-r0/recipe-sysroot/usr/include/glib-2.0/glib.h:30, |
| 20 | from /srv/work/alex/poky/build-64-alt/tmp/work/core2-64-poky-linux/webkitgtk/2.36.0-r0/build/Source/JavaScriptCore/tmp-introspectb51ks33n/JavaScriptCore-4.0.c:2: |
| 21 | /srv/work/alex/poky/build-64-alt/tmp/work/core2-64-poky-linux/webkitgtk/2.36.0-r0/recipe-sysroot/usr/include/glib-2.0/glib/gtypes.h:35:10: fatal error: time.h: No such file or directory |
| 22 | 35 | #include <time.h> |
| 23 | | ^~~~~~~~ |
| 24 | compilation terminated. |
| 25 | Traceback (most recent call last): |
| 26 | File "/srv/work/alex/poky/build-64-alt/tmp/work/core2-64-poky-linux/webkitgtk/2.36.0-r0/recipe-sysroot-native/usr/lib/python3.10/distutils/unixccompiler.py", line 117, in _compile |
| 27 | self.spawn(compiler_so + cc_args + [src, '-o', obj] + |
| 28 | File "/srv/work/alex/poky/build-64-alt/tmp/work/core2-64-poky-linux/webkitgtk/2.36.0-r0/recipe-sysroot-native/usr/lib/python3.10/distutils/ccompiler.py", line 910, in spawn |
| 29 | spawn(cmd, dry_run=self.dry_run) |
| 30 | File "/srv/work/alex/poky/build-64-alt/tmp/work/core2-64-poky-linux/webkitgtk/2.36.0-r0/recipe-sysroot-native/usr/lib/python3.10/distutils/spawn.py", line 91, in spawn |
| 31 | raise DistutilsExecError( |
| 32 | distutils.errors.DistutilsExecError: command '/srv/work/alex/poky/build-64-alt/tmp/work/core2-64-poky-linux/webkitgtk/2.36.0-r0/recipe-sysroot-native/usr/bin/x86_64-poky-linux/x86_64-poky-linux-gcc' failed with exit code 1 |
| 33 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 34 | Upstream-Status: Pending |
| 35 | Signed-off-by: Alexander Kanavin <alex@linutronix.de> |
| 36 | |
| 37 | |
Patrick Williams | 03907ee | 2022-05-01 06:28:52 -0500 | [diff] [blame] | 38 | Signed-off-by: Alexander Kanavin <alex@linutronix.de> |
| 39 | --- |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 40 | Source/cmake/FindGI.cmake | 2 +- |
| 41 | 1 file changed, 1 insertion(+), 1 deletion(-) |
Patrick Williams | 03907ee | 2022-05-01 06:28:52 -0500 | [diff] [blame] | 42 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 43 | diff --git a/Source/cmake/FindGI.cmake b/Source/cmake/FindGI.cmake |
| 44 | index b3e810cd..e22a75f7 100644 |
| 45 | --- a/Source/cmake/FindGI.cmake |
| 46 | +++ b/Source/cmake/FindGI.cmake |
| 47 | @@ -340,7 +340,7 @@ function(GI_INTROSPECT namespace nsversion header) |
| 48 | DEPENDS ${gir_deps} ${gir_srcs} |
| 49 | VERBATIM |
| 50 | COMMAND_EXPAND_LISTS |
| 51 | - COMMAND ${CMAKE_COMMAND} -E env "CC=${CMAKE_C_COMPILER}" |
| 52 | + COMMAND ${CMAKE_COMMAND} -E env "CC=${CMAKE_C_COMPILER}" "CFLAGS=${CMAKE_C_FLAGS}" |
| 53 | "${GI_SCANNER_EXE}" --quiet --warn-all --warn-error --no-libtool |
| 54 | "--output=${gir_path}" |
| 55 | "--library=$<TARGET_FILE_BASE_NAME:${opt_TARGET}>" |