Merge pull request #40297 from obsidiansystems/arm-abi-disambig

lib/systems: Prohibit "gnu" ABI (*-gnu) with 32-bit ARM
This commit is contained in:
John Ericson 2018-05-10 16:33:58 -04:00 committed by GitHub
commit 5789cf4791
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 2 deletions

View File

@ -50,5 +50,12 @@ rec {
} // mapAttrs (n: v: v final.parsed) inspect.predicates } // mapAttrs (n: v: v final.parsed) inspect.predicates
// args; // args;
in assert final.useAndroidPrebuilt -> final.isAndroid; in assert final.useAndroidPrebuilt -> final.isAndroid;
assert lib.foldl
(pass: { assertion, message }:
if assertion final
then pass
else throw message)
true
(final.parsed.abi.assertions or []);
final; final;
} }

View File

@ -192,7 +192,15 @@ rec {
abis = setTypes types.openAbi { abis = setTypes types.openAbi {
android = {}; android = {};
cygnus = {}; cygnus = {};
gnu = {}; gnu = {
assertions = [
{ assertion = platform: !platform.isAarch32;
message = ''
The "gnu" ABI is ambiguous on 32-bit ARM. Use "gnueabi" or "gnueabihf" instead.
'';
}
];
};
msvc = {}; msvc = {};
eabi = {}; eabi = {};
androideabi = {}; androideabi = {};
@ -270,7 +278,7 @@ 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 abis.gnu else if isLinux parsed then (if isAarch32 parsed then 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;
}; };