@@ -0,0 +1,526 @@
1+{ stdenv, fetchurl, noSysDirs
2+, langC ? true, langCC ? true, langFortran ? false
3+, langObjC ? stdenv.isDarwin
4+, langObjCpp ? stdenv.isDarwin
5+, langJava ? false
6+, langAda ? false
7+, langVhdl ? false
8+, langGo ? false
9+, profiledCompiler ? false
10+, staticCompiler ? false
11+, enableShared ? true
12+, texinfo ? null
13+, perl ? null # optional, for texi2pod (then pod2man); required for Java
14+, gmp, mpfr, libmpc, gettext, which
15+, libelf # optional, for link-time optimizations (LTO)
16+, isl ? null # optional, for the Graphite optimization framework.
17+, zlib ? null, boehmgc ? null
18+, zip ? null, unzip ? null, pkgconfig ? null
19+, gtk ? null, libart_lgpl ? null
20+, libX11 ? null, libXt ? null, libSM ? null, libICE ? null, libXtst ? null
21+, libXrender ? null, xproto ? null, renderproto ? null, xextproto ? null
22+, libXrandr ? null, libXi ? null, inputproto ? null, randrproto ? null
23+, x11Support ? langJava
24+, gnatboot ? null
25+, enableMultilib ? false
26+, enablePlugin ? true # whether to support user-supplied plug-ins
27+, name ? "gcc"
28+, cross ? null
29+, binutilsCross ? null
30+, libcCross ? null
31+, crossStageStatic ? true
32+, gnat ? null
33+, libpthread ? null, libpthreadCross ? null # required for GNU/Hurd
34+, stripped ? true
35+, gnused ? null
36+}:
37+
38+assert langJava -> zip != null && unzip != null
39+ && zlib != null && boehmgc != null
40+ && perl != null; # for `--enable-java-home'
41+assert langAda -> gnatboot != null;
42+assert langVhdl -> gnat != null;
43+
44+# LTO needs libelf and zlib.
45+assert libelf != null -> zlib != null;
46+
47+# Make sure we get GNU sed.
48+assert stdenv.isDarwin -> gnused != null;
49+
50+# The go frontend is written in c++
51+assert langGo -> langCC;
52+
53+with stdenv.lib;
54+with builtins;
55+
56+let version = "5.1.0";
57+
58+ # Whether building a cross-compiler for GNU/Hurd.
59+ crossGNU = cross != null && cross.config == "i586-pc-gnu";
60+
61+ enableParallelBuilding = true;
62+
63+ patches = [ ]
64+ ++ optional (cross != null) ./libstdc++-target.patch
65+ ++ optional noSysDirs ./no-sys-dirs.patch
66+ # The GNAT Makefiles did not pay attention to CFLAGS_FOR_TARGET for its
67+ # target libraries and tools.
68+ ++ optional langAda ./gnat-cflags.patch
69+ ++ optional langFortran ./gfortran-driving.patch;
70+
71+ javaEcj = fetchurl {
72+ # The `$(top_srcdir)/ecj.jar' file is automatically picked up at
73+ # `configure' time.
74+
75+ # XXX: Eventually we might want to take it from upstream.
76+ url = "ftp://sourceware.org/pub/java/ecj-4.3.jar";
77+ sha256 = "0jz7hvc0s6iydmhgh5h2m15yza7p2rlss2vkif30vm9y77m97qcx";
78+ };
79+
80+ # Antlr (optional) allows the Java `gjdoc' tool to be built. We want a
81+ # binary distribution here to allow the whole chain to be bootstrapped.
82+ javaAntlr = fetchurl {
83+ url = http://www.antlr.org/download/antlr-4.4-complete.jar;
84+ sha256 = "02lda2imivsvsis8rnzmbrbp8rh1kb8vmq4i67pqhkwz7lf8y6dz";
85+ };
86+
87+ xlibs = [
88+ libX11 libXt libSM libICE libXtst libXrender libXrandr libXi
89+ xproto renderproto xextproto inputproto randrproto
90+ ];
91+
92+ javaAwtGtk = langJava && x11Support;
93+
94+ /* Platform flags */
95+ platformFlags = let
96+ gccArch = stdenv.platform.gcc.arch or null;
97+ gccCpu = stdenv.platform.gcc.cpu or null;
98+ gccAbi = stdenv.platform.gcc.abi or null;
99+ gccFpu = stdenv.platform.gcc.fpu or null;
100+ gccFloat = stdenv.platform.gcc.float or null;
101+ gccMode = stdenv.platform.gcc.mode or null;
102+ withArch = if gccArch != null then " --with-arch=${gccArch}" else "";
103+ withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else "";
104+ withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else "";
105+ withFpu = if gccFpu != null then " --with-fpu=${gccFpu}" else "";
106+ withFloat = if gccFloat != null then " --with-float=${gccFloat}" else "";
107+ withMode = if gccMode != null then " --with-mode=${gccMode}" else "";
108+ in
109+ withArch +
110+ withCpu +
111+ withAbi +
112+ withFpu +
113+ withFloat +
114+ withMode;
115+
116+ /* Cross-gcc settings */
117+ crossMingw = cross != null && cross.libc == "msvcrt";
118+ crossDarwin = cross != null && cross.libc == "libSystem";
119+ crossConfigureFlags = let
120+ gccArch = stdenv.cross.gcc.arch or null;
121+ gccCpu = stdenv.cross.gcc.cpu or null;
122+ gccAbi = stdenv.cross.gcc.abi or null;
123+ gccFpu = stdenv.cross.gcc.fpu or null;
124+ gccFloat = stdenv.cross.gcc.float or null;
125+ gccMode = stdenv.cross.gcc.mode or null;
126+ withArch = if gccArch != null then " --with-arch=${gccArch}" else "";
127+ withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else "";
128+ withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else "";
129+ withFpu = if gccFpu != null then " --with-fpu=${gccFpu}" else "";
130+ withFloat = if gccFloat != null then " --with-float=${gccFloat}" else "";
131+ withMode = if gccMode != null then " --with-mode=${gccMode}" else "";
132+ in
133+ "--target=${cross.config}" +
134+ withArch +
135+ withCpu +
136+ withAbi +
137+ withFpu +
138+ withFloat +
139+ withMode +
140+ (if crossMingw && crossStageStatic then
141+ " --with-headers=${libcCross}/include" +
142+ " --with-gcc" +
143+ " --with-gnu-as" +
144+ " --with-gnu-ld" +
145+ " --with-gnu-ld" +
146+ " --disable-shared" +
147+ " --disable-nls" +
148+ " --disable-debug" +
149+ " --enable-sjlj-exceptions" +
150+ " --enable-threads=win32" +
151+ " --disable-win32-registry"
152+ else if crossStageStatic then
153+ " --disable-libssp --disable-nls" +
154+ " --without-headers" +
155+ " --disable-threads " +
156+ " --disable-libmudflap " +
157+ " --disable-libgomp " +
158+ " --disable-libquadmath" +
159+ " --disable-shared" +
160+ " --disable-libatomic " + # libatomic requires libc
161+ " --disable-decimal-float" # libdecnumber requires libc
162+ else
163+ (if crossDarwin then " --with-sysroot=${libcCross}/share/sysroot"
164+ else " --with-headers=${libcCross}/include") +
165+ # Ensure that -print-prog-name is able to find the correct programs.
166+ (stdenv.lib.optionalString (crossMingw || crossDarwin) (
167+ " --with-as=${binutilsCross}/bin/${cross.config}-as" +
168+ " --with-ld=${binutilsCross}/bin/${cross.config}-ld"
169+ )) +
170+ " --enable-__cxa_atexit" +
171+ " --enable-long-long" +
172+ (if crossMingw then
173+ " --enable-threads=win32" +
174+ " --enable-sjlj-exceptions" +
175+ " --enable-hash-synchronization" +
176+ " --disable-libssp" +
177+ " --disable-nls" +
178+ " --with-dwarf2" +
179+ # I think noone uses shared gcc libs in mingw, so we better do the same.
180+ # In any case, mingw32 g++ linking is broken by default with shared libs,
181+ # unless adding "-lsupc++" to any linking command. I don't know why.
182+ " --disable-shared" +
183+ # To keep ABI compatibility with upstream mingw-w64
184+ " --enable-fully-dynamic-string"
185+ else (if cross.libc == "uclibc" then
186+ # In uclibc cases, libgomp needs an additional '-ldl'
187+ # and as I don't know how to pass it, I disable libgomp.
188+ " --disable-libgomp" else "") +
189+ " --enable-threads=posix" +
190+ " --enable-nls" +
191+ " --disable-decimal-float") # No final libdecnumber (it may work only in 386)
192+ );
193+ stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final";
194+ crossNameAddon = if cross != null then "-${cross.config}" + stageNameAddon else "";
195+
196+ bootstrap = cross == null && !stdenv.isArm && !stdenv.isMips;
197+
198+in
199+
200+# We need all these X libraries when building AWT with GTK+.
201+assert x11Support -> (filter (x: x == null) ([ gtk libart_lgpl ] ++ xlibs)) == [];
202+
203+stdenv.mkDerivation ({
204+ name = "${name}${if stripped then "" else "-debug"}-${version}" + crossNameAddon;
205+
206+ builder = ./builder.sh;
207+
208+ src = fetchurl {
209+ url = "mirror://gnu/gcc/gcc-${version}/gcc-${version}.tar.bz2";
210+ sha256 = "1bd5vj4px3s8nlakbgrh38ynxq4s654m6nxz7lrj03mvkkwgvnmp";
211+ };
212+
213+ inherit patches;
214+
215+ postPatch =
216+ if (stdenv.isGNU
217+ || (libcCross != null # e.g., building `gcc.crossDrv'
218+ && libcCross ? crossConfig
219+ && libcCross.crossConfig == "i586-pc-gnu")
220+ || (crossGNU && libcCross != null))
221+ then
222+ # On GNU/Hurd glibc refers to Hurd & Mach headers and libpthread is not
223+ # in glibc, so add the right `-I' flags to the default spec string.
224+ assert libcCross != null -> libpthreadCross != null;
225+ let
226+ libc = if libcCross != null then libcCross else stdenv.glibc;
227+ gnu_h = "gcc/config/gnu.h";
228+ extraCPPDeps =
229+ libc.propagatedBuildInputs
230+ ++ stdenv.lib.optional (libpthreadCross != null) libpthreadCross
231+ ++ stdenv.lib.optional (libpthread != null) libpthread;
232+ extraCPPSpec =
233+ concatStrings (intersperse " "
234+ (map (x: "-I${x}/include") extraCPPDeps));
235+ extraLibSpec =
236+ if libpthreadCross != null
237+ then "-L${libpthreadCross}/lib ${libpthreadCross.TARGET_LDFLAGS}"
238+ else "-L${libpthread}/lib";
239+ in
240+ '' echo "augmenting \`CPP_SPEC' in \`${gnu_h}' with \`${extraCPPSpec}'..."
241+ sed -i "${gnu_h}" \
242+ -es'|CPP_SPEC *"\(.*\)$|CPP_SPEC "${extraCPPSpec} \1|g'
243+
244+ echo "augmenting \`LIB_SPEC' in \`${gnu_h}' with \`${extraLibSpec}'..."
245+ sed -i "${gnu_h}" \
246+ -es'|LIB_SPEC *"\(.*\)$|LIB_SPEC "${extraLibSpec} \1|g'
247+
248+ echo "setting \`NATIVE_SYSTEM_HEADER_DIR' and \`STANDARD_INCLUDE_DIR' to \`${libc}/include'..."
249+ sed -i "${gnu_h}" \
250+ -es'|#define STANDARD_INCLUDE_DIR.*$|#define STANDARD_INCLUDE_DIR "${libc}/include"|g'
251+ ''
252+ else if cross != null || stdenv.cc.libc != null then
253+ # On NixOS, use the right path to the dynamic linker instead of
254+ # `/lib/ld*.so'.
255+ let
256+ libc = if libcCross != null then libcCross else stdenv.cc.libc;
257+ in
258+ '' echo "fixing the \`GLIBC_DYNAMIC_LINKER' and \`UCLIBC_DYNAMIC_LINKER' macros..."
259+ for header in "gcc/config/"*-gnu.h "gcc/config/"*"/"*.h
260+ do
261+ grep -q LIBC_DYNAMIC_LINKER "$header" || continue
262+ echo " fixing \`$header'..."
263+ sed -i "$header" \
264+ -e 's|define[[:blank:]]*\([UCG]\+\)LIBC_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define \1LIBC_DYNAMIC_LINKER\2 "${libc}\3"|g'
265+ done
266+ ''
267+ else null;
268+
269+ inherit noSysDirs staticCompiler langJava crossStageStatic
270+ libcCross crossMingw;
271+
272+ nativeBuildInputs = [ texinfo which gettext ]
273+ ++ (optional (perl != null) perl)
274+ ++ (optional javaAwtGtk pkgconfig);
275+
276+ buildInputs = [ gmp mpfr libmpc libelf ]
277+ ++ (optional (isl != null) isl)
278+ ++ (optional (zlib != null) zlib)
279+ ++ (optionals langJava [ boehmgc zip unzip ])
280+ ++ (optionals javaAwtGtk ([ gtk libart_lgpl ] ++ xlibs))
281+ ++ (optionals (cross != null) [binutilsCross])
282+ ++ (optionals langAda [gnatboot])
283+ ++ (optionals langVhdl [gnat])
284+
285+ # The builder relies on GNU sed (for instance, Darwin's `sed' fails with
286+ # "-i may not be used with stdin"), and `stdenvNative' doesn't provide it.
287+ ++ (optional stdenv.isDarwin gnused)
288+ ;
289+
290+ NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isSunOS "-lm -ldl";
291+
292+ preConfigure = stdenv.lib.optionalString (stdenv.isSunOS && stdenv.is64bit) ''
293+ export NIX_LDFLAGS=`echo $NIX_LDFLAGS | sed -e s~$prefix/lib~$prefix/lib/amd64~g`
294+ export LDFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $LDFLAGS_FOR_TARGET"
295+ export CXXFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $CXXFLAGS_FOR_TARGET"
296+ export CFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $CFLAGS_FOR_TARGET"
297+ '' + stdenv.lib.optionalString stdenv.isDarwin ''
298+ if SDKROOT=$(/usr/bin/xcrun --show-sdk-path); then
299+ configureFlagsArray+=(--with-native-system-header-dir=$SDKROOT/usr/include)
300+ makeFlagsArray+=( \
301+ CFLAGS_FOR_BUILD=-F$SDKROOT/System/Library/Frameworks \
302+ CFLAGS_FOR_TARGET=-F$SDKROOT/System/Library/Frameworks \
303+ FLAGS_FOR_TARGET=-F$SDKROOT/System/Library/Frameworks \
304+ )
305+ fi
306+ '';
307+
308+ dontDisableStatic = true;
309+
310+ configureFlags = "
311+ ${if stdenv.isSunOS then
312+ " --enable-long-long --enable-libssp --enable-threads=posix --disable-nls --enable-__cxa_atexit " +
313+ # On Illumos/Solaris GNU as is preferred
314+ " --with-gnu-as --without-gnu-ld "
315+ else ""}
316+ --enable-lto
317+ ${if enableMultilib then "--disable-libquadmath" else "--disable-multilib"}
318+ ${if enableShared then "" else "--disable-shared"}
319+ ${if enablePlugin then "--enable-plugin" else "--disable-plugin"}
320+ ${optionalString (isl != null) "--with-isl=${isl}"}
321+ ${if langJava then
322+ "--with-ecj-jar=${javaEcj} " +
323+
324+ # Follow Sun's layout for the convenience of IcedTea/OpenJDK. See
325+ # <http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2010-April/008888.html>.
326+ "--enable-java-home --with-java-home=\${prefix}/lib/jvm/jre "
327+ else ""}
328+ ${if javaAwtGtk then "--enable-java-awt=gtk" else ""}
329+ ${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr}" else ""}
330+ --with-gmp=${gmp}
331+ --with-mpfr=${mpfr}
332+ --with-mpc=${libmpc}
333+ ${if libelf != null then "--with-libelf=${libelf}" else ""}
334+ --disable-libstdcxx-pch
335+ --without-included-gettext
336+ --with-system-zlib
337+ --enable-static
338+ --enable-languages=${
339+ concatStrings (intersperse ","
340+ ( optional langC "c"
341+ ++ optional langCC "c++"
342+ ++ optional langFortran "fortran"
343+ ++ optional langJava "java"
344+ ++ optional langAda "ada"
345+ ++ optional langVhdl "vhdl"
346+ ++ optional langGo "go"
347+ ++ optional langObjC "objc"
348+ ++ optional langObjCpp "obj-c++"
349+ ++ optionals crossDarwin [ "objc" "obj-c++" ]
350+ )
351+ )
352+ }
353+ ${if (stdenv ? glibc && cross == null)
354+ then " --with-native-system-header-dir=${stdenv.glibc}/include"
355+ else ""}
356+ ${if langAda then " --enable-libada" else ""}
357+ ${if cross == null && stdenv.isi686 then "--with-arch=i686" else ""}
358+ ${if cross != null then crossConfigureFlags else ""}
359+ ${if !bootstrap then "--disable-bootstrap" else ""}
360+ ${if cross == null then platformFlags else ""}
361+ ";
362+
363+ targetConfig = if cross != null then cross.config else null;
364+
365+ buildFlags = if bootstrap then
366+ (if profiledCompiler then "profiledbootstrap" else "bootstrap")
367+ else "";
368+
369+ installTargets =
370+ if stripped
371+ then "install-strip"
372+ else "install";
373+
374+ crossAttrs = let
375+ xgccArch = stdenv.cross.gcc.arch or null;
376+ xgccCpu = stdenv.cross.gcc.cpu or null;
377+ xgccAbi = stdenv.cross.gcc.abi or null;
378+ xgccFpu = stdenv.cross.gcc.fpu or null;
379+ xgccFloat = stdenv.cross.gcc.float or null;
380+ xwithArch = if xgccArch != null then " --with-arch=${xgccArch}" else "";
381+ xwithCpu = if xgccCpu != null then " --with-cpu=${xgccCpu}" else "";
382+ xwithAbi = if xgccAbi != null then " --with-abi=${xgccAbi}" else "";
383+ xwithFpu = if xgccFpu != null then " --with-fpu=${xgccFpu}" else "";
384+ xwithFloat = if xgccFloat != null then " --with-float=${xgccFloat}" else "";
385+ in {
386+ AR = "${stdenv.cross.config}-ar";
387+ LD = "${stdenv.cross.config}-ld";
388+ CC = "${stdenv.cross.config}-gcc";
389+ CXX = "${stdenv.cross.config}-gcc";
390+ AR_FOR_TARGET = "${stdenv.cross.config}-ar";
391+ LD_FOR_TARGET = "${stdenv.cross.config}-ld";
392+ CC_FOR_TARGET = "${stdenv.cross.config}-gcc";
393+ NM_FOR_TARGET = "${stdenv.cross.config}-nm";
394+ CXX_FOR_TARGET = "${stdenv.cross.config}-g++";
395+ # If we are making a cross compiler, cross != null
396+ NIX_CC_CROSS = if cross == null then "${stdenv.ccCross}" else "";
397+ dontStrip = true;
398+ configureFlags = ''
399+ ${if enableMultilib then "" else "--disable-multilib"}
400+ ${if enableShared then "" else "--disable-shared"}
401+ ${if langJava then "--with-ecj-jar=${javaEcj.crossDrv}" else ""}
402+ ${if javaAwtGtk then "--enable-java-awt=gtk" else ""}
403+ ${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr.crossDrv}" else ""}
404+ --with-gmp=${gmp.crossDrv}
405+ --with-mpfr=${mpfr.crossDrv}
406+ --disable-libstdcxx-pch
407+ --without-included-gettext
408+ --with-system-zlib
409+ --enable-languages=${
410+ concatStrings (intersperse ","
411+ ( optional langC "c"
412+ ++ optional langCC "c++"
413+ ++ optional langFortran "fortran"
414+ ++ optional langJava "java"
415+ ++ optional langAda "ada"
416+ ++ optional langVhdl "vhdl"
417+ ++ optional langGo "go"
418+ )
419+ )
420+ }
421+ ${if langAda then " --enable-libada" else ""}
422+ --target=${stdenv.cross.config}
423+ ${xwithArch}
424+ ${xwithCpu}
425+ ${xwithAbi}
426+ ${xwithFpu}
427+ ${xwithFloat}
428+ '';
429+ buildFlags = "";
430+ };
431+
432+
433+ # Needed for the cross compilation to work
434+ AR = "ar";
435+ LD = "ld";
436+ # http://gcc.gnu.org/install/specific.html#x86-64-x-solaris210
437+ CC = if stdenv.system == "x86_64-solaris" then "gcc -m64" else "gcc";
438+
439+ # Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find
440+ # the library headers and binaries, regarless of the language being
441+ # compiled.
442+
443+ # Note: When building the Java AWT GTK+ peer, the build system doesn't
444+ # honor `--with-gmp' et al., e.g., when building
445+ # `libjava/classpath/native/jni/java-math/gnu_java_math_GMP.c', so we just
446+ # add them to $CPATH and $LIBRARY_PATH in this case.
447+ #
448+ # Likewise, the LTO code doesn't find zlib.
449+
450+ CPATH = concatStrings
451+ (intersperse ":" (map (x: x + "/include")
452+ (optionals (zlib != null) [ zlib ]
453+ ++ optionals langJava [ boehmgc ]
454+ ++ optionals javaAwtGtk xlibs
455+ ++ optionals javaAwtGtk [ gmp mpfr ]
456+ ++ optional (libpthread != null) libpthread
457+ ++ optional (libpthreadCross != null) libpthreadCross
458+
459+ # On GNU/Hurd glibc refers to Mach & Hurd
460+ # headers.
461+ ++ optionals (libcCross != null && libcCross ? "propagatedBuildInputs" )
462+ libcCross.propagatedBuildInputs)));
463+
464+ LIBRARY_PATH = concatStrings
465+ (intersperse ":" (map (x: x + "/lib")
466+ (optionals (zlib != null) [ zlib ]
467+ ++ optionals langJava [ boehmgc ]
468+ ++ optionals javaAwtGtk xlibs
469+ ++ optionals javaAwtGtk [ gmp mpfr ]
470+ ++ optional (libpthread != null) libpthread)));
471+
472+ EXTRA_TARGET_CFLAGS =
473+ if cross != null && libcCross != null
474+ then "-idirafter ${libcCross}/include"
475+ else null;
476+
477+ EXTRA_TARGET_LDFLAGS =
478+ if cross != null && libcCross != null
479+ then "-B${libcCross}/lib -Wl,-L${libcCross}/lib" +
480+ (optionalString (libpthreadCross != null)
481+ " -L${libpthreadCross}/lib -Wl,${libpthreadCross.TARGET_LDFLAGS}")
482+ else null;
483+
484+ passthru =
485+ { inherit langC langCC langObjC langObjCpp langAda langFortran langVhdl langGo version; isGNU = true; };
486+
487+ inherit enableParallelBuilding enableMultilib;
488+
489+ inherit (stdenv) is64bit;
490+
491+ meta = {
492+ homepage = http://gcc.gnu.org/;
493+ license = stdenv.lib.licenses.gpl3Plus; # runtime support libraries are typically LGPLv3+
494+ description = "GNU Compiler Collection, version ${version}"
495+ + (if stripped then "" else " (with debugging info)");
496+
497+ longDescription = ''
498+ The GNU Compiler Collection includes compiler front ends for C, C++,
499+ Objective-C, Fortran, OpenMP for C/C++/Fortran, Java, and Ada, as well
500+ as libraries for these languages (libstdc++, libgcj, libgomp,...).
501+
502+ GCC development is a part of the GNU Project, aiming to improve the
503+ compiler used in the GNU system including the GNU/Linux variant.
504+ '';
505+
506+ maintainers = with stdenv.lib.maintainers; [ viric shlevy simons ];
507+
508+ # gnatboot is not available out of linux platforms, so we disable the darwin build
509+ # for the gnat (ada compiler).
510+ platforms =
511+ stdenv.lib.platforms.linux ++
512+ stdenv.lib.platforms.freebsd ++
513+ optionals (langAda == false) stdenv.lib.platforms.darwin;
514+ };
515+}
516+
517+// optionalAttrs (cross != null && cross.libc == "msvcrt" && crossStageStatic) {
518+ makeFlags = [ "all-gcc" "all-target-libgcc" ];
519+ installTargets = "install-gcc install-target-libgcc";
520+}
521+
522+# Strip kills static libs of other archs (hence cross != null)
523+// optionalAttrs (!stripped || cross != null) { dontStrip = true; NIX_STRIP_DEBUG = 0; }
524+
525+// optionalAttrs (enableMultilib) { dontMoveLib64 = true; }
526+)