From 5ad79dc4bb22326e5a98db7bf2b69a76a2e6f01e Mon Sep 17 00:00:00 2001 From: volth Date: Sun, 21 Apr 2019 17:06:50 +0000 Subject: compilation for particular x86_64 architecture --- pkgs/development/libraries/qt-5/modules/qtbase.nix | 17 ++++++++++------- pkgs/development/libraries/qt-5/modules/qtwebengine.nix | 5 ++++- 2 files changed, 14 insertions(+), 8 deletions(-) (limited to 'pkgs/development/libraries/qt-5/modules') diff --git a/pkgs/development/libraries/qt-5/modules/qtbase.nix b/pkgs/development/libraries/qt-5/modules/qtbase.nix index 92ac8a242013..71d27c33a928 100644 --- a/pkgs/development/libraries/qt-5/modules/qtbase.nix +++ b/pkgs/development/libraries/qt-5/modules/qtbase.nix @@ -266,15 +266,18 @@ stdenv.mkDerivation { ++ ( if (!stdenv.hostPlatform.isx86_64) then [ "-no-sse2" ] - else lib.optional (compareVersion "5.9.0" >= 0) [ "-sse2" ] + else lib.optionals (compareVersion "5.9.0" >= 0) { + "default" = [ "-sse2" "-no-sse3" "-no-ssse3" "-no-sse4.1" "-no-sse4.2" "-no-avx" "-no-avx2" ]; + "westmere" = [ "-sse2" "-sse3" "-ssse3" "-sse4.1" "-sse4.2" "-no-avx" "-no-avx2" ]; + "sandybridge" = [ "-sse2" "-sse3" "-ssse3" "-sse4.1" "-sse4.2" "-avx" "-no-avx2" ]; + "ivybridge" = [ "-sse2" "-sse3" "-ssse3" "-sse4.1" "-sse4.2" "-avx" "-no-avx2" ]; + "haswell" = [ "-sse2" "-sse3" "-ssse3" "-sse4.1" "-sse4.2" "-avx" "-avx2" ]; + "broadwell" = [ "-sse2" "-sse3" "-ssse3" "-sse4.1" "-sse4.2" "-avx" "-avx2" ]; + "skylake" = [ "-sse2" "-sse3" "-ssse3" "-sse4.1" "-sse4.2" "-avx" "-avx2" ]; + "skylake-avx512" = [ "-sse2" "-sse3" "-ssse3" "-sse4.1" "-sse4.2" "-avx" "-avx2" ]; + }.${stdenv.hostPlatform.platform.gcc.arch or "default"} ) ++ [ - "-no-sse3" - "-no-ssse3" - "-no-sse4.1" - "-no-sse4.2" - "-no-avx" - "-no-avx2" "-no-mips_dsp" "-no-mips_dspr2" ] diff --git a/pkgs/development/libraries/qt-5/modules/qtwebengine.nix b/pkgs/development/libraries/qt-5/modules/qtwebengine.nix index 91b7acf43654..af5804018874 100644 --- a/pkgs/development/libraries/qt-5/modules/qtwebengine.nix +++ b/pkgs/development/libraries/qt-5/modules/qtwebengine.nix @@ -103,7 +103,10 @@ EOF ''); NIX_CFLAGS_COMPILE = - lib.optionalString stdenv.isDarwin [ + # it fails when compiled with -march=sandybridge https://github.com/NixOS/nixpkgs/pull/59148#discussion_r276696940 + # TODO: investigate and fix properly + lib.optionals (stdenv.hostPlatform.platform.gcc.arch or "" == "sandybridge") [ "-march=westmere" ] ++ + lib.optionals stdenv.isDarwin [ "-DMAC_OS_X_VERSION_MAX_ALLOWED=MAC_OS_X_VERSION_10_10" "-DMAC_OS_X_VERSION_MIN_REQUIRED=MAC_OS_X_VERSION_10_10" -- cgit 1.4.1