···1+{ lib
2+, stdenv
3+}:
4+5+# Trick to build a gcc that is capable of emitting shared libraries *without* having the
6+# targetPlatform libc available beforehand. Taken from:
7+# https://web.archive.org/web/20170222224855/http://frank.harvard.edu/~coldwell/toolchain/
8+# https://web.archive.org/web/20170224235700/http://frank.harvard.edu/~coldwell/toolchain/t-linux.diff
9+let
10+ # crt{i,n}.o are the first and last (respectively) object file
11+ # linked when producing an executable. Traditionally these
12+ # files are delivered as part of the C library, but on GNU
13+ # systems they are in fact built by GCC. Since libgcc needs to
14+ # build before glibc, we can't wait for them to be copied by
15+ # glibc. At this early pre-glibc stage these files sometimes
16+ # have different names.
17+ crtstuff-ofiles =
18+ if stdenv.targetPlatform.isPower
19+ then "ecrti.o ecrtn.o ncrti.o ncrtn.o"
20+ else "crti.o crtn.o";
21+22+ # Normally, `SHLIB_LC` is set to `-lc`, which means that
23+ # `libgcc_s.so` cannot be built until `libc.so` is available.
24+ # The assignment below clobbers this variable, removing the
25+ # `-lc`.
26+ #
27+ # On PowerPC we add `-mnewlib`, which means "libc has not been
28+ # built yet". This causes libgcc's Makefile to use the
29+ # gcc-built `{e,n}crt{n,i}.o` instead of failing to find the
30+ # versions which have been repackaged in libc as `crt{n,i}.o`
31+ #
32+ SHLIB_LC = lib.optionalString stdenv.targetPlatform.isPower "-mnewlib";
33+34+in ''
35+ echo 'libgcc.a: ${crtstuff-ofiles}' >> libgcc/Makefile.in
36+ echo 'SHLIB_LC=${SHLIB_LC}' >> libgcc/Makefile.in
37+ ''
+7-7
pkgs/development/compilers/gcc/common/libgcc.nix
···44 !langJit &&
45 !stdenv.hostPlatform.isDarwin &&
46 enableShared
47- ;
4849- # For some reason libgcc_s.so has major-version "2" on m68k but
50- # "1" everywhere else. Might be worth changing this to "*".
51- libgcc_s-version-major =
52- if targetPlatform.isM68k
53- then "2"
54- else "1";
5556in
57(pkg: pkg.overrideAttrs (previousAttrs: lib.optionalAttrs ((!langC) || langJit || enableLibGccOutput) {
···44 !langJit &&
45 !stdenv.hostPlatform.isDarwin &&
46 enableShared
47+ ;
4849+ # For some reason libgcc_s.so has major-version "2" on m68k but
50+ # "1" everywhere else. Might be worth changing this to "*".
51+ libgcc_s-version-major =
52+ if targetPlatform.isM68k
53+ then "2"
54+ else "1";
5556in
57(pkg: pkg.overrideAttrs (previousAttrs: lib.optionalAttrs ((!langC) || langJit || enableLibGccOutput) {
···112 export inhibit_libc=true
113''
114115-# Trick to build a gcc that is capable of emitting shared libraries *without* having the
116-# targetPlatform libc available beforehand. Taken from:
117-# https://web.archive.org/web/20170222224855/http://frank.harvard.edu/~coldwell/toolchain/
118-# https://web.archive.org/web/20170224235700/http://frank.harvard.edu/~coldwell/toolchain/t-linux.diff
119+ lib.optionalString (targetPlatform != hostPlatform && withoutTargetLibc && enableShared)
120- (let
121-122- # crt{i,n}.o are the first and last (respectively) object file
123- # linked when producing an executable. Traditionally these
124- # files are delivered as part of the C library, but on GNU
125- # systems they are in fact built by GCC. Since libgcc needs to
126- # build before glibc, we can't wait for them to be copied by
127- # glibc. At this early pre-glibc stage these files sometimes
128- # have different names.
129- crtstuff-ofiles =
130- if targetPlatform.isPower
131- then "ecrti.o ecrtn.o ncrti.o ncrtn.o"
132- else "crti.o crtn.o";
133-134- # Normally, `SHLIB_LC` is set to `-lc`, which means that
135- # `libgcc_s.so` cannot be built until `libc.so` is available.
136- # The assignment below clobbers this variable, removing the
137- # `-lc`.
138- #
139- # On PowerPC we add `-mnewlib`, which means "libc has not been
140- # built yet". This causes libgcc's Makefile to use the
141- # gcc-built `{e,n}crt{n,i}.o` instead of failing to find the
142- # versions which have been repackaged in libc as `crt{n,i}.o`
143- #
144- SHLIB_LC = lib.optionalString targetPlatform.isPower "-mnewlib";
145-146- in ''
147- echo 'libgcc.a: ${crtstuff-ofiles}' >> libgcc/Makefile.in
148- echo 'SHLIB_LC=${SHLIB_LC}' >> libgcc/Makefile.in
149- '')
150-
···115 in
116 pkgs.runCommand "test-mbuffer" {} ''
117 echo hello | ${emulator} ${mbuffer}/bin/mbuffer
0118 '';
119120 # This is meant to be a carefully curated list of builds/packages
···127 # of things that often break. So, no buckshot `mapTestOnCross`
128 # calls here.
129 sanity = [
130- #pkgs.mbuffer # https://github.com/NixOS/nixpkgs/issues/213453
131 #pkgs.pkgsCross.gnu64.bash # https://github.com/NixOS/nixpkgs/issues/243164
132 pkgs.gcc_multi.cc
133 pkgs.pkgsMusl.stdenv
134 pkgs.pkgsLLVM.stdenv
135 pkgs.pkgsStatic.bash
136 pkgs.pkgsCross.arm-embedded.stdenv
0137 pkgs.pkgsCross.m68k.stdenv
138 pkgs.pkgsCross.aarch64-multiplatform.pkgsBuildTarget.gcc
139 pkgs.pkgsCross.powernv.pkgsBuildTarget.gcc
···115 in
116 pkgs.runCommand "test-mbuffer" {} ''
117 echo hello | ${emulator} ${mbuffer}/bin/mbuffer
118+ touch $out
119 '';
120121 # This is meant to be a carefully curated list of builds/packages
···128 # of things that often break. So, no buckshot `mapTestOnCross`
129 # calls here.
130 sanity = [
131+ mbuffer
132 #pkgs.pkgsCross.gnu64.bash # https://github.com/NixOS/nixpkgs/issues/243164
133 pkgs.gcc_multi.cc
134 pkgs.pkgsMusl.stdenv
135 pkgs.pkgsLLVM.stdenv
136 pkgs.pkgsStatic.bash
137 pkgs.pkgsCross.arm-embedded.stdenv
138+ pkgs.pkgsCross.armv7l-hf-multiplatform.stdenv
139 pkgs.pkgsCross.m68k.stdenv
140 pkgs.pkgsCross.aarch64-multiplatform.pkgsBuildTarget.gcc
141 pkgs.pkgsCross.powernv.pkgsBuildTarget.gcc
-1
pkgs/top-level/aliases.nix
···879 liberation_ttf_v1_from_source = throw "'liberation_ttf_v1_from_source' has been renamed to/replaced by 'liberation_ttf_v1'"; # Converted to throw 2022-02-22
880 liberation_ttf_v2_from_source = throw "'liberation_ttf_v2_from_source' has been renamed to/replaced by 'liberation_ttf_v2'"; # Converted to throw 2022-02-22
881 liberationsansnarrow = throw "'liberationsansnarrow' has been renamed to/replaced by 'liberation-sans-narrow'"; # Converted to throw 2022-02-22
882- libgcc = throw "libgcc was removed, use gcc.cc.libgcc if needed"; # added 2023-05-13
883 libgksu = throw "libgksu has been removed"; # Added 2022-01-16
884 libgme = game-music-emu; # Added 2022-07-20
885 libgnome_keyring = throw "'libgnome_keyring' has been renamed to/replaced by 'libgnome-keyring'"; # Converted to throw 2022-02-22
···879 liberation_ttf_v1_from_source = throw "'liberation_ttf_v1_from_source' has been renamed to/replaced by 'liberation_ttf_v1'"; # Converted to throw 2022-02-22
880 liberation_ttf_v2_from_source = throw "'liberation_ttf_v2_from_source' has been renamed to/replaced by 'liberation_ttf_v2'"; # Converted to throw 2022-02-22
881 liberationsansnarrow = throw "'liberationsansnarrow' has been renamed to/replaced by 'liberation-sans-narrow'"; # Converted to throw 2022-02-22
0882 libgksu = throw "libgksu has been removed"; # Added 2022-01-16
883 libgme = game-music-emu; # Added 2022-07-20
884 libgnome_keyring = throw "'libgnome_keyring' has been renamed to/replaced by 'libgnome-keyring'"; # Converted to throw 2022-02-22
+7
pkgs/top-level/all-packages.nix
···1891818919 librarian-puppet-go = callPackage ../development/tools/librarian-puppet-go { };
189200018921 # This is for e.g. LLVM libraries on linux.
18922 gccForLibs =
18923 if stdenv.targetPlatform == stdenv.hostPlatform && targetPackages.stdenv.cc.isGNU
···21444 # Being redundant to avoid cycles on boot. TODO: find a better way
21445 glibcCross = callPackage ../development/libraries/glibc {
21446 stdenv = gccCrossLibcStdenv; # doesn't compile without gcc
0000021447 };
2144821449 muslCross = musl.override {
···1891818919 librarian-puppet-go = callPackage ../development/tools/librarian-puppet-go { };
1892018921+ libgcc = stdenv.cc.cc.libgcc or null;
18922+18923 # This is for e.g. LLVM libraries on linux.
18924 gccForLibs =
18925 if stdenv.targetPlatform == stdenv.hostPlatform && targetPackages.stdenv.cc.isGNU
···21446 # Being redundant to avoid cycles on boot. TODO: find a better way
21447 glibcCross = callPackage ../development/libraries/glibc {
21448 stdenv = gccCrossLibcStdenv; # doesn't compile without gcc
21449+ libgcc = callPackage ../development/libraries/gcc/libgcc {
21450+ gcc = gccCrossLibcStdenv.cc;
21451+ glibc = glibcCross.override { libgcc = null; };
21452+ stdenvNoLibs = gccCrossLibcStdenv;
21453+ };
21454 };
2145521456 muslCross = musl.override {