-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Platform config improvements #105294
Platform config improvements #105294
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -456,10 +456,9 @@ rec { | |
## Other | ||
## | ||
|
||
riscv-multiplatform = bits: { | ||
riscv-multiplatform = { | ||
name = "riscv-multiplatform"; | ||
kernelArch = "riscv"; | ||
bfdEmulation = "elf${bits}lriscv"; | ||
kernelTarget = "vmlinux"; | ||
kernelAutoModules = true; | ||
kernelBaseConfig = "defconfig"; | ||
|
@@ -469,17 +468,22 @@ rec { | |
''; | ||
}; | ||
|
||
selectBySystem = system: { | ||
i486-linux = pc32; | ||
i586-linux = pc32; | ||
i686-linux = pc32; | ||
x86_64-linux = pc64; | ||
armv5tel-linux = sheevaplug; | ||
armv6l-linux = raspberrypi; | ||
armv7a-linux = armv7l-hf-multiplatform; | ||
armv7l-linux = armv7l-hf-multiplatform; | ||
aarch64-linux = aarch64-multiplatform; | ||
mipsel-linux = fuloong2f_n32; | ||
powerpc64le-linux = powernv; | ||
}.${system} or pcBase; | ||
select = platform: | ||
# x86 | ||
/**/ if platform.isx86_32 then pc32 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. these should verify we are still looking at linux systems There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually the original didn’t check that for pcBase so maybe it shouldn’t matter. I guess defaulting yo pcBase if non linux is reasonable. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah I would rather decide what to do with that later. If some non-linux platform has some linux config stuff, it should be harmless. |
||
else if platform.isx86_64 then pc64 | ||
|
||
# ARM | ||
else if platform.isAarch32 then let | ||
version = platform.parsed.cpu.version or ""; | ||
in if lib.versionOlder version "6" then sheevaplug | ||
else if lib.versionOlder version "7" then raspberrypi | ||
else armv7l-hf-multiplatform | ||
else if platform.isAarch64 then aarch64-multiplatform | ||
|
||
else if platform.parsed.cpu == lib.systems.parse.cpuTypes.mipsel then fuloong2f_n32 | ||
|
||
else if platform.parsed.cpu == lib.systems.parse.cpuTypes.powerpc64le then powernv | ||
|
||
else pcBase; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -167,7 +167,7 @@ stdenv.mkDerivation { | |
else if targetPlatform.isWindows then "pe" | ||
else "elf" + toString targetPlatform.parsed.cpu.bits; | ||
endianPrefix = if targetPlatform.isBigEndian then "big" else "little"; | ||
sep = optionalString (!targetPlatform.isMips && !targetPlatform.isPower) "-"; | ||
sep = optionalString (!targetPlatform.isMips && !targetPlatform.isPower && !targetPlatform.isRiscV) "-"; | ||
arch = | ||
/**/ if targetPlatform.isAarch64 then endianPrefix + "aarch64" | ||
else if targetPlatform.isAarch32 then endianPrefix + "arm" | ||
|
@@ -187,6 +187,7 @@ stdenv.mkDerivation { | |
else if targetPlatform.isAlpha then "alpha" | ||
else if targetPlatform.isVc4 then "vc4" | ||
else if targetPlatform.isOr1k then "or1k" | ||
else if targetPlatform.isRiscV then "lriscv" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did you test this? I tried to build NixOS on RISC-V a few months ago and I added "riscv" which seemed to work. |
||
else throw "unknown emulation for platform: ${targetPlatform.config}"; | ||
in if targetPlatform.useLLVM or false then "" | ||
else targetPlatform.platform.bfdEmulation or (fmt + sep + arch); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JohnAZoidberg it's based off of this which has the "l", presumably for little endian.