Merge #188291: systemd: fix cross compilation with libbpf enabled

...into staging-next
This commit is contained in:
Vladimír Čunát 2022-08-26 08:35:04 +02:00
commit fee9bddb58
No known key found for this signature in database
GPG Key ID: E747DF1F9575A3AA

View File

@ -208,6 +208,8 @@ stdenv.mkDerivation {
"run_command(cc.cmd_array(), '-print-prog-name=objcopy', check: true).stdout().strip()" \
"'${stdenv.cc.bintools.targetPrefix}objcopy'"
'' + lib.optionalString withLibBPF ''
substituteInPlace meson.build \
--replace "find_program('clang'" "find_program('${stdenv.cc.targetPrefix}clang'"
# BPF does not work with stack protector
substituteInPlace src/core/bpf/meson.build \
--replace "clang_flags = [" "clang_flags = [ '-fno-stack-protector',"
@ -352,7 +354,7 @@ stdenv.mkDerivation {
docbook_xml_dtd_45
(buildPackages.python3Packages.python.withPackages (ps: with ps; [ lxml jinja2 ]))
]
++ lib.optional withLibBPF [
++ lib.optionals withLibBPF [
bpftools
llvmPackages.clang
llvmPackages.libllvm