From b86e62d30d4635ef3294d9c1c308f9c8b0061045 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Thu, 14 Feb 2019 01:17:10 -0500 Subject: llvm: support cross compilation with useLLVM flag MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit You can build (partially) with LLVM toolchain using the useLLVM flag. This works like so: nix-build -A hello --arg crossSystem '{ system = "aarch64-unknown-linux-musl"; useLLVM = true }' also don’t separate debug info in lldClang It doesn’t work currently with that setup hook. Missing build-id? --- pkgs/test/cross/default.nix | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'pkgs/test') diff --git a/pkgs/test/cross/default.nix b/pkgs/test/cross/default.nix index 622799106cd..a907b9e2d45 100644 --- a/pkgs/test/cross/default.nix +++ b/pkgs/test/cross/default.nix @@ -26,14 +26,20 @@ let # We need to remove whitespace, unfortunately # Windows programs use \r but Unix programs use \n + echo Running native-built program natively + # find expected value natively ${getExecutable hostPkgs pkgFun exec} ${args'} \ | dos2unix > $out/expected + echo Running cross-built program in emulator + # run emulator to get actual value ${emulator} ${getExecutable crossPkgs pkgFun exec} ${args'} \ | dos2unix > $out/actual + echo Comparing results... + if [ "$(cat $out/actual)" != "$(cat $out/expected)" ]; then echo "${pkgName} did not output expected value:" cat $out/expected -- cgit 1.4.1