knot-dns, xdp-tools: fix cross compilation (#442827)

This commit is contained in:
Vladimír Čunát
2025-09-18 17:12:48 +00:00
committed by GitHub
2 changed files with 5 additions and 1 deletions

View File

@@ -64,6 +64,7 @@ stdenv.mkDerivation rec {
# FIXME: sphinx is needed for now to get man-pages
nativeBuildInputs = [
pkg-config
protobufc # dnstap support
autoreconfHook
sphinx
];
@@ -94,6 +95,7 @@ stdenv.mkDerivation rec {
++ lib.optional stdenv.hostPlatform.isDarwin zlib; # perhaps due to gnutls
enableParallelBuilding = true;
strictDeps = true;
CFLAGS = [
"-O2"

View File

@@ -1,6 +1,7 @@
{
lib,
stdenv,
buildPackages,
fetchFromGitHub,
libbpf,
elfutils,
@@ -42,7 +43,6 @@ stdenv.mkDerivation rec {
];
nativeBuildInputs = [
bpftools
llvmPackages.clang
llvmPackages.llvm
pkg-config
m4
@@ -55,6 +55,8 @@ stdenv.mkDerivation rec {
hardeningDisable = [ "zerocallusedregs" ];
# When building BPF, the default CC wrapper is interfering a bit too much.
BPF_CFLAGS = "-fno-stack-protector -Wno-error=unused-command-line-argument";
# When cross compiling, configure prefers the unwrapped clang unless told otherwise.
CLANG = lib.getExe buildPackages.llvmPackages.clang;
PRODUCTION = 1;
DYNAMIC_LIBXDP = 1;