From 23c520d95e1b990f0e23c29ec5322b05fc7a9570 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Fri, 26 Apr 2019 22:29:52 -0400 Subject: [PATCH] cc-wrapper: only set -march when platform.gcc.arch is specified We want to make sure this value is explicitly set. Infering it for every arch leads to annoying failures like: https://hydra.nixos.org/build/92583832/ Perhaps we can enable it in the future with some smarter handling of cc-wrapper.sh. --- pkgs/build-support/cc-wrapper/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/build-support/cc-wrapper/default.nix b/pkgs/build-support/cc-wrapper/default.nix index b52852a0f63..cf2d38cd997 100644 --- a/pkgs/build-support/cc-wrapper/default.nix +++ b/pkgs/build-support/cc-wrapper/default.nix @@ -306,9 +306,9 @@ stdenv.mkDerivation { # Always add -march based on cpu in triple. Sometimes there is a # discrepency (x86_64 vs. x86-64), so we provide an "arch" arg in # that case. - + optionalString ((targetPlatform ? platform.gcc.arch || targetPlatform.parsed.cpu ? arch) && - isGccArchSupported targetPlatform.platform.gcc.arch or targetPlatform.parsed.cpu.arch) '' - echo "-march=${targetPlatform.platform.gcc.arch or targetPlatform.parsed.cpu.arch}" >> $out/nix-support/cc-cflags-before + + optionalString ((targetPlatform ? platform.gcc.arch) && + isGccArchSupported targetPlatform.platform.gcc.arch) '' + echo "-march=${targetPlatform.platform.gcc.arch}" >> $out/nix-support/cc-cflags-before '' # -mcpu is not very useful. You should use mtune and march