Revert "lib: Clean up how linux and gcc config is specified"
This is a stdenv-rebuild, and should not be merged
into master
This reverts commit 8929989614.
This commit is contained in:
@@ -190,7 +190,7 @@ stdenv.mkDerivation {
|
||||
else if targetPlatform.isRiscV then "lriscv"
|
||||
else throw "unknown emulation for platform: ${targetPlatform.config}";
|
||||
in if targetPlatform.useLLVM or false then ""
|
||||
else targetPlatform.bfdEmulation or (fmt + sep + arch);
|
||||
else targetPlatform.platform.bfdEmulation or (fmt + sep + arch);
|
||||
|
||||
strictDeps = true;
|
||||
depsTargetTargetPropagated = extraPackages;
|
||||
|
||||
@@ -403,31 +403,31 @@ stdenv.mkDerivation {
|
||||
# discrepency (x86_64 vs. x86-64), so we provide an "arch" arg in
|
||||
# that case.
|
||||
+ optionalString ((targetPlatform ? platform.gcc.arch) &&
|
||||
isGccArchSupported targetPlatform.gcc.arch) ''
|
||||
echo "-march=${targetPlatform.gcc.arch}" >> $out/nix-support/cc-cflags-before
|
||||
isGccArchSupported targetPlatform.platform.gcc.arch) ''
|
||||
echo "-march=${targetPlatform.platform.gcc.arch}" >> $out/nix-support/cc-cflags-before
|
||||
''
|
||||
|
||||
# -mcpu is not very useful. You should use mtune and march
|
||||
# instead. It’s provided here for backwards compatibility.
|
||||
+ optionalString (targetPlatform ? platform.gcc.cpu) ''
|
||||
echo "-mcpu=${targetPlatform.gcc.cpu}" >> $out/nix-support/cc-cflags-before
|
||||
echo "-mcpu=${targetPlatform.platform.gcc.cpu}" >> $out/nix-support/cc-cflags-before
|
||||
''
|
||||
|
||||
# -mfloat-abi only matters on arm32 but we set it here
|
||||
# unconditionally just in case. If the abi specifically sets hard
|
||||
# vs. soft floats we use it here.
|
||||
+ optionalString (targetPlatform ? platform.gcc.float-abi) ''
|
||||
echo "-mfloat-abi=${targetPlatform.gcc.float-abi}" >> $out/nix-support/cc-cflags-before
|
||||
echo "-mfloat-abi=${targetPlatform.platform.gcc.float-abi}" >> $out/nix-support/cc-cflags-before
|
||||
''
|
||||
+ optionalString (targetPlatform ? platform.gcc.fpu) ''
|
||||
echo "-mfpu=${targetPlatform.gcc.fpu}" >> $out/nix-support/cc-cflags-before
|
||||
echo "-mfpu=${targetPlatform.platform.gcc.fpu}" >> $out/nix-support/cc-cflags-before
|
||||
''
|
||||
+ optionalString (targetPlatform ? platform.gcc.mode) ''
|
||||
echo "-mmode=${targetPlatform.gcc.mode}" >> $out/nix-support/cc-cflags-before
|
||||
echo "-mmode=${targetPlatform.platform.gcc.mode}" >> $out/nix-support/cc-cflags-before
|
||||
''
|
||||
+ optionalString (targetPlatform ? platform.gcc.tune &&
|
||||
isGccArchSupported targetPlatform.gcc.tune) ''
|
||||
echo "-mtune=${targetPlatform.gcc.tune}" >> $out/nix-support/cc-cflags-before
|
||||
isGccArchSupported targetPlatform.platform.gcc.tune) ''
|
||||
echo "-mtune=${targetPlatform.platform.gcc.tune}" >> $out/nix-support/cc-cflags-before
|
||||
''
|
||||
|
||||
# TODO: categorize these and figure out a better place for them
|
||||
|
||||
@@ -56,13 +56,13 @@ in
|
||||
, prepend ? []
|
||||
|
||||
# Whether to wrap the initramfs in a u-boot image.
|
||||
, makeUInitrd ? stdenvNoCC.hostPlatform.linux-kernel.target == "uImage"
|
||||
, makeUInitrd ? stdenvNoCC.hostPlatform.platform.kernelTarget == "uImage"
|
||||
|
||||
# If generating a u-boot image, the architecture to use. The default
|
||||
# guess may not align with u-boot's nomenclature correctly, so it can
|
||||
# be overridden.
|
||||
# See https://gitlab.denx.de/u-boot/u-boot/-/blob/9bfb567e5f1bfe7de8eb41f8c6d00f49d2b9a426/common/image.c#L81-106 for a list.
|
||||
, uInitrdArch ? stdenvNoCC.hostPlatform.linuxArch
|
||||
, uInitrdArch ? stdenvNoCC.hostPlatform.kernelArch
|
||||
|
||||
# The name of the compression, as recognised by u-boot.
|
||||
# See https://gitlab.denx.de/u-boot/u-boot/-/blob/9bfb567e5f1bfe7de8eb41f8c6d00f49d2b9a426/common/image.c#L195-204 for a list.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{ pkgs
|
||||
, kernel ? pkgs.linux
|
||||
, img ? pkgs.stdenv.hostPlatform.linux-kernel.target
|
||||
, img ? pkgs.stdenv.hostPlatform.platform.kernelTarget
|
||||
, storeDir ? builtins.storeDir
|
||||
, rootModules ?
|
||||
[ "virtio_pci" "virtio_mmio" "virtio_blk" "virtio_balloon" "virtio_rng" "ext4" "unix" "9p" "9pnet_virtio" "crc32c_generic" ]
|
||||
|
||||
Reference in New Issue
Block a user