systemd: fix cross compilation with libbpf enabled

This commit is contained in:
Nick Cao 2022-08-25 21:34:19 +08:00
parent c91ed9564a
commit 767c3e5fa9
No known key found for this signature in database

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