mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-13 05:05:29 +03:00
Merge branch 'fix-gcc-with-float'
This commit is contained in:
commit
92b7a814f2
4 changed files with 25 additions and 21 deletions
|
@ -68,17 +68,17 @@ rec {
|
||||||
|
|
||||||
cpuTypes = with significantBytes; setTypes types.openCpuType {
|
cpuTypes = with significantBytes; setTypes types.openCpuType {
|
||||||
arm = { bits = 32; significantByte = littleEndian; family = "arm"; };
|
arm = { bits = 32; significantByte = littleEndian; family = "arm"; };
|
||||||
armv5tel = { bits = 32; significantByte = littleEndian; family = "arm"; };
|
armv5tel = { bits = 32; significantByte = littleEndian; family = "arm"; version = "5"; };
|
||||||
armv6m = { bits = 32; significantByte = littleEndian; family = "arm"; };
|
armv6m = { bits = 32; significantByte = littleEndian; family = "arm"; version = "6"; };
|
||||||
armv6l = { bits = 32; significantByte = littleEndian; family = "arm"; };
|
armv6l = { bits = 32; significantByte = littleEndian; family = "arm"; version = "6"; };
|
||||||
armv7a = { bits = 32; significantByte = littleEndian; family = "arm"; };
|
armv7a = { bits = 32; significantByte = littleEndian; family = "arm"; version = "7"; };
|
||||||
armv7r = { bits = 32; significantByte = littleEndian; family = "arm"; };
|
armv7r = { bits = 32; significantByte = littleEndian; family = "arm"; version = "7"; };
|
||||||
armv7m = { bits = 32; significantByte = littleEndian; family = "arm"; };
|
armv7m = { bits = 32; significantByte = littleEndian; family = "arm"; version = "7"; };
|
||||||
armv7l = { bits = 32; significantByte = littleEndian; family = "arm"; };
|
armv7l = { bits = 32; significantByte = littleEndian; family = "arm"; version = "7"; };
|
||||||
armv8a = { bits = 32; significantByte = littleEndian; family = "arm"; };
|
armv8a = { bits = 32; significantByte = littleEndian; family = "arm"; version = "8"; };
|
||||||
armv8r = { bits = 32; significantByte = littleEndian; family = "arm"; };
|
armv8r = { bits = 32; significantByte = littleEndian; family = "arm"; version = "8"; };
|
||||||
armv8m = { bits = 32; significantByte = littleEndian; family = "arm"; };
|
armv8m = { bits = 32; significantByte = littleEndian; family = "arm"; version = "8"; };
|
||||||
aarch64 = { bits = 64; significantByte = littleEndian; family = "arm"; };
|
aarch64 = { bits = 64; significantByte = littleEndian; family = "arm"; version = "8"; };
|
||||||
|
|
||||||
i686 = { bits = 32; significantByte = littleEndian; family = "x86"; };
|
i686 = { bits = 32; significantByte = littleEndian; family = "x86"; };
|
||||||
x86_64 = { bits = 64; significantByte = littleEndian; family = "x86"; };
|
x86_64 = { bits = 64; significantByte = littleEndian; family = "x86"; };
|
||||||
|
@ -295,7 +295,12 @@ rec {
|
||||||
kernel = getKernel args.kernel;
|
kernel = getKernel args.kernel;
|
||||||
abi =
|
abi =
|
||||||
/**/ if args ? abi then getAbi args.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 if isWindows parsed then abis.gnu
|
||||||
else abis.unknown;
|
else abis.unknown;
|
||||||
};
|
};
|
||||||
|
|
|
@ -245,7 +245,6 @@ rec {
|
||||||
gcc = {
|
gcc = {
|
||||||
arch = "armv6";
|
arch = "armv6";
|
||||||
fpu = "vfp";
|
fpu = "vfp";
|
||||||
float = "hard";
|
|
||||||
# TODO(@Ericson2314) what is this and is it a good idea? It was
|
# TODO(@Ericson2314) what is this and is it a good idea? It was
|
||||||
# used in some cross compilation examples but not others.
|
# used in some cross compilation examples but not others.
|
||||||
#
|
#
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
{ lib, targetPlatform }:
|
{ lib, targetPlatform }:
|
||||||
|
|
||||||
let
|
let
|
||||||
p = targetPlatform.platform.gcc or {};
|
p = targetPlatform.platform.gcc or {}
|
||||||
float = p.float or (targetPlatform.parsed.abi.float or null);
|
// targetPlatform.parsed.abi;
|
||||||
in lib.concatLists [
|
in lib.concatLists [
|
||||||
(lib.optional (p ? arch) "--with-arch=${p.arch}")
|
(lib.optional (p ? arch) "--with-arch=${p.arch}")
|
||||||
(lib.optional (p ? cpu) "--with-cpu=${p.cpu}")
|
(lib.optional (p ? cpu) "--with-cpu=${p.cpu}")
|
||||||
(lib.optional (p ? abi) "--with-abi=${p.abi}")
|
(lib.optional (p ? abi) "--with-abi=${p.abi}")
|
||||||
(lib.optional (p ? fpu) "--with-fpu=${p.fpu}")
|
(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}")
|
(lib.optional (p ? mode) "--with-mode=${p.mode}")
|
||||||
]
|
]
|
||||||
|
|
|
@ -15,12 +15,12 @@ let
|
||||||
"x86_64-unknown-linux-gnu" = {
|
"x86_64-unknown-linux-gnu" = {
|
||||||
double = "linux-x86_64";
|
double = "linux-x86_64";
|
||||||
};
|
};
|
||||||
"armv5tel-unknown-linux-androideabi" = {
|
"armv5tel-unknown-linux-androideabi" = {
|
||||||
arch = "arm";
|
arch = "arm";
|
||||||
triple = "arm-linux-androideabi";
|
triple = "arm-linux-androideabi";
|
||||||
gccVer = "4.8";
|
gccVer = "4.8";
|
||||||
};
|
};
|
||||||
"armv7a-unknown-linux-androideabi" = {
|
"armv7a-unknown-linux-androideabi" = {
|
||||||
arch = "arm";
|
arch = "arm";
|
||||||
triple = "arm-linux-androideabi";
|
triple = "arm-linux-androideabi";
|
||||||
gccVer = "4.8";
|
gccVer = "4.8";
|
||||||
|
@ -65,14 +65,14 @@ rec {
|
||||||
bintools = binutils;
|
bintools = binutils;
|
||||||
libc = targetAndroidndkPkgs.libraries;
|
libc = targetAndroidndkPkgs.libraries;
|
||||||
extraBuildCommands = lib.optionalString targetPlatform.isAarch32 (let
|
extraBuildCommands = lib.optionalString targetPlatform.isAarch32 (let
|
||||||
p = targetPlatform.platform.gcc or {};
|
p = targetPlatform.platform.gcc or {}
|
||||||
float = p.float or (targetPlatform.parsed.abi.float or null);
|
// targetPlatform.parsed.abi;
|
||||||
flags = lib.concatLists [
|
flags = lib.concatLists [
|
||||||
(lib.optional (p ? arch) "-march=${p.arch}")
|
(lib.optional (p ? arch) "-march=${p.arch}")
|
||||||
(lib.optional (p ? cpu) "-mcpu=${p.cpu}")
|
(lib.optional (p ? cpu) "-mcpu=${p.cpu}")
|
||||||
(lib.optional (p ? abi) "-mabi=${p.abi}")
|
(lib.optional (p ? abi) "-mabi=${p.abi}")
|
||||||
(lib.optional (p ? fpu) "-mfpu=${p.fpu}")
|
(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 ? float-abi) "-mfloat-abi=${p.float-abi}")
|
||||||
(lib.optional (p ? mode) "-mmode=${p.mode}")
|
(lib.optional (p ? mode) "-mmode=${p.mode}")
|
||||||
];
|
];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue