From 2a588dad4ee6f53b1a926f003266395f0845a203 Mon Sep 17 00:00:00 2001 From: Andrew Childs Date: Fri, 19 Mar 2021 20:40:34 +0900 Subject: [PATCH] llvmPackages_{10,11}.compiler-rt: restrict build to current arch Workaround for build failure after adding mandatory -arch argument. Nixpkgs targets a single architecture, so this saves a small amount of wasted build effort. See https://github.com/NixOS/nixpkgs/pull/114817#issuecomment-802709527 --- pkgs/development/compilers/llvm/10/compiler-rt.nix | 1 + pkgs/development/compilers/llvm/11/compiler-rt.nix | 1 + 2 files changed, 2 insertions(+) diff --git a/pkgs/development/compilers/llvm/10/compiler-rt.nix b/pkgs/development/compilers/llvm/10/compiler-rt.nix index bdc99427c27e..64d57e3e811d 100644 --- a/pkgs/development/compilers/llvm/10/compiler-rt.nix +++ b/pkgs/development/compilers/llvm/10/compiler-rt.nix @@ -46,6 +46,7 @@ stdenv.mkDerivation rec { # and finds i386;x86_64;x86_64h. We only build for x86_64, so linking fails # when it tries to use libc++ and libc++api for i386. "-DDARWIN_osx_ARCHS=${stdenv.hostPlatform.darwinArch}" + "-DDARWIN_osx_BUILTIN_ARCHS=${stdenv.hostPlatform.darwinArch}" ]; outputs = [ "out" "dev" ]; diff --git a/pkgs/development/compilers/llvm/11/compiler-rt.nix b/pkgs/development/compilers/llvm/11/compiler-rt.nix index fe326b004131..88a412f6cb4f 100644 --- a/pkgs/development/compilers/llvm/11/compiler-rt.nix +++ b/pkgs/development/compilers/llvm/11/compiler-rt.nix @@ -27,6 +27,7 @@ stdenv.mkDerivation rec { ] ++ lib.optionals (stdenv.isDarwin) [ "-DDARWIN_macosx_OVERRIDE_SDK_VERSION=ON" "-DDARWIN_osx_ARCHS=${stdenv.hostPlatform.darwinArch}" + "-DDARWIN_osx_BUILTIN_ARCHS=${stdenv.hostPlatform.darwinArch}" ] ++ lib.optionals (useLLVM || bareMetal || isMusl) [ "-DCOMPILER_RT_BUILD_SANITIZERS=OFF" "-DCOMPILER_RT_BUILD_XRAY=OFF"