about summary refs log tree commit diff
path: root/pkgs/development/libraries/gcc/libgcc/default.nix
diff options
context:
space:
mode:
authorAdam Joseph <adam@westernsemico.com>2023-08-08 01:59:55 -0700
committerAdam Joseph <adam@westernsemico.com>2023-08-14 15:08:27 -0700
commit72fa5978fd45925df9e09b829e23bb429250b898 (patch)
tree4f4c8166f7bc718a54065a5117aae5517475d48c /pkgs/development/libraries/gcc/libgcc/default.nix
parentfcaa5a7556760d520dc78d99ada5a58fc13c7894 (diff)
libgcc: minor formatting adjustments
Diffstat (limited to 'pkgs/development/libraries/gcc/libgcc/default.nix')
-rw-r--r--pkgs/development/libraries/gcc/libgcc/default.nix26
1 files changed, 8 insertions, 18 deletions
diff --git a/pkgs/development/libraries/gcc/libgcc/default.nix b/pkgs/development/libraries/gcc/libgcc/default.nix
index 835956055448b..c505d69d573db 100644
--- a/pkgs/development/libraries/gcc/libgcc/default.nix
+++ b/pkgs/development/libraries/gcc/libgcc/default.nix
@@ -24,30 +24,19 @@ stdenvNoLibs.mkDerivation rec {
 
   hardeningDisable = [ "pie" ];
 
-  preConfigure = ''
-    cd "$buildRoot"
+  preConfigure =
   ''
-
-  # Drop in libiberty, as external builds are not expected
-  + ''
+    # Drop in libiberty, as external builds are not expected
+    cd "$buildRoot"
     (
       mkdir -p build-${stdenvNoLibs.buildPlatform.config}/libiberty/
       cd build-${stdenvNoLibs.buildPlatform.config}/libiberty/
       ln -s ${buildPackages.libiberty}/lib/libiberty.a ./
     )
-  ''
-  # A few misc bits of gcc need to be built.
-  #
-  #  - We "shift" the tools over to fake platforms perspective from the previous
-  #    stage.
-  #
-  #  - We define GENERATOR_FILE so nothing bothers looking for GNU GMP.
-  #
-  #  - We remove the `libgcc.mvar` deps so that the bootstrap xgcc isn't built.
-  + ''
     mkdir -p "$buildRoot/gcc"
     cd "$buildRoot/gcc"
     (
+      # We "shift" the tools over to fake platforms perspective from the previous stage.
       export AS_FOR_BUILD=${buildPackages.stdenv.cc}/bin/$AS_FOR_BUILD
       export CC_FOR_BUILD=${buildPackages.stdenv.cc}/bin/$CC_FOR_BUILD
       export CPP_FOR_BUILD=${buildPackages.stdenv.cc}/bin/$CPP_FOR_BUILD
@@ -65,10 +54,12 @@ stdenvNoLibs.mkDerivation rec {
       export CPP_FOR_TARGET=${stdenvNoLibs.cc}/bin/$CPP
       export LD_FOR_TARGET=${stdenvNoLibs.cc.bintools}/bin/$LD
 
+      # We define GENERATOR_FILE so nothing bothers looking for GNU GMP.
       export NIX_CFLAGS_COMPILE_FOR_BUILD+=' -DGENERATOR_FILE=1'
 
       "$sourceRoot/../gcc/configure" $gccConfigureFlags
 
+      # We remove the `libgcc.mvar` deps so that the bootstrap xgcc isn't built.
       sed -e 's,libgcc.mvars:.*$,libgcc.mvars:,' -i Makefile
 
       make \
@@ -81,9 +72,8 @@ stdenvNoLibs.mkDerivation rec {
         insn-modes.h
     )
     mkdir -p "$buildRoot/gcc/include"
-  ''
-  # Preparing to configure + build libgcc itself
-  + ''
+
+    # Preparing to configure + build libgcc itself
     mkdir -p "$buildRoot/gcc/${stdenvNoLibs.hostPlatform.config}/libgcc"
     cd "$buildRoot/gcc/${stdenvNoLibs.hostPlatform.config}/libgcc"
     configureScript=$sourceRoot/configure