diff options
| author | Johannes Schneider <johannes.schneider@leica-geosystems.com> | 2024-06-20 13:51:26 +0200 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-06-25 11:50:58 +0100 |
| commit | a9138c1f51b11efc82bc593d754585f5c440d017 (patch) | |
| tree | d504e97b8079d2c1d525d3f6d12024afd8a6bdcd | |
| parent | 182e599dbce552a6f0b3d014854fb570d74adc5d (diff) | |
| download | poky-a9138c1f51b11efc82bc593d754585f5c440d017.tar.gz | |
systemd: bpf-framework: 'propagate' the '--sysroot=' for crosscompilation
The eBPFs are pre-compiled during the systemd-build with a different
compiler than the cross-compiler used to build systemd itself.
This is either a 'clang-native' or a gcc (bpf-unknown-none) which do
not see the BUILD_CFLAGS, that point to the correct include search
patch. To address this have systemd's meson.build "propagate" the
--system from the C_FLAGS into the BPF compiler call.
(From OE-Core rev: 3a4d5b06f8e4ebf7b4738a99fe6b352bb03a64ae)
Signed-off-by: Johannes Schneider <johannes.schneider@leica-geosystems.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | meta/recipes-core/systemd/systemd/0023-meson-bpf-propagate-sysroot-for-cross-compilation.patch | 31 | ||||
| -rw-r--r-- | meta/recipes-core/systemd/systemd_255.6.bb | 1 |
2 files changed, 32 insertions, 0 deletions
diff --git a/meta/recipes-core/systemd/systemd/0023-meson-bpf-propagate-sysroot-for-cross-compilation.patch b/meta/recipes-core/systemd/systemd/0023-meson-bpf-propagate-sysroot-for-cross-compilation.patch new file mode 100644 index 0000000000..5be4a27b36 --- /dev/null +++ b/meta/recipes-core/systemd/systemd/0023-meson-bpf-propagate-sysroot-for-cross-compilation.patch | |||
| @@ -0,0 +1,31 @@ | |||
| 1 | From 7463b382bcaf26aacc60b73f98f0262aa41db3ee Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Johannes Schneider <johannes.schneider@leica-geosystems.com> | ||
| 3 | Date: Thu, 20 Jun 2024 12:32:18 +0200 | ||
| 4 | Subject: [PATCH] meson: bpf: propagate 'sysroot' for cross compilation | ||
| 5 | |||
| 6 | During cross-compilation of systemd, the compiler used to build the bpf's needs | ||
| 7 | to be pointed at the correct include searchpath. Which can be done by passing | ||
| 8 | the corresponding directory in through the cflags; for example in yocto/bitbake | ||
| 9 | this would work: CFLAGS += "--sysroot=${STAGING_DIR_TARGET}" | ||
| 10 | |||
| 11 | Upstream-Status: Submitted [https://github.com/systemd/systemd/pull/33427] | ||
| 12 | Signed-off-by: Johannes Schneider <johannes.schneider@leica-geosystems.com> | ||
| 13 | --- | ||
| 14 | meson.build | 1 + | ||
| 15 | 1 file changed, 1 insertion(+) | ||
| 16 | |||
| 17 | diff --git a/meson.build b/meson.build | ||
| 18 | index 187e7b216d..15df058ab6 100644 | ||
| 19 | --- a/meson.build | ||
| 20 | +++ b/meson.build | ||
| 21 | @@ -1691,6 +1691,7 @@ if conf.get('BPF_FRAMEWORK') == 1 | ||
| 22 | '-ffile-prefix-map=', | ||
| 23 | '-fdebug-prefix-map=', | ||
| 24 | '-fmacro-prefix-map=', | ||
| 25 | + '--sysroot=', | ||
| 26 | ] | ||
| 27 | |||
| 28 | foreach opt : c_args | ||
| 29 | -- | ||
| 30 | 2.34.1 | ||
| 31 | |||
diff --git a/meta/recipes-core/systemd/systemd_255.6.bb b/meta/recipes-core/systemd/systemd_255.6.bb index defdb15620..d2c5e09697 100644 --- a/meta/recipes-core/systemd/systemd_255.6.bb +++ b/meta/recipes-core/systemd/systemd_255.6.bb | |||
| @@ -28,6 +28,7 @@ SRC_URI += " \ | |||
| 28 | file://systemd-pager.sh \ | 28 | file://systemd-pager.sh \ |
| 29 | file://0002-binfmt-Don-t-install-dependency-links-at-install-tim.patch \ | 29 | file://0002-binfmt-Don-t-install-dependency-links-at-install-tim.patch \ |
| 30 | file://0008-implment-systemd-sysv-install-for-OE.patch \ | 30 | file://0008-implment-systemd-sysv-install-for-OE.patch \ |
| 31 | file://0023-meson-bpf-propagate-sysroot-for-cross-compilation.patch \ | ||
| 31 | " | 32 | " |
| 32 | 33 | ||
| 33 | # patches needed by musl | 34 | # patches needed by musl |
