From e6ca3a37f13ab997bf66e3f00af01ee9851ba00e Mon Sep 17 00:00:00 2001 From: Ryan Burns Date: Sat, 30 Oct 2021 16:55:53 -0700 Subject: [PATCH] libselinux: fix cross-compilation from x86_32 libselinux incorrectly initializes the host platform's arch using uname -m, which actually returns the build platform's arch. This results in an invalid compile flag (-mno-tls-direct-seg-refs) when compiling from x86_32. So we need to set the host arch variable explicitly. --- pkgs/os-specific/linux/libselinux/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/os-specific/linux/libselinux/default.nix b/pkgs/os-specific/linux/libselinux/default.nix index fbf7e4bd995a..fcea787ed79c 100644 --- a/pkgs/os-specific/linux/libselinux/default.nix +++ b/pkgs/os-specific/linux/libselinux/default.nix @@ -39,6 +39,7 @@ stdenv.mkDerivation rec { "SHLIBDIR=$(out)/lib" "LIBSEPOLA=${lib.getLib libsepol}/lib/libsepol.a" + "ARCH=${stdenv.hostPlatform.linuxArch}" ] ++ optionals enablePython [ "PYTHON=${python3.pythonForBuild.interpreter}" "PYTHONLIBDIR=$(py)/${python3.sitePackages}"