about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2018-05-12 15:21:30 -0400
committerJohn Ericson <John.Ericson@Obsidian.Systems>2018-05-12 15:21:30 -0400
commit92b7a814f26ee1d37e989431c18518c67285a332 (patch)
tree3abff63217cd5e7b80cf3384e6226175780b22b5
parentb0d29e7e179f20c92f18e2eff13b871d015adc5a (diff)
parentf2004e62870aa6b21dd52612295da973194c7c73 (diff)
downloadnixlib-92b7a814f26ee1d37e989431c18518c67285a332.tar
nixlib-92b7a814f26ee1d37e989431c18518c67285a332.tar.gz
nixlib-92b7a814f26ee1d37e989431c18518c67285a332.tar.bz2
nixlib-92b7a814f26ee1d37e989431c18518c67285a332.tar.lz
nixlib-92b7a814f26ee1d37e989431c18518c67285a332.tar.xz
nixlib-92b7a814f26ee1d37e989431c18518c67285a332.tar.zst
nixlib-92b7a814f26ee1d37e989431c18518c67285a332.zip
Merge branch 'fix-gcc-with-float'
-rw-r--r--lib/systems/parse.nix29
-rw-r--r--lib/systems/platforms.nix1
-rw-r--r--pkgs/development/compilers/gcc/common/platform-flags.nix6
-rw-r--r--pkgs/development/mobile/androidenv/androidndk-pkgs.nix10
4 files changed, 25 insertions, 21 deletions
diff --git a/lib/systems/parse.nix b/lib/systems/parse.nix
index 4c34ace3f277..d79947ad3dea 100644
--- a/lib/systems/parse.nix
+++ b/lib/systems/parse.nix
@@ -68,17 +68,17 @@ rec {
 
   cpuTypes = with significantBytes; setTypes types.openCpuType {
     arm      = { bits = 32; significantByte = littleEndian; family = "arm"; };
-    armv5tel = { bits = 32; significantByte = littleEndian; family = "arm"; };
-    armv6m   = { bits = 32; significantByte = littleEndian; family = "arm"; };
-    armv6l   = { bits = 32; significantByte = littleEndian; family = "arm"; };
-    armv7a   = { bits = 32; significantByte = littleEndian; family = "arm"; };
-    armv7r   = { bits = 32; significantByte = littleEndian; family = "arm"; };
-    armv7m   = { bits = 32; significantByte = littleEndian; family = "arm"; };
-    armv7l   = { bits = 32; significantByte = littleEndian; family = "arm"; };
-    armv8a   = { bits = 32; significantByte = littleEndian; family = "arm"; };
-    armv8r   = { bits = 32; significantByte = littleEndian; family = "arm"; };
-    armv8m   = { bits = 32; significantByte = littleEndian; family = "arm"; };
-    aarch64  = { bits = 64; significantByte = littleEndian; family = "arm"; };
+    armv5tel = { bits = 32; significantByte = littleEndian; family = "arm"; version = "5"; };
+    armv6m   = { bits = 32; significantByte = littleEndian; family = "arm"; version = "6"; };
+    armv6l   = { bits = 32; significantByte = littleEndian; family = "arm"; version = "6"; };
+    armv7a   = { bits = 32; significantByte = littleEndian; family = "arm"; version = "7"; };
+    armv7r   = { bits = 32; significantByte = littleEndian; family = "arm"; version = "7"; };
+    armv7m   = { bits = 32; significantByte = littleEndian; family = "arm"; version = "7"; };
+    armv7l   = { bits = 32; significantByte = littleEndian; family = "arm"; version = "7"; };
+    armv8a   = { bits = 32; significantByte = littleEndian; family = "arm"; version = "8"; };
+    armv8r   = { bits = 32; significantByte = littleEndian; family = "arm"; version = "8"; };
+    armv8m   = { bits = 32; significantByte = littleEndian; family = "arm"; version = "8"; };
+    aarch64  = { bits = 64; significantByte = littleEndian; family = "arm"; version = "8"; };
 
     i686     = { bits = 32; significantByte = littleEndian; family = "x86"; };
     x86_64   = { bits = 64; significantByte = littleEndian; family = "x86"; };
@@ -295,7 +295,12 @@ rec {
       kernel = getKernel args.kernel;
       abi =
         /**/ if args ? abi       then getAbi args.abi
-        else if isLinux   parsed then (if isAarch32 parsed then abis.gnueabi else abis.gnu)
+        else if isLinux   parsed then
+          if isAarch32 parsed then
+            if lib.versionAtLeast (parsed.cpu.version or "0") "6"
+            then abis.gnueabihf
+            else abis.gnueabi
+          else abis.gnu
         else if isWindows parsed then abis.gnu
         else                     abis.unknown;
     };
diff --git a/lib/systems/platforms.nix b/lib/systems/platforms.nix
index 5becaf581a45..32f055b6b1c5 100644
--- a/lib/systems/platforms.nix
+++ b/lib/systems/platforms.nix
@@ -245,7 +245,6 @@ rec {
     gcc = {
       arch = "armv6";
       fpu = "vfp";
-      float = "hard";
       # TODO(@Ericson2314) what is this and is it a good idea? It was
       # used in some cross compilation examples but not others.
       #
diff --git a/pkgs/development/compilers/gcc/common/platform-flags.nix b/pkgs/development/compilers/gcc/common/platform-flags.nix
index e261f54f582d..9a6d3f8f6203 100644
--- a/pkgs/development/compilers/gcc/common/platform-flags.nix
+++ b/pkgs/development/compilers/gcc/common/platform-flags.nix
@@ -1,13 +1,13 @@
 { lib, targetPlatform }:
 
 let
-  p = targetPlatform.platform.gcc or {};
-  float = p.float or (targetPlatform.parsed.abi.float or null);
+  p =  targetPlatform.platform.gcc or {}
+    // targetPlatform.parsed.abi;
 in lib.concatLists [
   (lib.optional (p ? arch) "--with-arch=${p.arch}")
   (lib.optional (p ? cpu) "--with-cpu=${p.cpu}")
   (lib.optional (p ? abi) "--with-abi=${p.abi}")
   (lib.optional (p ? fpu) "--with-fpu=${p.fpu}")
-  (lib.optional (float != null) "--with-float=${float}")
+  (lib.optional (p ? float) "--with-float=${p.float}")
   (lib.optional (p ? mode) "--with-mode=${p.mode}")
 ]
diff --git a/pkgs/development/mobile/androidenv/androidndk-pkgs.nix b/pkgs/development/mobile/androidenv/androidndk-pkgs.nix
index f0557390988d..663a1f1ee8f4 100644
--- a/pkgs/development/mobile/androidenv/androidndk-pkgs.nix
+++ b/pkgs/development/mobile/androidenv/androidndk-pkgs.nix
@@ -15,12 +15,12 @@ let
     "x86_64-unknown-linux-gnu" = {
       double = "linux-x86_64";
     };
-   "armv5tel-unknown-linux-androideabi" = {
+    "armv5tel-unknown-linux-androideabi" = {
       arch = "arm";
       triple = "arm-linux-androideabi";
       gccVer = "4.8";
     };
-   "armv7a-unknown-linux-androideabi" = {
+    "armv7a-unknown-linux-androideabi" = {
       arch = "arm";
       triple = "arm-linux-androideabi";
       gccVer = "4.8";
@@ -65,14 +65,14 @@ rec {
     bintools = binutils;
     libc = targetAndroidndkPkgs.libraries;
     extraBuildCommands = lib.optionalString targetPlatform.isAarch32 (let
-        p = targetPlatform.platform.gcc or {};
-        float = p.float or (targetPlatform.parsed.abi.float or null);
+        p =  targetPlatform.platform.gcc or {}
+          // targetPlatform.parsed.abi;
         flags = lib.concatLists [
           (lib.optional (p ? arch) "-march=${p.arch}")
           (lib.optional (p ? cpu) "-mcpu=${p.cpu}")
           (lib.optional (p ? abi) "-mabi=${p.abi}")
           (lib.optional (p ? fpu) "-mfpu=${p.fpu}")
-          (lib.optional (float != null) "-mfloat=${float}")
+          (lib.optional (p ? float) "-mfloat=${p.float}")
           (lib.optional (p ? float-abi) "-mfloat-abi=${p.float-abi}")
           (lib.optional (p ? mode) "-mmode=${p.mode}")
         ];