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