lib/systems: musl, libc predicates

Note this doesn't actually provide musl support yet,
just improves our "system" code to understand
musl-based triples and non-glibc linux configurations.
This commit is contained in:
Will Dietz 2018-02-11 14:20:14 -06:00
parent 69779a5f7e
commit 2dfee94fe7
4 changed files with 20 additions and 7 deletions

View File

@ -26,7 +26,9 @@ rec {
libc = libc =
/**/ if final.isDarwin then "libSystem" /**/ if final.isDarwin then "libSystem"
else if final.isMinGW then "msvcrt" else if final.isMinGW then "msvcrt"
else if final.isLinux then "glibc" else if final.isLinux && final.isGlibc then "glibc"
else if final.isLinux && final.isMusl then "musl"
else if final.isLinux /* default */ then "glibc"
# TODO(@Ericson2314) think more about other operating systems # TODO(@Ericson2314) think more about other operating systems
else "native/impure"; else "native/impure";
extensions = { extensions = {

View File

@ -13,7 +13,6 @@ rec {
config = "armv5tel-unknown-linux-gnueabi"; config = "armv5tel-unknown-linux-gnueabi";
arch = "armv5tel"; arch = "armv5tel";
float = "soft"; float = "soft";
libc = "glibc";
platform = platforms.sheevaplug; platform = platforms.sheevaplug;
}; };
@ -22,7 +21,6 @@ rec {
arch = "armv6l"; arch = "armv6l";
float = "hard"; float = "hard";
fpu = "vfp"; fpu = "vfp";
libc = "glibc";
platform = platforms.raspberrypi; platform = platforms.raspberrypi;
}; };
@ -31,14 +29,12 @@ rec {
arch = "armv7-a"; arch = "armv7-a";
float = "hard"; float = "hard";
fpu = "vfpv3-d16"; fpu = "vfpv3-d16";
libc = "glibc";
platform = platforms.armv7l-hf-multiplatform; platform = platforms.armv7l-hf-multiplatform;
}; };
aarch64-multiplatform = rec { aarch64-multiplatform = rec {
config = "aarch64-unknown-linux-gnu"; config = "aarch64-unknown-linux-gnu";
arch = "aarch64"; arch = "aarch64";
libc = "glibc";
platform = platforms.aarch64-multiplatform; platform = platforms.aarch64-multiplatform;
}; };
@ -51,7 +47,6 @@ rec {
arch = "armv5tel"; arch = "armv5tel";
config = "armv5tel-unknown-linux-gnueabi"; config = "armv5tel-unknown-linux-gnueabi";
float = "soft"; float = "soft";
libc = "glibc";
platform = platforms.pogoplug4; platform = platforms.pogoplug4;
}; };
@ -59,10 +54,20 @@ rec {
config = "mips64el-unknown-linux-gnu"; config = "mips64el-unknown-linux-gnu";
arch = "mips"; arch = "mips";
float = "hard"; float = "hard";
libc = "glibc";
platform = platforms.fuloong2f_n32; platform = platforms.fuloong2f_n32;
}; };
muslpi = raspberryPi // {
config = "armv6l-unknown-linux-musleabihf";
};
aarch64-multiplatform-musl = aarch64-multiplatform // {
config = "aarch64-unknown-linux-musl";
};
musl64 = { config = "x86_64-unknown-linux-musl"; };
musl32 = { config = "i686-unknown-linux-musl"; };
# #
# Darwin # Darwin
# #

View File

@ -33,6 +33,9 @@ rec {
Windows = { kernel = kernels.windows; }; Windows = { kernel = kernels.windows; };
Cygwin = { kernel = kernels.windows; abi = abis.cygnus; }; Cygwin = { kernel = kernels.windows; abi = abis.cygnus; };
MinGW = { kernel = kernels.windows; abi = abis.gnu; }; MinGW = { kernel = kernels.windows; abi = abis.gnu; };
Musl = with abis; map (a: { abi = a; }) [ musl musleabi musleabihf ];
Glibc = with abis; map (a: { abi = a; }) [ gnu gnueabi gnueabihf ];
}; };
matchAnyAttrs = patterns: matchAnyAttrs = patterns:

View File

@ -180,6 +180,9 @@ rec {
androideabi = {}; androideabi = {};
gnueabi = {}; gnueabi = {};
gnueabihf = {}; gnueabihf = {};
musleabi = {};
musleabihf = {};
musl = {};
unknown = {}; unknown = {};
}; };