summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/systemd/systemd/0023-meson-bpf-propagate-sysroot-for-cross-compilation.patch
blob: 5be4a27b365acbc6bf7b891d6d00a3b486b20bb9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
From 7463b382bcaf26aacc60b73f98f0262aa41db3ee Mon Sep 17 00:00:00 2001
From: Johannes Schneider <johannes.schneider@leica-geosystems.com>
Date: Thu, 20 Jun 2024 12:32:18 +0200
Subject: [PATCH] meson: bpf: propagate 'sysroot' for cross compilation

During cross-compilation of systemd, the compiler used to build the bpf's needs
to be pointed at the correct include searchpath. Which can be done by passing
the corresponding directory in through the cflags; for example in yocto/bitbake
this would work: CFLAGS += "--sysroot=${STAGING_DIR_TARGET}"

Upstream-Status: Submitted [https://github.com/systemd/systemd/pull/33427]
Signed-off-by: Johannes Schneider <johannes.schneider@leica-geosystems.com>
---
 meson.build | 1 +
 1 file changed, 1 insertion(+)

diff --git a/meson.build b/meson.build
index 187e7b216d..15df058ab6 100644
--- a/meson.build
+++ b/meson.build
@@ -1691,6 +1691,7 @@ if conf.get('BPF_FRAMEWORK') == 1
                 '-ffile-prefix-map=',
                 '-fdebug-prefix-map=',
                 '-fmacro-prefix-map=',
+                '--sysroot=',
         ]
 
         foreach opt : c_args
-- 
2.34.1