diff options
author | volth <volth@webmaster.ms> | 2017-12-13 07:02:42 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-13 07:02:42 +0000 |
commit | 45121d9dfcde678f8d88aee8fad02c6873510fb9 (patch) | |
tree | 798d4d4f52996af8ffa3d748cd9377e4b37b31a0 /pkgs/development/compilers | |
parent | 683337d5f579bba7042d065741112753fc9a1967 (diff) | |
parent | 3ec3de2ca4ddba5b1df2b31fb22856a25cc96218 (diff) | |
download | nixlib-45121d9dfcde678f8d88aee8fad02c6873510fb9.tar nixlib-45121d9dfcde678f8d88aee8fad02c6873510fb9.tar.gz nixlib-45121d9dfcde678f8d88aee8fad02c6873510fb9.tar.bz2 nixlib-45121d9dfcde678f8d88aee8fad02c6873510fb9.tar.lz nixlib-45121d9dfcde678f8d88aee8fad02c6873510fb9.tar.xz nixlib-45121d9dfcde678f8d88aee8fad02c6873510fb9.tar.zst nixlib-45121d9dfcde678f8d88aee8fad02c6873510fb9.zip |
Merge branch 'master' into oracle-jdk-remove-redundand-asserts
Diffstat (limited to 'pkgs/development/compilers')
30 files changed, 762 insertions, 853 deletions
diff --git a/pkgs/development/compilers/arachne-pnr/default.nix b/pkgs/development/compilers/arachne-pnr/default.nix index 7db75d129781..1e7791c84c44 100644 --- a/pkgs/development/compilers/arachne-pnr/default.nix +++ b/pkgs/development/compilers/arachne-pnr/default.nix @@ -2,13 +2,13 @@ stdenv.mkDerivation rec { name = "arachne-pnr-${version}"; - version = "2017.11.05"; + version = "2017.12.06"; src = fetchFromGitHub { owner = "cseed"; repo = "arachne-pnr"; - rev = "1e81432830c75c505c76e419619f605a6c4c7583"; - sha256 = "0lzblmi1klbsmd32h8nh027npm1z1a199lng13lcrqwr17lhb7my"; + rev = "a32dd2c137b2bb6ba6704b25109790ac76bc2f45"; + sha256 = "16pfm8spcm3nsrdsjdj22v7dddnwzlhbj1y71wflvvb84xnbga2y"; }; enableParallelBuilding = true; diff --git a/pkgs/development/compilers/ats2/default.nix b/pkgs/development/compilers/ats2/default.nix index 3abd5c8c82a9..6c523ebb4f14 100644 --- a/pkgs/development/compilers/ats2/default.nix +++ b/pkgs/development/compilers/ats2/default.nix @@ -3,11 +3,11 @@ , withContrib ? true }: let - versionPkg = "0.3.0" ; + versionPkg = "0.3.7" ; contrib = fetchurl { url = "mirror://sourceforge/ats2-lang/ATS2-Postiats-contrib-${versionPkg}.tgz" ; - sha256 = "1s4yscisn9gsr692jmh4y5mz03012pv84cm7l5n51v83wc08fks0" ; + sha256 = "1w59ir9ij5bvvnxj6fb1rvzycfqa57i31wmpwawxbsb10bqwzyr6"; }; postInstallContrib = stdenv.lib.optionalString withContrib @@ -31,11 +31,9 @@ stdenv.mkDerivation rec { src = fetchurl { url = "mirror://sourceforge/ats2-lang/ATS2-Postiats-${version}.tgz"; - sha256 = "1knf03r8a5sis7n8rw54flf1lxfbr3prywxb1czcdp6hsbcd1v1d"; + sha256 = "19nxyi39fn42sp38kl14a6pvbxq9wr8y405wx0zz7mqb77r0m0h5"; }; - patches = [ ./install-postiats-contrib.patch ]; - buildInputs = [ gmp ]; setupHook = with stdenv.lib; diff --git a/pkgs/development/compilers/ats2/install-postiats-contrib.patch b/pkgs/development/compilers/ats2/install-postiats-contrib.patch deleted file mode 100644 index cb280d028b52..000000000000 --- a/pkgs/development/compilers/ats2/install-postiats-contrib.patch +++ /dev/null @@ -1,19 +0,0 @@ -Install the parts of the contrib that have been moved to Postiats. -diff -Naur ATS2-Postiats-0.3.0-upstream/Makefile_dist ATS2-Postiats-0.3.0/Makefile_dist ---- ATS2-Postiats-0.3.0-upstream/Makefile_dist 2017-01-20 10:23:54.000000000 -0400 -+++ ATS2-Postiats-0.3.0/Makefile_dist 2017-01-21 13:14:27.614723335 -0400 -@@ -124,12 +124,12 @@ - cd "$(abs_top_srcdir)" && \ - $(MKDIR_P) $(PATSLIBHOME2)/bin && \ - if [ ! -d $(bindir2) ] ; then $(MKDIR_P) $(bindir2) ; fi && \ -- for x in share ccomp prelude libc libats ; do \ -+ for x in share ccomp prelude libc libats contrib atscntrb ; do \ - find "$$x" -type d -exec $(MKDIR_P) $(PATSLIBHOME2)/\{} \; -print; \ - done - - install_files_0: install_dirs ; \ -- for x in share ccomp/runtime prelude libc libats ; do \ -+ for x in share ccomp/runtime prelude libc libats contrib atscntrb ; do \ - cd "$(abs_top_srcdir)" && \ - $(INSTALL) -d $(PATSLIBHOME2)/"$$x" && \ - find "$$x" -type l -exec cp -d \{} $(PATSLIBHOME2)/\{} \; -print && \ diff --git a/pkgs/development/compilers/dmd/default.nix b/pkgs/development/compilers/dmd/default.nix index d20d2a7e8ed9..875e60dd6dc5 100644 --- a/pkgs/development/compilers/dmd/default.nix +++ b/pkgs/development/compilers/dmd/default.nix @@ -278,10 +278,12 @@ stdenv.mkDerivation rec { inherit phobosUnittests; name = "dmd-${version}"; phases = "installPhase"; + buildInputs = dmdBuild.buildInputs; installPhase = '' mkdir $out cp -r --symbolic-link ${dmdBuild}/* $out/ ''; + meta = dmdBuild.meta; } diff --git a/pkgs/development/compilers/fpc/lazarus.nix b/pkgs/development/compilers/fpc/lazarus.nix index 704d9d5be645..e646debd9d7e 100644 --- a/pkgs/development/compilers/fpc/lazarus.nix +++ b/pkgs/development/compilers/fpc/lazarus.nix @@ -8,10 +8,10 @@ stdenv, fetchurl let s = rec { - version = "1.6"; - versionSuffix = ".0-0"; + version = "1.8.0"; + versionSuffix = ""; url = "mirror://sourceforge/lazarus/Lazarus%20Zip%20_%20GZip/Lazarus%20${version}/lazarus-${version}${versionSuffix}.tar.gz"; - sha256 = "1a1w9yibi0rsr51bl7csnq6mr59x0934850kiabs80nr3sz05knb"; + sha256 = "0i58ngrr1vjyazirfmz0cgikglc02z1m0gcrsfw9awpi3ax8h21j"; name = "lazarus-${version}"; }; buildInputs = [ diff --git a/pkgs/development/compilers/gcc/4.5/default.nix b/pkgs/development/compilers/gcc/4.5/default.nix index 088a64ff5438..b41d22f4f539 100644 --- a/pkgs/development/compilers/gcc/4.5/default.nix +++ b/pkgs/development/compilers/gcc/4.5/default.nix @@ -25,6 +25,7 @@ , libpthread ? null, libpthreadCross ? null # required for GNU/Hurd , stripped ? true , buildPlatform, hostPlatform, targetPlatform +, buildPackages }: assert langJava -> zip != null && unzip != null @@ -63,16 +64,26 @@ let version = "4.5.4"; javaAwtGtk = langJava && gtk2 != null; + /* Platform flags */ + platformFlags = let + gccArch = targetPlatform.platform.gcc.arch or null; + gccCpu = targetPlatform.platform.gcc.cpu or null; + gccAbi = targetPlatform.platform.gcc.abi or null; + gccFpu = targetPlatform.platform.gcc.fpu or null; + gccFloat = targetPlatform.platform.gcc.float or null; + gccMode = targetPlatform.platform.gcc.mode or null; + in + optional (gccArch != null) "--with-arch=${gccArch}" ++ + optional (gccCpu != null) "--with-cpu=${gccCpu}" ++ + optional (gccAbi != null) "--with-abi=${gccAbi}" ++ + optional (gccFpu != null) "--with-fpu=${gccFpu}" ++ + optional (gccFloat != null) "--with-float=${gccFloat}" ++ + optional (gccMode != null) "--with-mode=${gccMode}"; + /* Cross-gcc settings */ - gccArch = stdenv.lib.attrByPath [ "gcc" "arch" ] null targetPlatform; - gccCpu = stdenv.lib.attrByPath [ "gcc" "cpu" ] null targetPlatform; - gccAbi = stdenv.lib.attrByPath [ "gcc" "abi" ] null targetPlatform; crossMingw = (targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt"); crossConfigureFlags = - optional (gccArch != null) "--with-arch=${gccArch}" ++ - optional (gccCpu != null) "--with-cpu=${gccCpu}" ++ - optional (gccAbi != null) "--with-abi=${gccAbi}" ++ # Ensure that -print-prog-name is able to find the correct programs. [ "--with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" "--with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" ] ++ @@ -248,6 +259,8 @@ stdenv.mkDerivation ({ "--with-mpc=${libmpc}" ] ++ optional (libelf != null) "--with-libelf=${libelf}" ++ + optional (!(crossMingw && crossStageStatic)) + "--with-native-system-header-dir=${getDev stdenv.cc.libc}/include" ++ # Basic configuration [ @@ -288,7 +301,7 @@ stdenv.mkDerivation ({ # Ada optional langAda "--enable-libada" ++ - # Cross-compilation + platformFlags ++ optional (targetPlatform != hostPlatform) crossConfigureFlags ++ # Platform-specific flags @@ -299,72 +312,72 @@ stdenv.mkDerivation ({ targetConfig = if targetPlatform != hostPlatform then targetPlatform.config else null; + /* For cross-built gcc (build != host == target) */ crossAttrs = { + AR_FOR_BUILD = "ar"; + AS_FOR_BUILD = "as"; + LD_FOR_BUILD = "ld"; + NM_FOR_BUILD = "nm"; + OBJCOPY_FOR_BUILD = "objcopy"; + OBJDUMP_FOR_BUILD = "objdump"; + RANLIB_FOR_BUILD = "ranlib"; + SIZE_FOR_BUILD = "size"; + STRINGS_FOR_BUILD = "strings"; + STRIP_FOR_BUILD = "strip"; + CC_FOR_BUILD = "gcc"; + CXX_FOR_BUILD = "g++"; + AR = "${targetPlatform.config}-ar"; + AS = "${targetPlatform.config}-as"; LD = "${targetPlatform.config}-ld"; + NM = "${targetPlatform.config}-nm"; + OBJCOPY = "${targetPlatform.config}-objcopy"; + OBJDUMP = "${targetPlatform.config}-objdump"; + RANLIB = "${targetPlatform.config}-ranlib"; + SIZE = "${targetPlatform.config}-size"; + STRINGS = "${targetPlatform.config}-strings"; + STRIP = "${targetPlatform.config}-strip"; CC = "${targetPlatform.config}-gcc"; - CXX = "${targetPlatform.config}-gcc"; + CXX = "${targetPlatform.config}-g++"; + AR_FOR_TARGET = "${targetPlatform.config}-ar"; + AS_FOR_TARGET = "${targetPlatform.config}-as"; LD_FOR_TARGET = "${targetPlatform.config}-ld"; - CC_FOR_TARGET = "${targetPlatform.config}-gcc"; NM_FOR_TARGET = "${targetPlatform.config}-nm"; + OBJCOPY_FOR_TARGET = "${targetPlatform.config}-objcopy"; + OBJDUMP_FOR_TARGET = "${targetPlatform.config}-objdump"; + RANLIB_FOR_TARGET = "${targetPlatform.config}-ranlib"; + SIZE_FOR_TARGET = "${targetPlatform.config}-size"; + STRINGS_FOR_TARGET = "${targetPlatform.config}-strings"; + STRIP_FOR_TARGET = "${targetPlatform.config}-strip"; + CC_FOR_TARGET = "${targetPlatform.config}-gcc"; CXX_FOR_TARGET = "${targetPlatform.config}-g++"; - # If we are making a cross compiler, cross != null - NIX_CC_CROSS = optionalString (targetPlatform == hostPlatform) builtins.toString stdenv.cc; + dontStrip = true; - configureFlags = - optional (!enableMultilib) "--disable-multilib" ++ - optional (!enableShared) "--disable-shared" ++ - optional langJava "--with-ecj-jar=${javaEcj.crossDrv}" ++ - optional javaAwtGtk "--enable-java-awt=gtk" ++ - optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr.crossDrv}" ++ - optional (ppl != null) "--with-ppl=${ppl.crossDrv}" ++ - optional (cloogppl != null) "--with-cloog=${cloogppl.crossDrv}" ++ - - [ - "--with-gmp=${gmp.crossDrv}" - "--with-mpfr=${mpfr.crossDrv}" - "--with-mpc=${libmpc.crossDrv}" - "--disable-libstdcxx-pch" - "--without-included-gettext" - "--with-system-zlib" - "--enable-languages=${ - concatStrings (intersperse "," - ( optional langC "c" - ++ optional langCC "c++" - ++ optional langFortran "fortran" - ++ optional langJava "java" - ++ optional langAda "ada" - ++ optional langVhdl "vhdl" - ++ optional langGo "go" - ) - ) - }" - ] ++ - optional langAda "--enable-libada" ++ - optional (targetPlatform == hostPlatform && targetPlatform.isi686) "--with-arch=i686" ++ - optional (targetPlatform != hostPlatform) crossConfigureFlags - ; }; + NIX_BUILD_CC = buildPackages.stdenv.cc; # Needed for the cross compilation to work AR = "ar"; LD = "ld"; CC = "gcc"; - # Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find - # the library headers and binaries, regarless of the language being - # compiled. - - # Note: When building the Java AWT GTK+ peer, the build system doesn't - # honor `--with-gmp' et al., e.g., when building - # `libjava/classpath/native/jni/java-math/gnu_java_math_GMP.c', so we just - # add them to $CPATH and $LIBRARY_PATH in this case. + # Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find the + # library headers and binaries, regarless of the language being compiled. + # + # Note: When building the Java AWT GTK+ peer, the build system doesn't honor + # `--with-gmp' et al., e.g., when building + # `libjava/classpath/native/jni/java-math/gnu_java_math_GMP.c', so we just add + # them to $CPATH and $LIBRARY_PATH in this case. # # Likewise, the LTO code doesn't find zlib. + # + # Cross-compiling, we need gcc not to read ./specs in order to build the g++ + # compiler (after the specs for the cross-gcc are created). Having + # LIBRARY_PATH= makes gcc read the specs from ., and the build breaks. - CPATH = makeSearchPathOutput "dev" "include" ([] + CPATH = optionals (targetPlatform == hostPlatform) (makeSearchPathOutput "dev" "include" ([] ++ optional (zlib != null) zlib ++ optional langJava boehmgc ++ optionals javaAwtGtk xlibs @@ -375,39 +388,38 @@ stdenv.mkDerivation ({ # On GNU/Hurd glibc refers to Mach & Hurd # headers. ++ optionals (libcCross != null && libcCross ? propagatedBuildInputs) - libcCross.propagatedBuildInputs); + libcCross.propagatedBuildInputs + )); - LIBRARY_PATH = makeLibraryPath ([] + LIBRARY_PATH = optionals (targetPlatform == hostPlatform) (makeLibraryPath ([] ++ optional (zlib != null) zlib ++ optional langJava boehmgc ++ optionals javaAwtGtk xlibs ++ optionals javaAwtGtk [ gmp mpfr ] - ++ optional (libpthread != null) libpthread); - - EXTRA_TARGET_CFLAGS = - if targetPlatform != hostPlatform && libcCross != null then [ - "-idirafter ${libcCross.dev}/include" - ] - ++ optionals (! crossStageStatic) [ - "-B${libcCross.out}/lib" - ] - else null; - - EXTRA_TARGET_LDFLAGS = - if targetPlatform != hostPlatform && libcCross != null then [ - "-Wl,-L${libcCross.out}/lib" - ] - ++ (if crossStageStatic then [ + ++ optional (libpthread != null) libpthread) + ); + + EXTRA_TARGET_FLAGS = optionals + (targetPlatform != hostPlatform && libcCross != null) + ([ + "-idirafter ${libcCross.dev}/include" + ] ++ optionals (! crossStageStatic) [ + "-B${libcCross.out}/lib" + ]); + + EXTRA_TARGET_LDFLAGS = optionals + (targetPlatform != hostPlatform && libcCross != null) + ([ + "-Wl,-L${libcCross.out}/lib" + ] ++ (if crossStageStatic then [ "-B${libcCross.out}/lib" ] else [ "-Wl,-rpath,${libcCross.out}/lib" "-Wl,-rpath-link,${libcCross.out}/lib" - ]) - ++ optionals (libpthreadCross != null) [ - "-L${libpthreadCross}/lib" - "-Wl,${libpthreadCross.TARGET_LDFLAGS}" - ] - else null; + ]) ++ optionals (libpthreadCross != null) [ + "-L${libpthreadCross}/lib" + "-Wl,${libpthreadCross.TARGET_LDFLAGS}" + ]); passthru = { inherit langC langCC langAda langFortran langVhdl enableMultilib version; isGNU = true; }; diff --git a/pkgs/development/compilers/gcc/4.8/default.nix b/pkgs/development/compilers/gcc/4.8/default.nix index c0efbb78f3c3..8713c174d5a6 100644 --- a/pkgs/development/compilers/gcc/4.8/default.nix +++ b/pkgs/development/compilers/gcc/4.8/default.nix @@ -23,7 +23,7 @@ , x11Support ? langJava , gnatboot ? null , enableMultilib ? false -, enablePlugin ? true # whether to support user-supplied plug-ins +, enablePlugin ? hostPlatform == buildPlatform # Whether to support user-supplied plug-ins , name ? "gcc" , libcCross ? null , crossStageStatic ? false @@ -33,6 +33,7 @@ , gnused ? null , darwin ? null , buildPlatform, hostPlatform, targetPlatform +, buildPackages }: assert langJava -> zip != null && unzip != null @@ -108,13 +109,13 @@ let version = "4.8.5"; javaAwtGtk = langJava && x11Support; /* Platform flags */ - mkPlatformFlags = platform: let - gccArch = platform.gcc.arch or null; - gccCpu = platform.gcc.cpu or null; - gccAbi = platform.gcc.abi or null; - gccFpu = platform.gcc.fpu or null; - gccFloat = platform.gcc.float or null; - gccMode = platform.gcc.mode or null; + platformFlags = let + gccArch = targetPlatform.platform.gcc.arch or null; + gccCpu = targetPlatform.platform.gcc.cpu or null; + gccAbi = targetPlatform.platform.gcc.abi or null; + gccFpu = targetPlatform.platform.gcc.fpu or null; + gccFloat = targetPlatform.platform.gcc.float or null; + gccMode = targetPlatform.platform.gcc.mode or null; in optional (gccArch != null) "--with-arch=${gccArch}" ++ optional (gccCpu != null) "--with-cpu=${gccCpu}" ++ @@ -127,8 +128,6 @@ let version = "4.8.5"; crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt"; crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem"; crossConfigureFlags = - mkPlatformFlags targetPlatform ++ - # Ensure that -print-prog-name is able to find the correct programs. [ "--with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" "--with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" ] ++ @@ -318,6 +317,8 @@ stdenv.mkDerivation ({ "--with-mpc=${libmpc}" ] ++ optional (libelf != null) "--with-libelf=${libelf}" ++ + optional (!(crossMingw && crossStageStatic)) + "--with-native-system-header-dir=${getDev stdenv.cc.libc}/include" ++ # Basic configuration [ @@ -374,15 +375,7 @@ stdenv.mkDerivation ({ # Ada optional langAda "--enable-libada" ++ - # Cross-compilation - optional (targetPlatform == hostPlatform) ( - let incDir = if hostPlatform.isDarwin - then "${darwin.usr-include}" - else "${getDev stdenv.cc.libc}/include"; - in "--with-native-system-header-dir=${incDir}" - ) ++ - - optional (targetPlatform == hostPlatform) (mkPlatformFlags stdenv.platform) ++ + platformFlags ++ optional (targetPlatform != hostPlatform) crossConfigureFlags ++ optional (!bootstrap) "--disable-bootstrap" ++ @@ -406,62 +399,52 @@ stdenv.mkDerivation ({ then "install-strip" else "install"; - crossAttrs = let - xgccArch = targetPlatform.gcc.arch or null; - xgccCpu = targetPlatform.gcc.cpu or null; - xgccAbi = targetPlatform.gcc.abi or null; - xgccFpu = targetPlatform.gcc.fpu or null; - xgccFloat = targetPlatform.gcc.float or null; - in { + /* For cross-built gcc (build != host == target) */ + crossAttrs = { + AR_FOR_BUILD = "ar"; + AS_FOR_BUILD = "as"; + LD_FOR_BUILD = "ld"; + NM_FOR_BUILD = "nm"; + OBJCOPY_FOR_BUILD = "objcopy"; + OBJDUMP_FOR_BUILD = "objdump"; + RANLIB_FOR_BUILD = "ranlib"; + SIZE_FOR_BUILD = "size"; + STRINGS_FOR_BUILD = "strings"; + STRIP_FOR_BUILD = "strip"; + CC_FOR_BUILD = "gcc"; + CXX_FOR_BUILD = "g++"; + AR = "${targetPlatform.config}-ar"; + AS = "${targetPlatform.config}-as"; LD = "${targetPlatform.config}-ld"; + NM = "${targetPlatform.config}-nm"; + OBJCOPY = "${targetPlatform.config}-objcopy"; + OBJDUMP = "${targetPlatform.config}-objdump"; + RANLIB = "${targetPlatform.config}-ranlib"; + SIZE = "${targetPlatform.config}-size"; + STRINGS = "${targetPlatform.config}-strings"; + STRIP = "${targetPlatform.config}-strip"; CC = "${targetPlatform.config}-gcc"; - CXX = "${targetPlatform.config}-gcc"; + CXX = "${targetPlatform.config}-g++"; + AR_FOR_TARGET = "${targetPlatform.config}-ar"; + AS_FOR_TARGET = "${targetPlatform.config}-as"; LD_FOR_TARGET = "${targetPlatform.config}-ld"; - CC_FOR_TARGET = "${targetPlatform.config}-gcc"; NM_FOR_TARGET = "${targetPlatform.config}-nm"; + OBJCOPY_FOR_TARGET = "${targetPlatform.config}-objcopy"; + OBJDUMP_FOR_TARGET = "${targetPlatform.config}-objdump"; + RANLIB_FOR_TARGET = "${targetPlatform.config}-ranlib"; + SIZE_FOR_TARGET = "${targetPlatform.config}-size"; + STRINGS_FOR_TARGET = "${targetPlatform.config}-strings"; + STRIP_FOR_TARGET = "${targetPlatform.config}-strip"; + CC_FOR_TARGET = "${targetPlatform.config}-gcc"; CXX_FOR_TARGET = "${targetPlatform.config}-g++"; - # If we are making a cross compiler, targetPlatform != hostPlatform - NIX_CC_CROSS = optionalString (targetPlatform == hostPlatform) builtins.toString stdenv.cc; + dontStrip = true; - configureFlags = - optional (!enableMultilib) "--disable-multilib" ++ - optional (!enableShared) "--disable-shared" ++ - optional langJava "--with-ecj-jar=${javaEcj.crossDrv}" ++ - optional javaAwtGtk "--enable-java-awt=gtk" ++ - optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr.crossDrv}" ++ - optionals (cloog != null) ["--with-cloog=${cloog.crossDrv}" "--enable-cloog-backend=isl"] ++ - [ - "--with-gmp=${gmp.crossDrv}" - "--with-mpfr=${mpfr.crossDrv}" - "--with-mpc=${libmpc.crossDrv}" - "--disable-libstdcxx-pch" - "--without-included-gettext" - "--with-system-zlib" - "--enable-languages=${ - concatStrings (intersperse "," - ( optional langC "c" - ++ optional langCC "c++" - ++ optional langFortran "fortran" - ++ optional langJava "java" - ++ optional langAda "ada" - ++ optional langVhdl "vhdl" - ++ optional langGo "go" - ) - ) - }" - ] ++ - optional langAda "--enable-libada" ++ - optional (xgccArch != null) "--with-arch=${xgccArch}" ++ - optional (xgccCpu != null) "--with-cpu=${xgccCpu}" ++ - optional (xgccAbi != null) "--with-abi=${xgccAbi}" ++ - optional (xgccFpu != null) "--with-fpu=${xgccFpu}" ++ - optional (xgccFloat != null) "--with-float=${xgccFloat}" - ; buildFlags = ""; }; + NIX_BUILD_CC = buildPackages.stdenv.cc; # Needed for the cross compilation to work AR = "ar"; @@ -469,18 +452,21 @@ stdenv.mkDerivation ({ # http://gcc.gnu.org/install/specific.html#x86-64-x-solaris210 CC = if stdenv.system == "x86_64-solaris" then "gcc -m64" else "gcc"; - # Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find - # the library headers and binaries, regarless of the language being - # compiled. - - # Note: When building the Java AWT GTK+ peer, the build system doesn't - # honor `--with-gmp' et al., e.g., when building - # `libjava/classpath/native/jni/java-math/gnu_java_math_GMP.c', so we just - # add them to $CPATH and $LIBRARY_PATH in this case. + # Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find the + # library headers and binaries, regarless of the language being compiled. + # + # Note: When building the Java AWT GTK+ peer, the build system doesn't honor + # `--with-gmp' et al., e.g., when building + # `libjava/classpath/native/jni/java-math/gnu_java_math_GMP.c', so we just add + # them to $CPATH and $LIBRARY_PATH in this case. # # Likewise, the LTO code doesn't find zlib. + # + # Cross-compiling, we need gcc not to read ./specs in order to build the g++ + # compiler (after the specs for the cross-gcc are created). Having + # LIBRARY_PATH= makes gcc read the specs from ., and the build breaks. - CPATH = makeSearchPathOutput "dev" "include" ([] + CPATH = optionals (targetPlatform == hostPlatform) (makeSearchPathOutput "dev" "include" ([] ++ optional (zlib != null) zlib ++ optional langJava boehmgc ++ optionals javaAwtGtk xlibs @@ -491,39 +477,38 @@ stdenv.mkDerivation ({ # On GNU/Hurd glibc refers to Mach & Hurd # headers. ++ optionals (libcCross != null && libcCross ? propagatedBuildInputs) - libcCross.propagatedBuildInputs); + libcCross.propagatedBuildInputs + )); - LIBRARY_PATH = makeLibraryPath ([] + LIBRARY_PATH = optionals (targetPlatform == hostPlatform) (makeLibraryPath ([] ++ optional (zlib != null) zlib ++ optional langJava boehmgc ++ optionals javaAwtGtk xlibs ++ optionals javaAwtGtk [ gmp mpfr ] - ++ optional (libpthread != null) libpthread); - - EXTRA_TARGET_CFLAGS = - if targetPlatform != hostPlatform && libcCross != null then [ - "-idirafter ${getDev libcCross}/include" - ] - ++ optionals (! crossStageStatic) [ - "-B${libcCross.out}/lib" - ] - else null; - - EXTRA_TARGET_LDFLAGS = - if targetPlatform != hostPlatform && libcCross != null then [ - "-Wl,-L${libcCross.out}/lib" - ] - ++ (if crossStageStatic then [ + ++ optional (libpthread != null) libpthread) + ); + + EXTRA_TARGET_FLAGS = optionals + (targetPlatform != hostPlatform && libcCross != null) + ([ + "-idirafter ${libcCross.dev}/include" + ] ++ optionals (! crossStageStatic) [ + "-B${libcCross.out}/lib" + ]); + + EXTRA_TARGET_LDFLAGS = optionals + (targetPlatform != hostPlatform && libcCross != null) + ([ + "-Wl,-L${libcCross.out}/lib" + ] ++ (if crossStageStatic then [ "-B${libcCross.out}/lib" ] else [ "-Wl,-rpath,${libcCross.out}/lib" "-Wl,-rpath-link,${libcCross.out}/lib" - ]) - ++ optionals (libpthreadCross != null) [ - "-L${libpthreadCross}/lib" - "-Wl,${libpthreadCross.TARGET_LDFLAGS}" - ] - else null; + ]) ++ optionals (libpthreadCross != null) [ + "-L${libpthreadCross}/lib" + "-Wl,${libpthreadCross.TARGET_LDFLAGS}" + ]); passthru = { inherit langC langCC langObjC langObjCpp langAda langFortran langVhdl langGo version; isGNU = true; }; diff --git a/pkgs/development/compilers/gcc/4.9/default.nix b/pkgs/development/compilers/gcc/4.9/default.nix index ca9d26e68fca..c338f9c641ee 100644 --- a/pkgs/development/compilers/gcc/4.9/default.nix +++ b/pkgs/development/compilers/gcc/4.9/default.nix @@ -23,7 +23,7 @@ , x11Support ? langJava , gnatboot ? null , enableMultilib ? false -, enablePlugin ? true # whether to support user-supplied plug-ins +, enablePlugin ? hostPlatform == buildPlatform # Whether to support user-supplied plug-ins , name ? "gcc" , libcCross ? null , crossStageStatic ? false @@ -33,6 +33,7 @@ , gnused ? null , darwin ? null , buildPlatform, hostPlatform, targetPlatform +, buildPackages }: assert langJava -> zip != null && unzip != null @@ -99,13 +100,13 @@ let version = "4.9.4"; javaAwtGtk = langJava && x11Support; /* Platform flags */ - mkPlatformFlags = platform: let - gccArch = platform.gcc.arch or null; - gccCpu = platform.gcc.cpu or null; - gccAbi = platform.gcc.abi or null; - gccFpu = platform.gcc.fpu or null; - gccFloat = platform.gcc.float or null; - gccMode = platform.gcc.mode or null; + platformFlags = let + gccArch = targetPlatform.platform.gcc.arch or null; + gccCpu = targetPlatform.platform.gcc.cpu or null; + gccAbi = targetPlatform.platform.gcc.abi or null; + gccFpu = targetPlatform.platform.gcc.fpu or null; + gccFloat = targetPlatform.platform.gcc.float or null; + gccMode = targetPlatform.platform.gcc.mode or null; in optional (gccArch != null) "--with-arch=${gccArch}" ++ optional (gccCpu != null) "--with-cpu=${gccCpu}" ++ @@ -118,8 +119,6 @@ let version = "4.9.4"; crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt"; crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem"; crossConfigureFlags = - mkPlatformFlags targetPlatform ++ - # Ensure that -print-prog-name is able to find the correct programs. [ "--with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" "--with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" ] ++ @@ -316,6 +315,8 @@ stdenv.mkDerivation ({ "--with-mpc=${libmpc}" ] ++ optional (libelf != null) "--with-libelf=${libelf}" ++ + optional (!(crossMingw && crossStageStatic)) + "--with-native-system-header-dir=${getDev stdenv.cc.libc}/include" ++ # Basic configuration [ @@ -372,15 +373,7 @@ stdenv.mkDerivation ({ # Ada optional langAda "--enable-libada" ++ - # Cross-compilation - optional (targetPlatform == hostPlatform) ( - let incDir = if hostPlatform.isDarwin - then "${darwin.usr-include}" - else "${getDev stdenv.cc.libc}/include"; - in "--with-native-system-header-dir=${incDir}" - ) ++ - - optional (targetPlatform == hostPlatform) (mkPlatformFlags stdenv.platform) ++ + platformFlags ++ optional (targetPlatform != hostPlatform) crossConfigureFlags ++ optional (!bootstrap) "--disable-bootstrap" ++ @@ -405,62 +398,51 @@ stdenv.mkDerivation ({ else "install"; /* For cross-built gcc (build != host == target) */ - crossAttrs = let - xgccArch = targetPlatform.gcc.arch or null; - xgccCpu = targetPlatform.gcc.cpu or null; - xgccAbi = targetPlatform.gcc.abi or null; - xgccFpu = targetPlatform.gcc.fpu or null; - xgccFloat = targetPlatform.gcc.float or null; - in { + crossAttrs = { + AR_FOR_BUILD = "ar"; + AS_FOR_BUILD = "as"; + LD_FOR_BUILD = "ld"; + NM_FOR_BUILD = "nm"; + OBJCOPY_FOR_BUILD = "objcopy"; + OBJDUMP_FOR_BUILD = "objdump"; + RANLIB_FOR_BUILD = "ranlib"; + SIZE_FOR_BUILD = "size"; + STRINGS_FOR_BUILD = "strings"; + STRIP_FOR_BUILD = "strip"; + CC_FOR_BUILD = "gcc"; + CXX_FOR_BUILD = "g++"; + AR = "${targetPlatform.config}-ar"; + AS = "${targetPlatform.config}-as"; LD = "${targetPlatform.config}-ld"; + NM = "${targetPlatform.config}-nm"; + OBJCOPY = "${targetPlatform.config}-objcopy"; + OBJDUMP = "${targetPlatform.config}-objdump"; + RANLIB = "${targetPlatform.config}-ranlib"; + SIZE = "${targetPlatform.config}-size"; + STRINGS = "${targetPlatform.config}-strings"; + STRIP = "${targetPlatform.config}-strip"; CC = "${targetPlatform.config}-gcc"; - CXX = "${targetPlatform.config}-gcc"; + CXX = "${targetPlatform.config}-g++"; + AR_FOR_TARGET = "${targetPlatform.config}-ar"; + AS_FOR_TARGET = "${targetPlatform.config}-as"; LD_FOR_TARGET = "${targetPlatform.config}-ld"; - CC_FOR_TARGET = "${targetPlatform.config}-gcc"; NM_FOR_TARGET = "${targetPlatform.config}-nm"; + OBJCOPY_FOR_TARGET = "${targetPlatform.config}-objcopy"; + OBJDUMP_FOR_TARGET = "${targetPlatform.config}-objdump"; + RANLIB_FOR_TARGET = "${targetPlatform.config}-ranlib"; + SIZE_FOR_TARGET = "${targetPlatform.config}-size"; + STRINGS_FOR_TARGET = "${targetPlatform.config}-strings"; + STRIP_FOR_TARGET = "${targetPlatform.config}-strip"; + CC_FOR_TARGET = "${targetPlatform.config}-gcc"; CXX_FOR_TARGET = "${targetPlatform.config}-g++"; - # If we are making a cross compiler, targetPlatform != hostPlatform - NIX_CC_CROSS = optionalString (targetPlatform == hostPlatform) builtins.toString stdenv.cc; + dontStrip = true; - configureFlags = - optional (!enableMultilib) "--disable-multilib" ++ - optional (!enableShared) "--disable-shared" ++ - optional langJava "--with-ecj-jar=${javaEcj.crossDrv}" ++ - optional javaAwtGtk "--enable-java-awt=gtk" ++ - optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr.crossDrv}" ++ - optionals (cloog != null) ["--with-cloog=${cloog.crossDrv}" "--enable-cloog-backend=isl"] ++ - [ - "--with-gmp=${gmp.crossDrv}" - "--with-mpfr=${mpfr.crossDrv}" - "--with-mpc=${libmpc.crossDrv}" - "--disable-libstdcxx-pch" - "--without-included-gettext" - "--with-system-zlib" - "--enable-languages=${ - concatStrings (intersperse "," - ( optional langC "c" - ++ optional langCC "c++" - ++ optional langFortran "fortran" - ++ optional langJava "java" - ++ optional langAda "ada" - ++ optional langVhdl "vhdl" - ++ optional langGo "go" - ) - ) - }" - ] ++ - optional langAda "--enable-libada" ++ - optional (xgccArch != null) "--with-arch=${xgccArch}" ++ - optional (xgccCpu != null) "--with-cpu=${xgccCpu}" ++ - optional (xgccAbi != null) "--with-abi=${xgccAbi}" ++ - optional (xgccFpu != null) "--with-fpu=${xgccFpu}" ++ - optional (xgccFloat != null) "--with-float=${xgccFloat}" - ; buildFlags = ""; }; + NIX_BUILD_CC = buildPackages.stdenv.cc; # Needed for the cross compilation to work AR = "ar"; @@ -468,18 +450,21 @@ stdenv.mkDerivation ({ # http://gcc.gnu.org/install/specific.html#x86-64-x-solaris210 CC = if stdenv.system == "x86_64-solaris" then "gcc -m64" else "gcc"; - # Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find - # the library headers and binaries, regarless of the language being - # compiled. - - # Note: When building the Java AWT GTK+ peer, the build system doesn't - # honor `--with-gmp' et al., e.g., when building - # `libjava/classpath/native/jni/java-math/gnu_java_math_GMP.c', so we just - # add them to $CPATH and $LIBRARY_PATH in this case. + # Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find the + # library headers and binaries, regarless of the language being compiled. + # + # Note: When building the Java AWT GTK+ peer, the build system doesn't honor + # `--with-gmp' et al., e.g., when building + # `libjava/classpath/native/jni/java-math/gnu_java_math_GMP.c', so we just add + # them to $CPATH and $LIBRARY_PATH in this case. # # Likewise, the LTO code doesn't find zlib. + # + # Cross-compiling, we need gcc not to read ./specs in order to build the g++ + # compiler (after the specs for the cross-gcc are created). Having + # LIBRARY_PATH= makes gcc read the specs from ., and the build breaks. - CPATH = makeSearchPathOutput "dev" "include" ([] + CPATH = optionals (targetPlatform == hostPlatform) (makeSearchPathOutput "dev" "include" ([] ++ optional (zlib != null) zlib ++ optional langJava boehmgc ++ optionals javaAwtGtk xlibs @@ -490,39 +475,38 @@ stdenv.mkDerivation ({ # On GNU/Hurd glibc refers to Mach & Hurd # headers. ++ optionals (libcCross != null && libcCross ? propagatedBuildInputs) - libcCross.propagatedBuildInputs); + libcCross.propagatedBuildInputs + )); - LIBRARY_PATH = makeLibraryPath ([] + LIBRARY_PATH = optionals (targetPlatform == hostPlatform) (makeLibraryPath ([] ++ optional (zlib != null) zlib ++ optional langJava boehmgc ++ optionals javaAwtGtk xlibs ++ optionals javaAwtGtk [ gmp mpfr ] - ++ optional (libpthread != null) libpthread); - - EXTRA_TARGET_CFLAGS = - if targetPlatform != hostPlatform && libcCross != null then [ - "-idirafter ${getDev libcCross}/include" - ] - ++ optionals (! crossStageStatic) [ - "-B${libcCross.out}/lib" - ] - else null; - - EXTRA_TARGET_LDFLAGS = - if targetPlatform != hostPlatform && libcCross != null then [ - "-Wl,-L${libcCross.out}/lib" - ] - ++ (if crossStageStatic then [ + ++ optional (libpthread != null) libpthread) + ); + + EXTRA_TARGET_FLAGS = optionals + (targetPlatform != hostPlatform && libcCross != null) + ([ + "-idirafter ${getDev libcCross}/include" + ] ++ optionals (! crossStageStatic) [ + "-B${libcCross.out}/lib" + ]); + + EXTRA_TARGET_LDFLAGS = optionals + (targetPlatform != hostPlatform && libcCross != null) + ([ + "-Wl,-L${libcCross.out}/lib" + ] ++ (if crossStageStatic then [ "-B${libcCross.out}/lib" ] else [ "-Wl,-rpath,${libcCross.out}/lib" "-Wl,-rpath-link,${libcCross.out}/lib" - ]) - ++ optionals (libpthreadCross != null) [ - "-L${libpthreadCross}/lib" - "-Wl,${libpthreadCross.TARGET_LDFLAGS}" - ] - else null; + ]) ++ optionals (libpthreadCross != null) [ + "-L${libpthreadCross}/lib" + "-Wl,${libpthreadCross.TARGET_LDFLAGS}" + ]); passthru = { inherit langC langCC langObjC langObjCpp langAda langFortran langVhdl langGo version; isGNU = true; }; diff --git a/pkgs/development/compilers/gcc/5/default.nix b/pkgs/development/compilers/gcc/5/default.nix index 332dae95965f..552e827ec366 100644 --- a/pkgs/development/compilers/gcc/5/default.nix +++ b/pkgs/development/compilers/gcc/5/default.nix @@ -23,7 +23,7 @@ , x11Support ? langJava , gnatboot ? null , enableMultilib ? false -, enablePlugin ? true # whether to support user-supplied plug-ins +, enablePlugin ? hostPlatform == buildPlatform # Whether to support user-supplied plug-ins , name ? "gcc" , libcCross ? null , crossStageStatic ? false @@ -103,13 +103,13 @@ let version = "5.5.0"; javaAwtGtk = langJava && x11Support; /* Platform flags */ - mkPlatformFlags = platform: let - gccArch = platform.gcc.arch or null; - gccCpu = platform.gcc.cpu or null; - gccAbi = platform.gcc.abi or null; - gccFpu = platform.gcc.fpu or null; - gccFloat = platform.gcc.float or null; - gccMode = platform.gcc.mode or null; + platformFlags = let + gccArch = targetPlatform.platform.gcc.arch or null; + gccCpu = targetPlatform.platform.gcc.cpu or null; + gccAbi = targetPlatform.platform.gcc.abi or null; + gccFpu = targetPlatform.platform.gcc.fpu or null; + gccFloat = targetPlatform.platform.gcc.float or null; + gccMode = targetPlatform.platform.gcc.mode or null; in optional (gccArch != null) "--with-arch=${gccArch}" ++ optional (gccCpu != null) "--with-cpu=${gccCpu}" ++ @@ -122,8 +122,6 @@ let version = "5.5.0"; crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt"; crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem"; crossConfigureFlags = - mkPlatformFlags targetPlatform ++ - # Ensure that -print-prog-name is able to find the correct programs. [ "--with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" "--with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" ] ++ @@ -331,6 +329,8 @@ stdenv.mkDerivation ({ "--with-mpc=${libmpc}" ] ++ optional (libelf != null) "--with-libelf=${libelf}" ++ + optional (!(crossMingw && crossStageStatic)) + "--with-native-system-header-dir=${getDev stdenv.cc.libc}/include" ++ # Basic configuration [ @@ -382,15 +382,7 @@ stdenv.mkDerivation ({ # Ada optional langAda "--enable-libada" ++ - # Cross-compilation - optional (targetPlatform == hostPlatform) ( - let incDir = if hostPlatform.isDarwin - then "${darwin.usr-include}" - else "${getDev stdenv.cc.libc}/include"; - in "--with-native-system-header-dir=${incDir}" - ) ++ - - optional (targetPlatform == hostPlatform) (mkPlatformFlags stdenv.platform) ++ + platformFlags ++ optional (targetPlatform != hostPlatform) crossConfigureFlags ++ optional (!bootstrap) "--disable-bootstrap" ++ @@ -415,61 +407,51 @@ stdenv.mkDerivation ({ else "install"; /* For cross-built gcc (build != host == target) */ - crossAttrs = let - xgccArch = targetPlatform.gcc.arch or null; - xgccCpu = targetPlatform.gcc.cpu or null; - xgccAbi = targetPlatform.gcc.abi or null; - xgccFpu = targetPlatform.gcc.fpu or null; - xgccFloat = targetPlatform.gcc.float or null; - in { + crossAttrs = { + AR_FOR_BUILD = "ar"; + AS_FOR_BUILD = "as"; + LD_FOR_BUILD = "ld"; + NM_FOR_BUILD = "nm"; + OBJCOPY_FOR_BUILD = "objcopy"; + OBJDUMP_FOR_BUILD = "objdump"; + RANLIB_FOR_BUILD = "ranlib"; + SIZE_FOR_BUILD = "size"; + STRINGS_FOR_BUILD = "strings"; + STRIP_FOR_BUILD = "strip"; + CC_FOR_BUILD = "gcc"; + CXX_FOR_BUILD = "g++"; + AR = "${targetPlatform.config}-ar"; + AS = "${targetPlatform.config}-as"; LD = "${targetPlatform.config}-ld"; + NM = "${targetPlatform.config}-nm"; + OBJCOPY = "${targetPlatform.config}-objcopy"; + OBJDUMP = "${targetPlatform.config}-objdump"; + RANLIB = "${targetPlatform.config}-ranlib"; + SIZE = "${targetPlatform.config}-size"; + STRINGS = "${targetPlatform.config}-strings"; + STRIP = "${targetPlatform.config}-strip"; CC = "${targetPlatform.config}-gcc"; - CXX = "${targetPlatform.config}-gcc"; + CXX = "${targetPlatform.config}-g++"; + AR_FOR_TARGET = "${targetPlatform.config}-ar"; + AS_FOR_TARGET = "${targetPlatform.config}-as"; LD_FOR_TARGET = "${targetPlatform.config}-ld"; - CC_FOR_TARGET = "${targetPlatform.config}-gcc"; NM_FOR_TARGET = "${targetPlatform.config}-nm"; + OBJCOPY_FOR_TARGET = "${targetPlatform.config}-objcopy"; + OBJDUMP_FOR_TARGET = "${targetPlatform.config}-objdump"; + RANLIB_FOR_TARGET = "${targetPlatform.config}-ranlib"; + SIZE_FOR_TARGET = "${targetPlatform.config}-size"; + STRINGS_FOR_TARGET = "${targetPlatform.config}-strings"; + STRIP_FOR_TARGET = "${targetPlatform.config}-strip"; + CC_FOR_TARGET = "${targetPlatform.config}-gcc"; CXX_FOR_TARGET = "${targetPlatform.config}-g++"; - # If we are making a cross compiler, targetPlatform != hostPlatform - NIX_CC_CROSS = optionalString (targetPlatform == hostPlatform) builtins.toString stdenv.cc; + dontStrip = true; - configureFlags = - optional (!enableMultilib) "--disable-multilib" ++ - optional (!enableShared) "--disable-shared" ++ - optional langJava "--with-ecj-jar=${javaEcj.crossDrv}" ++ - optional javaAwtGtk "--enable-java-awt=gtk" ++ - optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr.crossDrv}" ++ - [ - "--with-gmp=${gmp.crossDrv}" - "--with-mpfr=${mpfr.crossDrv}" - "--with-mpc=${libmpc.crossDrv}" - "--disable-libstdcxx-pch" - "--without-included-gettext" - "--with-system-zlib" - "--enable-languages=${ - concatStrings (intersperse "," - ( optional langC "c" - ++ optional langCC "c++" - ++ optional langFortran "fortran" - ++ optional langJava "java" - ++ optional langAda "ada" - ++ optional langVhdl "vhdl" - ++ optional langGo "go" - ) - ) - }" - ] ++ - optional langAda "--enable-libada" ++ - optional (xgccArch != null) "--with-arch=${xgccArch}" ++ - optional (xgccCpu != null) "--with-cpu=${xgccCpu}" ++ - optional (xgccAbi != null) "--with-abi=${xgccAbi}" ++ - optional (xgccFpu != null) "--with-fpu=${xgccFpu}" ++ - optional (xgccFloat != null) "--with-float=${xgccFloat}" - ; buildFlags = ""; }; + NIX_BUILD_CC = buildPackages.stdenv.cc; # Needed for the cross compilation to work AR = "ar"; @@ -477,18 +459,21 @@ stdenv.mkDerivation ({ # http://gcc.gnu.org/install/specific.html#x86-64-x-solaris210 CC = if stdenv.system == "x86_64-solaris" then "gcc -m64" else "gcc"; - # Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find - # the library headers and binaries, regarless of the language being - # compiled. - - # Note: When building the Java AWT GTK+ peer, the build system doesn't - # honor `--with-gmp' et al., e.g., when building - # `libjava/classpath/native/jni/java-math/gnu_java_math_GMP.c', so we just - # add them to $CPATH and $LIBRARY_PATH in this case. + # Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find the + # library headers and binaries, regarless of the language being compiled. + # + # Note: When building the Java AWT GTK+ peer, the build system doesn't honor + # `--with-gmp' et al., e.g., when building + # `libjava/classpath/native/jni/java-math/gnu_java_math_GMP.c', so we just add + # them to $CPATH and $LIBRARY_PATH in this case. # # Likewise, the LTO code doesn't find zlib. + # + # Cross-compiling, we need gcc not to read ./specs in order to build the g++ + # compiler (after the specs for the cross-gcc are created). Having + # LIBRARY_PATH= makes gcc read the specs from ., and the build breaks. - CPATH = makeSearchPathOutput "dev" "include" ([] + CPATH = optionals (targetPlatform == hostPlatform) (makeSearchPathOutput "dev" "include" ([] ++ optional (zlib != null) zlib ++ optional langJava boehmgc ++ optionals javaAwtGtk xlibs @@ -499,39 +484,38 @@ stdenv.mkDerivation ({ # On GNU/Hurd glibc refers to Mach & Hurd # headers. ++ optionals (libcCross != null && libcCross ? propagatedBuildInputs) - libcCross.propagatedBuildInputs); + libcCross.propagatedBuildInputs + )); - LIBRARY_PATH = makeLibraryPath ([] + LIBRARY_PATH = optionals (targetPlatform == hostPlatform) (makeLibraryPath ([] ++ optional (zlib != null) zlib ++ optional langJava boehmgc ++ optionals javaAwtGtk xlibs ++ optionals javaAwtGtk [ gmp mpfr ] - ++ optional (libpthread != null) libpthread); - - EXTRA_TARGET_CFLAGS = - if targetPlatform != hostPlatform && libcCross != null then [ - "-idirafter ${getDev libcCross}/include" - ] - ++ optionals (! crossStageStatic) [ - "-B${libcCross.out}/lib" - ] - else null; - - EXTRA_TARGET_LDFLAGS = - if targetPlatform != hostPlatform && libcCross != null then [ - "-Wl,-L${libcCross.out}/lib" - ] - ++ (if crossStageStatic then [ + ++ optional (libpthread != null) libpthread) + ); + + EXTRA_TARGET_FLAGS = optionals + (targetPlatform != hostPlatform && libcCross != null) + ([ + "-idirafter ${getDev libcCross}/include" + ] ++ optionals (! crossStageStatic) [ + "-B${libcCross.out}/lib" + ]); + + EXTRA_TARGET_LDFLAGS = optionals + (targetPlatform != hostPlatform && libcCross != null) + ([ + "-Wl,-L${libcCross.out}/lib" + ] ++ (if crossStageStatic then [ "-B${libcCross.out}/lib" ] else [ "-Wl,-rpath,${libcCross.out}/lib" "-Wl,-rpath-link,${libcCross.out}/lib" - ]) - ++ optionals (libpthreadCross != null) [ - "-L${libpthreadCross}/lib" - "-Wl,${libpthreadCross.TARGET_LDFLAGS}" - ] - else null; + ]) ++ optionals (libpthreadCross != null) [ + "-L${libpthreadCross}/lib" + "-Wl,${libpthreadCross.TARGET_LDFLAGS}" + ]); passthru = { inherit langC langCC langObjC langObjCpp langAda langFortran langVhdl langGo version; isGNU = true; }; diff --git a/pkgs/development/compilers/gcc/6/default.nix b/pkgs/development/compilers/gcc/6/default.nix index d9f4d35f4f8f..fbc490026067 100644 --- a/pkgs/development/compilers/gcc/6/default.nix +++ b/pkgs/development/compilers/gcc/6/default.nix @@ -23,7 +23,7 @@ , x11Support ? langJava , gnatboot ? null , enableMultilib ? false -, enablePlugin ? true # whether to support user-supplied plug-ins +, enablePlugin ? hostPlatform == buildPlatform # Whether to support user-supplied plug-ins , name ? "gcc" , libcCross ? null , crossStageStatic ? false @@ -34,6 +34,7 @@ , cloog # unused; just for compat with gcc4, as we override the parameter on some places , darwin ? null , buildPlatform, hostPlatform, targetPlatform +, buildPackages }: assert langJava -> zip != null && unzip != null @@ -100,13 +101,13 @@ let version = "6.4.0"; javaAwtGtk = langJava && x11Support; /* Platform flags */ - mkPlatformFlags = platform: let - gccArch = platform.gcc.arch or null; - gccCpu = platform.gcc.cpu or null; - gccAbi = platform.gcc.abi or null; - gccFpu = platform.gcc.fpu or null; - gccFloat = platform.gcc.float or null; - gccMode = platform.gcc.mode or null; + platformFlags = let + gccArch = targetPlatform.platform.gcc.arch or null; + gccCpu = targetPlatform.platform.gcc.cpu or null; + gccAbi = targetPlatform.platform.gcc.abi or null; + gccFpu = targetPlatform.platform.gcc.fpu or null; + gccFloat = targetPlatform.platform.gcc.float or null; + gccMode = targetPlatform.platform.gcc.mode or null; in optional (gccArch != null) "--with-arch=${gccArch}" ++ optional (gccCpu != null) "--with-cpu=${gccCpu}" ++ @@ -119,8 +120,6 @@ let version = "6.4.0"; crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt"; crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem"; crossConfigureFlags = - mkPlatformFlags targetPlatform ++ - # Ensure that -print-prog-name is able to find the correct programs. [ "--with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" "--with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" ] ++ @@ -332,6 +331,8 @@ stdenv.mkDerivation ({ "--with-mpc=${libmpc}" ] ++ optional (libelf != null) "--with-libelf=${libelf}" ++ + optional (!(crossMingw && crossStageStatic)) + "--with-native-system-header-dir=${getDev stdenv.cc.libc}/include" ++ # Basic configuration [ @@ -383,15 +384,7 @@ stdenv.mkDerivation ({ # Ada optional langAda "--enable-libada" ++ - # Cross-compilation - optional (targetPlatform == hostPlatform) ( - let incDir = if hostPlatform.isDarwin - then "${darwin.usr-include}" - else "${getDev stdenv.cc.libc}/include"; - in "--with-native-system-header-dir=${incDir}" - ) ++ - - optional (targetPlatform == hostPlatform) (mkPlatformFlags stdenv.platform) ++ + platformFlags ++ optional (targetPlatform != hostPlatform) crossConfigureFlags ++ optional (!bootstrap) "--disable-bootstrap" ++ @@ -415,61 +408,51 @@ stdenv.mkDerivation ({ else "install"; /* For cross-built gcc (build != host == target) */ - crossAttrs = let - xgccArch = targetPlatform.gcc.arch or null; - xgccCpu = targetPlatform.gcc.cpu or null; - xgccAbi = targetPlatform.gcc.abi or null; - xgccFpu = targetPlatform.gcc.fpu or null; - xgccFloat = targetPlatform.gcc.float or null; - in { + crossAttrs = { + AR_FOR_BUILD = "ar"; + AS_FOR_BUILD = "as"; + LD_FOR_BUILD = "ld"; + NM_FOR_BUILD = "nm"; + OBJCOPY_FOR_BUILD = "objcopy"; + OBJDUMP_FOR_BUILD = "objdump"; + RANLIB_FOR_BUILD = "ranlib"; + SIZE_FOR_BUILD = "size"; + STRINGS_FOR_BUILD = "strings"; + STRIP_FOR_BUILD = "strip"; + CC_FOR_BUILD = "gcc"; + CXX_FOR_BUILD = "g++"; + AR = "${targetPlatform.config}-ar"; + AS = "${targetPlatform.config}-as"; LD = "${targetPlatform.config}-ld"; + NM = "${targetPlatform.config}-nm"; + OBJCOPY = "${targetPlatform.config}-objcopy"; + OBJDUMP = "${targetPlatform.config}-objdump"; + RANLIB = "${targetPlatform.config}-ranlib"; + SIZE = "${targetPlatform.config}-size"; + STRINGS = "${targetPlatform.config}-strings"; + STRIP = "${targetPlatform.config}-strip"; CC = "${targetPlatform.config}-gcc"; - CXX = "${targetPlatform.config}-gcc"; + CXX = "${targetPlatform.config}-g++"; + AR_FOR_TARGET = "${targetPlatform.config}-ar"; + AS_FOR_TARGET = "${targetPlatform.config}-as"; LD_FOR_TARGET = "${targetPlatform.config}-ld"; - CC_FOR_TARGET = "${targetPlatform.config}-gcc"; NM_FOR_TARGET = "${targetPlatform.config}-nm"; + OBJCOPY_FOR_TARGET = "${targetPlatform.config}-objcopy"; + OBJDUMP_FOR_TARGET = "${targetPlatform.config}-objdump"; + RANLIB_FOR_TARGET = "${targetPlatform.config}-ranlib"; + SIZE_FOR_TARGET = "${targetPlatform.config}-size"; + STRINGS_FOR_TARGET = "${targetPlatform.config}-strings"; + STRIP_FOR_TARGET = "${targetPlatform.config}-strip"; + CC_FOR_TARGET = "${targetPlatform.config}-gcc"; CXX_FOR_TARGET = "${targetPlatform.config}-g++"; - # If we are making a cross compiler, targetPlatform != hostPlatform - NIX_CC_CROSS = optionalString (targetPlatform == hostPlatform) builtins.toString stdenv.cc; + dontStrip = true; - configureFlags = - optional (!enableMultilib) "--disable-multilib" ++ - optional (!enableShared) "--disable-shared" ++ - optional langJava "--with-ecj-jar=${javaEcj.crossDrv}" ++ - optional javaAwtGtk "--enable-java-awt=gtk" ++ - optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr.crossDrv}" ++ - [ - "--with-gmp=${gmp.crossDrv}" - "--with-mpfr=${mpfr.crossDrv}" - "--with-mpc=${libmpc.crossDrv}" - "--disable-libstdcxx-pch" - "--without-included-gettext" - "--with-system-zlib" - "--enable-languages=${ - concatStrings (intersperse "," - ( optional langC "c" - ++ optional langCC "c++" - ++ optional langFortran "fortran" - ++ optional langJava "java" - ++ optional langAda "ada" - ++ optional langVhdl "vhdl" - ++ optional langGo "go" - ) - ) - }" - ] ++ - optional langAda "--enable-libada" ++ - optional (xgccArch != null) "--with-arch=${xgccArch}" ++ - optional (xgccCpu != null) "--with-cpu=${xgccCpu}" ++ - optional (xgccAbi != null) "--with-abi=${xgccAbi}" ++ - optional (xgccFpu != null) "--with-fpu=${xgccFpu}" ++ - optional (xgccFloat != null) "--with-float=${xgccFloat}" - ; buildFlags = ""; }; + NIX_BUILD_CC = buildPackages.stdenv.cc; # Needed for the cross compilation to work AR = "ar"; @@ -477,18 +460,21 @@ stdenv.mkDerivation ({ # http://gcc.gnu.org/install/specific.html#x86-64-x-solaris210 CC = if stdenv.system == "x86_64-solaris" then "gcc -m64" else "gcc"; - # Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find - # the library headers and binaries, regarless of the language being - # compiled. - - # Note: When building the Java AWT GTK+ peer, the build system doesn't - # honor `--with-gmp' et al., e.g., when building - # `libjava/classpath/native/jni/java-math/gnu_java_math_GMP.c', so we just - # add them to $CPATH and $LIBRARY_PATH in this case. + # Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find the + # library headers and binaries, regarless of the language being compiled. + # + # Note: When building the Java AWT GTK+ peer, the build system doesn't honor + # `--with-gmp' et al., e.g., when building + # `libjava/classpath/native/jni/java-math/gnu_java_math_GMP.c', so we just add + # them to $CPATH and $LIBRARY_PATH in this case. # # Likewise, the LTO code doesn't find zlib. + # + # Cross-compiling, we need gcc not to read ./specs in order to build the g++ + # compiler (after the specs for the cross-gcc are created). Having + # LIBRARY_PATH= makes gcc read the specs from ., and the build breaks. - CPATH = makeSearchPathOutput "dev" "include" ([] + CPATH = optionals (targetPlatform == hostPlatform) (makeSearchPathOutput "dev" "include" ([] ++ optional (zlib != null) zlib ++ optional langJava boehmgc ++ optionals javaAwtGtk xlibs @@ -499,39 +485,38 @@ stdenv.mkDerivation ({ # On GNU/Hurd glibc refers to Mach & Hurd # headers. ++ optionals (libcCross != null && libcCross ? propagatedBuildInputs) - libcCross.propagatedBuildInputs); + libcCross.propagatedBuildInputs + )); - LIBRARY_PATH = makeLibraryPath ([] + LIBRARY_PATH = optionals (targetPlatform == hostPlatform) (makeLibraryPath ([] ++ optional (zlib != null) zlib ++ optional langJava boehmgc ++ optionals javaAwtGtk xlibs ++ optionals javaAwtGtk [ gmp mpfr ] - ++ optional (libpthread != null) libpthread); - - EXTRA_TARGET_CFLAGS = - if targetPlatform != hostPlatform && libcCross != null then [ - "-idirafter ${getDev libcCross}/include" - ] - ++ optionals (! crossStageStatic) [ - "-B${libcCross.out}/lib" - ] - else null; - - EXTRA_TARGET_LDFLAGS = - if targetPlatform != hostPlatform && libcCross != null then [ - "-Wl,-L${libcCross.out}/lib" - ] - ++ (if crossStageStatic then [ + ++ optional (libpthread != null) libpthread) + ); + + EXTRA_TARGET_FLAGS = optionals + (targetPlatform != hostPlatform && libcCross != null) + ([ + "-idirafter ${getDev libcCross}/include" + ] ++ optionals (! crossStageStatic) [ + "-B${libcCross.out}/lib" + ]); + + EXTRA_TARGET_LDFLAGS = optionals + (targetPlatform != hostPlatform && libcCross != null) + ([ + "-Wl,-L${libcCross.out}/lib" + ] ++ (if crossStageStatic then [ "-B${libcCross.out}/lib" ] else [ "-Wl,-rpath,${libcCross.out}/lib" "-Wl,-rpath-link,${libcCross.out}/lib" - ]) - ++ optionals (libpthreadCross != null) [ - "-L${libpthreadCross}/lib" - "-Wl,${libpthreadCross.TARGET_LDFLAGS}" - ] - else null; + ]) ++ optionals (libpthreadCross != null) [ + "-L${libpthreadCross}/lib" + "-Wl,${libpthreadCross.TARGET_LDFLAGS}" + ]); passthru = { inherit langC langCC langObjC langObjCpp langAda langFortran langVhdl langGo version; isGNU = true; }; diff --git a/pkgs/development/compilers/gcc/7/default.nix b/pkgs/development/compilers/gcc/7/default.nix index 7335c784a957..032a20271ee0 100644 --- a/pkgs/development/compilers/gcc/7/default.nix +++ b/pkgs/development/compilers/gcc/7/default.nix @@ -23,7 +23,7 @@ , x11Support ? langJava , gnatboot ? null , enableMultilib ? false -, enablePlugin ? true # whether to support user-supplied plug-ins +, enablePlugin ? hostPlatform == buildPlatform # Whether to support user-supplied plug-ins , name ? "gcc" , libcCross ? null , crossStageStatic ? false @@ -35,6 +35,7 @@ , darwin ? null , flex ? null , buildPlatform, hostPlatform, targetPlatform +, buildPackages }: assert langJava -> zip != null && unzip != null @@ -98,13 +99,13 @@ let version = "7.2.0"; javaAwtGtk = langJava && x11Support; /* Platform flags */ - mkPlatformFlags = platform: let - gccArch = platform.gcc.arch or null; - gccCpu = platform.gcc.cpu or null; - gccAbi = platform.gcc.abi or null; - gccFpu = platform.gcc.fpu or null; - gccFloat = platform.gcc.float or null; - gccMode = platform.gcc.mode or null; + platformFlags = let + gccArch = targetPlatform.platform.gcc.arch or null; + gccCpu = targetPlatform.platform.gcc.cpu or null; + gccAbi = targetPlatform.platform.gcc.abi or null; + gccFpu = targetPlatform.platform.gcc.fpu or null; + gccFloat = targetPlatform.platform.gcc.float or null; + gccMode = targetPlatform.platform.gcc.mode or null; in optional (gccArch != null) "--with-arch=${gccArch}" ++ optional (gccCpu != null) "--with-cpu=${gccCpu}" ++ @@ -117,8 +118,6 @@ let version = "7.2.0"; crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt"; crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem"; crossConfigureFlags = - mkPlatformFlags targetPlatform ++ - # Ensure that -print-prog-name is able to find the correct programs. [ "--with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" "--with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" ] ++ @@ -325,6 +324,8 @@ stdenv.mkDerivation ({ "--with-mpc=${libmpc}" ] ++ optional (libelf != null) "--with-libelf=${libelf}" ++ + optional (!(crossMingw && crossStageStatic)) + "--with-native-system-header-dir=${getDev stdenv.cc.libc}/include" ++ # Basic configuration [ @@ -376,15 +377,7 @@ stdenv.mkDerivation ({ # Ada optional langAda "--enable-libada" ++ - # Cross-compilation - optional (targetPlatform == hostPlatform) ( - let incDir = if hostPlatform.isDarwin - then "${darwin.usr-include}" - else "${getDev stdenv.cc.libc}/include"; - in "--with-native-system-header-dir=${incDir}" - ) ++ - - optional (targetPlatform == hostPlatform) (mkPlatformFlags stdenv.platform) ++ + platformFlags ++ optional (targetPlatform != hostPlatform) crossConfigureFlags ++ optional (!bootstrap) "--disable-bootstrap" ++ @@ -409,61 +402,51 @@ stdenv.mkDerivation ({ else "install"; /* For cross-built gcc (build != host == target) */ - crossAttrs = let - xgccArch = targetPlatform.gcc.arch or null; - xgccCpu = targetPlatform.gcc.cpu or null; - xgccAbi = targetPlatform.gcc.abi or null; - xgccFpu = targetPlatform.gcc.fpu or null; - xgccFloat = targetPlatform.gcc.float or null; - in { + crossAttrs = { + AR_FOR_BUILD = "ar"; + AS_FOR_BUILD = "as"; + LD_FOR_BUILD = "ld"; + NM_FOR_BUILD = "nm"; + OBJCOPY_FOR_BUILD = "objcopy"; + OBJDUMP_FOR_BUILD = "objdump"; + RANLIB_FOR_BUILD = "ranlib"; + SIZE_FOR_BUILD = "size"; + STRINGS_FOR_BUILD = "strings"; + STRIP_FOR_BUILD = "strip"; + CC_FOR_BUILD = "gcc"; + CXX_FOR_BUILD = "g++"; + AR = "${targetPlatform.config}-ar"; + AS = "${targetPlatform.config}-as"; LD = "${targetPlatform.config}-ld"; + NM = "${targetPlatform.config}-nm"; + OBJCOPY = "${targetPlatform.config}-objcopy"; + OBJDUMP = "${targetPlatform.config}-objdump"; + RANLIB = "${targetPlatform.config}-ranlib"; + SIZE = "${targetPlatform.config}-size"; + STRINGS = "${targetPlatform.config}-strings"; + STRIP = "${targetPlatform.config}-strip"; CC = "${targetPlatform.config}-gcc"; - CXX = "${targetPlatform.config}-gcc"; + CXX = "${targetPlatform.config}-g++"; + AR_FOR_TARGET = "${targetPlatform.config}-ar"; + AS_FOR_TARGET = "${targetPlatform.config}-as"; LD_FOR_TARGET = "${targetPlatform.config}-ld"; - CC_FOR_TARGET = "${targetPlatform.config}-gcc"; NM_FOR_TARGET = "${targetPlatform.config}-nm"; + OBJCOPY_FOR_TARGET = "${targetPlatform.config}-objcopy"; + OBJDUMP_FOR_TARGET = "${targetPlatform.config}-objdump"; + RANLIB_FOR_TARGET = "${targetPlatform.config}-ranlib"; + SIZE_FOR_TARGET = "${targetPlatform.config}-size"; + STRINGS_FOR_TARGET = "${targetPlatform.config}-strings"; + STRIP_FOR_TARGET = "${targetPlatform.config}-strip"; + CC_FOR_TARGET = "${targetPlatform.config}-gcc"; CXX_FOR_TARGET = "${targetPlatform.config}-g++"; - # If we are making a cross compiler, targetPlatform != hostPlatform - NIX_CC_CROSS = optionalString (targetPlatform == hostPlatform) builtins.toString stdenv.cc; + dontStrip = true; - configureFlags = - optional (!enableMultilib) "--disable-multilib" ++ - optional (!enableShared) "--disable-shared" ++ - optional langJava "--with-ecj-jar=${javaEcj.crossDrv}" ++ - optional javaAwtGtk "--enable-java-awt=gtk" ++ - optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr.crossDrv}" ++ - [ - "--with-gmp=${gmp.crossDrv}" - "--with-mpfr=${mpfr.crossDrv}" - "--with-mpc=${libmpc.crossDrv}" - "--disable-libstdcxx-pch" - "--without-included-gettext" - "--with-system-zlib" - "--enable-languages=${ - concatStrings (intersperse "," - ( optional langC "c" - ++ optional langCC "c++" - ++ optional langFortran "fortran" - ++ optional langJava "java" - ++ optional langAda "ada" - ++ optional langVhdl "vhdl" - ++ optional langGo "go" - ) - ) - }" - ] ++ - optional langAda "--enable-libada" ++ - optional (xgccArch != null) "--with-arch=${xgccArch}" ++ - optional (xgccCpu != null) "--with-cpu=${xgccCpu}" ++ - optional (xgccAbi != null) "--with-abi=${xgccAbi}" ++ - optional (xgccFpu != null) "--with-fpu=${xgccFpu}" ++ - optional (xgccFloat != null) "--with-float=${xgccFloat}" - ; buildFlags = ""; }; + NIX_BUILD_CC = buildPackages.stdenv.cc; # Needed for the cross compilation to work AR = "ar"; @@ -471,18 +454,21 @@ stdenv.mkDerivation ({ # http://gcc.gnu.org/install/specific.html#x86-64-x-solaris210 CC = if stdenv.system == "x86_64-solaris" then "gcc -m64" else "gcc"; - # Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find - # the library headers and binaries, regarless of the language being - # compiled. - - # Note: When building the Java AWT GTK+ peer, the build system doesn't - # honor `--with-gmp' et al., e.g., when building - # `libjava/classpath/native/jni/java-math/gnu_java_math_GMP.c', so we just - # add them to $CPATH and $LIBRARY_PATH in this case. + # Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find the + # library headers and binaries, regarless of the language being compiled. + # + # Note: When building the Java AWT GTK+ peer, the build system doesn't honor + # `--with-gmp' et al., e.g., when building + # `libjava/classpath/native/jni/java-math/gnu_java_math_GMP.c', so we just add + # them to $CPATH and $LIBRARY_PATH in this case. # # Likewise, the LTO code doesn't find zlib. + # + # Cross-compiling, we need gcc not to read ./specs in order to build the g++ + # compiler (after the specs for the cross-gcc are created). Having + # LIBRARY_PATH= makes gcc read the specs from ., and the build breaks. - CPATH = makeSearchPathOutput "dev" "include" ([] + CPATH = optionals (targetPlatform == hostPlatform) (makeSearchPathOutput "dev" "include" ([] ++ optional (zlib != null) zlib ++ optional langJava boehmgc ++ optionals javaAwtGtk xlibs @@ -493,39 +479,38 @@ stdenv.mkDerivation ({ # On GNU/Hurd glibc refers to Mach & Hurd # headers. ++ optionals (libcCross != null && libcCross ? propagatedBuildInputs) - libcCross.propagatedBuildInputs); + libcCross.propagatedBuildInputs + )); - LIBRARY_PATH = makeLibraryPath ([] + LIBRARY_PATH = optionals (targetPlatform == hostPlatform) (makeLibraryPath ([] ++ optional (zlib != null) zlib ++ optional langJava boehmgc ++ optionals javaAwtGtk xlibs ++ optionals javaAwtGtk [ gmp mpfr ] - ++ optional (libpthread != null) libpthread); - - EXTRA_TARGET_CFLAGS = - if targetPlatform != hostPlatform && libcCross != null then [ - "-idirafter ${getDev libcCross}/include" - ] - ++ optionals (! crossStageStatic) [ - "-B${libcCross.out}/lib" - ] - else null; - - EXTRA_TARGET_LDFLAGS = - if targetPlatform != hostPlatform && libcCross != null then [ - "-Wl,-L${libcCross.out}/lib" - ] - ++ (if crossStageStatic then [ + ++ optional (libpthread != null) libpthread) + ); + + EXTRA_TARGET_FLAGS = optionals + (targetPlatform != hostPlatform && libcCross != null) + ([ + "-idirafter ${getDev libcCross}/include" + ] ++ optionals (! crossStageStatic) [ + "-B${libcCross.out}/lib" + ]); + + EXTRA_TARGET_LDFLAGS = optionals + (targetPlatform != hostPlatform && libcCross != null) + ([ + "-Wl,-L${libcCross.out}/lib" + ] ++ (if crossStageStatic then [ "-B${libcCross.out}/lib" ] else [ "-Wl,-rpath,${libcCross.out}/lib" "-Wl,-rpath-link,${libcCross.out}/lib" - ]) - ++ optionals (libpthreadCross != null) [ - "-L${libpthreadCross}/lib" - "-Wl,${libpthreadCross.TARGET_LDFLAGS}" - ] - else null; + ]) ++ optionals (libpthreadCross != null) [ + "-L${libpthreadCross}/lib" + "-Wl,${libpthreadCross.TARGET_LDFLAGS}" + ]); passthru = { inherit langC langCC langObjC langObjCpp langAda langFortran langVhdl langGo version; isGNU = true; }; diff --git a/pkgs/development/compilers/gcc/builder.sh b/pkgs/development/compilers/gcc/builder.sh index ee56425f00b4..d21755d7b1dc 100644 --- a/pkgs/development/compilers/gcc/builder.sh +++ b/pkgs/development/compilers/gcc/builder.sh @@ -1,8 +1,12 @@ source $stdenv/setup -export NIX_FIXINC_DUMMY=$NIX_BUILD_TOP/dummy -mkdir $NIX_FIXINC_DUMMY +oldOpts="$(shopt -po nounset)" || true +set -euo pipefail + + +export NIX_FIXINC_DUMMY="$NIX_BUILD_TOP/dummy" +mkdir "$NIX_FIXINC_DUMMY" if test "$staticCompiler" = "1"; then @@ -13,141 +17,125 @@ fi # GCC interprets empty paths as ".", which we don't want. -if test -z "$CPATH"; then unset CPATH; fi -if test -z "$LIBRARY_PATH"; then unset LIBRARY_PATH; fi -echo "\$CPATH is \`$CPATH'" -echo "\$LIBRARY_PATH is \`$LIBRARY_PATH'" +if test -z "${CPATH-}"; then unset CPATH; fi +if test -z "${LIBRARY_PATH-}"; then unset LIBRARY_PATH; fi +echo "\$CPATH is \`${CPATH-}'" +echo "\$LIBRARY_PATH is \`${LIBRARY_PATH-}'" if test "$noSysDirs" = "1"; then - if test -e $NIX_CC/nix-support/orig-libc; then - - # Figure out what extra flags to pass to the gcc compilers - # being generated to make sure that they use our glibc. - extraFlags="$(cat $NIX_CC/nix-support/libc-cflags)" - extraLDFlags="$(cat $NIX_CC/nix-support/libc-ldflags) $(cat $NIX_CC/nix-support/libc-ldflags-before || true)" + declare \ + EXTRA_BUILD_FLAGS EXTRA_FLAGS EXTRA_TARGET_FLAGS \ + EXTRA_BUILD_LDFLAGS EXTRA_TARGET_LDFLAGS - # Use *real* header files, otherwise a limits.h is generated - # that does not include Glibc's limits.h (notably missing - # SSIZE_MAX, which breaks the build). - export NIX_FIXINC_DUMMY=$libc_dev/include - - # The path to the Glibc binaries such as `crti.o'. - glibc_libdir="$(cat $NIX_CC/nix-support/orig-libc)/lib" - - else - # Hack: support impure environments. - extraFlags="-isystem /usr/include" - extraLDFlags="-L/usr/lib64 -L/usr/lib" - glibc_libdir="/usr/lib" - export NIX_FIXINC_DUMMY=/usr/include - fi + for pre in 'BUILD_' ''; do + curCC="NIX_${pre}CC" + curFIXINC="NIX_${pre}FIXINC_DUMMY" - extraFlags="-I$NIX_FIXINC_DUMMY $extraFlags" - extraLDFlags="-L$glibc_libdir -rpath $glibc_libdir $extraLDFlags" + declare -a extraFlags=() extraLDFlags=() + if [[ -e "${!curCC}/nix-support/orig-libc" ]]; then + # Figure out what extra flags to pass to the gcc compilers being + # generated to make sure that they use our glibc. + extraFlags=($(cat "${!curCC}/nix-support/libc-cflags")) + extraLDFlags=($(cat "${!curCC}/nix-support/libc-ldflags") $(cat "${!curCC}/nix-support/libc-ldflags-before" || true)) - # BOOT_CFLAGS defaults to `-g -O2'; since we override it below, - # make sure to explictly add them so that files compiled with the - # bootstrap compiler are optimized and (optionally) contain - # debugging information (info "(gccinstall) Building"). - if test -n "$dontStrip"; then - extraFlags="-O2 -g $extraFlags" - else - # Don't pass `-g' at all; this saves space while building. - extraFlags="-O2 $extraFlags" - fi + # The path to the Glibc binaries such as `crti.o'. + glibc_libdir="$(cat "${!curCC}/nix-support/orig-libc")/lib" + glibc_devdir="$(cat "${!curCC}/nix-support/orig-libc-dev")" - EXTRA_FLAGS="$extraFlags" - for i in $extraLDFlags; do - EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,$i" - done + # Use *real* header files, otherwise a limits.h is generated that + # does not include Glibc's limits.h (notably missing SSIZE_MAX, + # which breaks the build). + declare NIX_${pre}FIXINC_DUMMY="$glibc_devdir/include" + else + # Hack: support impure environments. + extraFlags=("-isystem" "/usr/include") + extraLDFlags=("-L/usr/lib64" "-L/usr/lib") + glibc_libdir="/usr/lib" + declare NIX_${pre}FIXINC_DUMMY=/usr/include + fi - if test -n "$targetConfig"; then - # Cross-compiling, we need gcc not to read ./specs in order to build - # the g++ compiler (after the specs for the cross-gcc are created). - # Having LIBRARY_PATH= makes gcc read the specs from ., and the build - # breaks. Having this variable comes from the default.nix code to bring - # gcj in. - unset LIBRARY_PATH - unset CPATH - else - if test -z "$NIX_CC_CROSS"; then - EXTRA_TARGET_CFLAGS="$EXTRA_FLAGS" - EXTRA_TARGET_CXXFLAGS="$EXTRA_FLAGS" - EXTRA_TARGET_LDFLAGS="$EXTRA_LDFLAGS" + extraFlags=("-I${!curFIXINC}" + "${extraFlags[@]}") + extraLDFlags=("-L$glibc_libdir" "-rpath" "$glibc_libdir" + "${extraLDFlags[@]}") + + # BOOT_CFLAGS defaults to `-g -O2'; since we override it below, make + # sure to explictly add them so that files compiled with the bootstrap + # compiler are optimized and (optionally) contain debugging information + # (info "(gccinstall) Building"). + if test -n "${dontStrip-}"; then + extraFlags=("-O2" "-g" "${extraFlags[@]}") else - # This the case of cross-building the gcc. - # We need special flags for the target, different than those of the build - # Assertion: - test -e $NIX_CC_CROSS/nix-support/orig-libc + # Don't pass `-g' at all; this saves space while building. + extraFlags=("-O2" "${extraFlags[@]}") + fi - # Figure out what extra flags to pass to the gcc compilers - # being generated to make sure that they use our glibc. - extraFlags="$(cat $NIX_CC_CROSS/nix-support/libc-cflags)" - extraLDFlags="$(cat $NIX_CC_CROSS/nix-support/libc-ldflags) $(cat $NIX_CC_CROSS/nix-support/libc-ldflags-before)" + declare EXTRA_${pre}FLAGS="${extraFlags[*]}" + for i in "${extraLDFlags[@]}"; do + declare EXTRA_${pre}LDFLAGS+=" -Wl,$i" + done + done - # The path to the Glibc binaries such as `crti.o'. - glibc_dir="$(cat $NIX_CC_CROSS/nix-support/orig-libc)" - glibc_libdir="$glibc_dir/lib" - glibc_devdir="$(cat $NIX_CC_CROSS/nix-support/orig-libc-dev)" - configureFlags="$configureFlags --with-native-system-header-dir=$glibc_devdir/include" - - # Use *real* header files, otherwise a limits.h is generated - # that does not include Glibc's limits.h (notably missing - # SSIZE_MAX, which breaks the build). - NIX_FIXINC_DUMMY_CROSS="$glibc_devdir/include" - - extraFlags="-I$NIX_FIXINC_DUMMY_CROSS $extraFlags" - extraLDFlags="-L$glibc_libdir -rpath $glibc_libdir $extraLDFlags" - - EXTRA_TARGET_CFLAGS="$extraFlags" - for i in $extraLDFlags; do - EXTRA_TARGET_LDFLAGS="$EXTRA_TARGET_LDFLAGS -Wl,$i" - done - fi + if test -z "${targetConfig-}"; then + # host = target, so the flags are the same + EXTRA_TARGET_FLAGS="$EXTRA_FLAGS" + EXTRA_TARGET_LDFLAGS="$EXTRA_LDFLAGS" fi # CFLAGS_FOR_TARGET are needed for the libstdc++ configure script to find # the startfiles. # FLAGS_FOR_TARGET are needed for the target libraries to receive the -Bxxx # for the startfiles. - makeFlagsArray+=( \ - NATIVE_SYSTEM_HEADER_DIR="$NIX_FIXINC_DUMMY" \ - SYSTEM_HEADER_DIR="$NIX_FIXINC_DUMMY" \ - CFLAGS_FOR_BUILD="$EXTRA_FLAGS $EXTRA_LDFLAGS" \ - CXXFLAGS_FOR_BUILD="$EXTRA_FLAGS $EXTRA_LDFLAGS" \ - CFLAGS_FOR_TARGET="$EXTRA_TARGET_CFLAGS $EXTRA_TARGET_LDFLAGS" \ - CXXFLAGS_FOR_TARGET="$EXTRA_TARGET_CFLAGS $EXTRA_TARGET_LDFLAGS" \ - FLAGS_FOR_TARGET="$EXTRA_TARGET_CFLAGS $EXTRA_TARGET_LDFLAGS" \ - LDFLAGS_FOR_BUILD="$EXTRA_FLAGS $EXTRA_LDFLAGS" \ - LDFLAGS_FOR_TARGET="$EXTRA_TARGET_LDFLAGS $EXTRA_TARGET_LDFLAGS" \ + makeFlagsArray+=( + "BUILD_SYSTEM_HEADER_DIR=$NIX_BUILD_FIXINC_DUMMY" + "SYSTEM_HEADER_DIR=$NIX_BUILD_FIXINC_DUMMY" + "NATIVE_SYSTEM_HEADER_DIR=$NIX_FIXINC_DUMMY" + + "LDFLAGS_FOR_BUILD=$EXTRA_BUILD_LDFLAGS" + #"LDFLAGS=$EXTRA_LDFLAGS" + "LDFLAGS_FOR_TARGET=$EXTRA_TARGET_LDFLAGS" + + "CFLAGS_FOR_BUILD=$EXTRA_BUILD_FLAGS $EXTRA_BUILD_LDFLAGS" + "CXXFLAGS_FOR_BUILD=$EXTRA_BUILD_FLAGS $EXTRA_BUILD_LDFLAGS" + "FLAGS_FOR_BUILD=$EXTRA_BUILD_FLAGS $EXTRA_BUILD_LDFLAGS" + + # It seems there is a bug in GCC 5 + #"CFLAGS=$EXTRA_FLAGS $EXTRA_LDFLAGS" + #"CXXFLAGS=$EXTRA_FLAGS $EXTRA_LDFLAGS" + + "CFLAGS_FOR_TARGET=$EXTRA_TARGET_FLAGS $EXTRA_TARGET_LDFLAGS" + "CXXFLAGS_FOR_TARGET=$EXTRA_TARGET_FLAGS $EXTRA_TARGET_LDFLAGS" + "FLAGS_FOR_TARGET=$EXTRA_TARGET_FLAGS $EXTRA_TARGET_LDFLAGS" + ) + + if test -z "${targetConfig-}"; then + makeFlagsArray+=( + "BOOT_CFLAGS=$EXTRA_FLAGS $EXTRA_LDFLAGS" + "BOOT_LDFLAGS=$EXTRA_TARGET_FLAGS $EXTRA_TARGET_LDFLAGS" ) - - if test -z "$targetConfig"; then - makeFlagsArray+=( \ - BOOT_CFLAGS="$EXTRA_FLAGS $EXTRA_LDFLAGS" \ - BOOT_LDFLAGS="$EXTRA_TARGET_CFLAGS $EXTRA_TARGET_LDFLAGS" \ - ) fi - if test -n "$targetConfig" -a "$crossStageStatic" == 1; then + if test -n "${targetConfig-}" -a "$crossStageStatic" == 1; then # We don't want the gcc build to assume there will be a libc providing # limits.h in this stagae - makeFlagsArray+=( \ - LIMITS_H_TEST=false \ - ) + makeFlagsArray+=( + 'LIMITS_H_TEST=false' + ) else - makeFlagsArray+=( \ - LIMITS_H_TEST=true \ - ) + makeFlagsArray+=( + 'LIMITS_H_TEST=true' + ) fi fi -if test -n "$targetConfig"; then +if test -n "${targetConfig-}"; then # The host strip will destroy some important details of the objects dontStrip=1 fi +eval "$oldOpts" + providedPreConfigure="$preConfigure"; preConfigure() { if test -n "$newlibSrc"; then diff --git a/pkgs/development/compilers/gcc/snapshot/default.nix b/pkgs/development/compilers/gcc/snapshot/default.nix index 48840ffa7c23..f2f8eeb09a5e 100644 --- a/pkgs/development/compilers/gcc/snapshot/default.nix +++ b/pkgs/development/compilers/gcc/snapshot/default.nix @@ -23,7 +23,7 @@ , x11Support ? langJava , gnatboot ? null , enableMultilib ? false -, enablePlugin ? true # whether to support user-supplied plug-ins +, enablePlugin ? hostPlatform == buildPlatform # Whether to support user-supplied plug-ins , name ? "gcc" , libcCross ? null , crossStageStatic ? false @@ -35,6 +35,7 @@ , darwin ? null , flex ? null , buildPlatform, hostPlatform, targetPlatform +, buildPackages }: assert langJava -> zip != null && unzip != null @@ -98,13 +99,13 @@ let version = "7-20170409"; javaAwtGtk = langJava && x11Support; /* Platform flags */ - mkPlatformFlags = platform: let - gccArch = platform.gcc.arch or null; - gccCpu = platform.gcc.cpu or null; - gccAbi = platform.gcc.abi or null; - gccFpu = platform.gcc.fpu or null; - gccFloat = platform.gcc.float or null; - gccMode = platform.gcc.mode or null; + platformFlags = let + gccArch = targetPlatform.platform.gcc.arch or null; + gccCpu = targetPlatform.platform.gcc.cpu or null; + gccAbi = targetPlatform.platform.gcc.abi or null; + gccFpu = targetPlatform.platform.gcc.fpu or null; + gccFloat = targetPlatform.platform.gcc.float or null; + gccMode = targetPlatform.platform.gcc.mode or null; in optional (gccArch != null) "--with-arch=${gccArch}" ++ optional (gccCpu != null) "--with-cpu=${gccCpu}" ++ @@ -117,8 +118,6 @@ let version = "7-20170409"; crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt"; crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem"; crossConfigureFlags = - mkPlatformFlags targetPlatform ++ - # Ensure that -print-prog-name is able to find the correct programs. [ "--with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" "--with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" ] ++ @@ -312,6 +311,8 @@ stdenv.mkDerivation ({ "--with-mpc=${libmpc}" ] ++ optional (libelf != null) "--with-libelf=${libelf}" ++ + optional (!(crossMingw && crossStageStatic)) + "--with-native-system-header-dir=${getDev stdenv.cc.libc}/include" ++ # Basic configuration [ @@ -363,15 +364,7 @@ stdenv.mkDerivation ({ # Ada optional langAda "--enable-libada" ++ - # Cross-compilation - optional (targetPlatform == hostPlatform) ( - let incDir = if hostPlatform.isDarwin - then "${darwin.usr-include}" - else "${getDev stdenv.cc.libc}/include"; - in "--with-native-system-header-dir=${incDir}" - ) ++ - - optional (targetPlatform == hostPlatform) (mkPlatformFlags stdenv.platform) ++ + platformFlags ++ optional (targetPlatform != hostPlatform) crossConfigureFlags ++ optional (!bootstrap) "--disable-bootstrap" ++ @@ -396,61 +389,51 @@ stdenv.mkDerivation ({ else "install"; /* For cross-built gcc (build != host == target) */ - crossAttrs = let - xgccArch = targetPlatform.gcc.arch or null; - xgccCpu = targetPlatform.gcc.cpu or null; - xgccAbi = targetPlatform.gcc.abi or null; - xgccFpu = targetPlatform.gcc.fpu or null; - xgccFloat = targetPlatform.gcc.float or null; - in { + crossAttrs = { + AR_FOR_BUILD = "ar"; + AS_FOR_BUILD = "as"; + LD_FOR_BUILD = "ld"; + NM_FOR_BUILD = "nm"; + OBJCOPY_FOR_BUILD = "objcopy"; + OBJDUMP_FOR_BUILD = "objdump"; + RANLIB_FOR_BUILD = "ranlib"; + SIZE_FOR_BUILD = "size"; + STRINGS_FOR_BUILD = "strings"; + STRIP_FOR_BUILD = "strip"; + CC_FOR_BUILD = "gcc"; + CXX_FOR_BUILD = "g++"; + AR = "${targetPlatform.config}-ar"; + AS = "${targetPlatform.config}-as"; LD = "${targetPlatform.config}-ld"; + NM = "${targetPlatform.config}-nm"; + OBJCOPY = "${targetPlatform.config}-objcopy"; + OBJDUMP = "${targetPlatform.config}-objdump"; + RANLIB = "${targetPlatform.config}-ranlib"; + SIZE = "${targetPlatform.config}-size"; + STRINGS = "${targetPlatform.config}-strings"; + STRIP = "${targetPlatform.config}-strip"; CC = "${targetPlatform.config}-gcc"; - CXX = "${targetPlatform.config}-gcc"; + CXX = "${targetPlatform.config}-g++"; + AR_FOR_TARGET = "${targetPlatform.config}-ar"; + AS_FOR_TARGET = "${targetPlatform.config}-as"; LD_FOR_TARGET = "${targetPlatform.config}-ld"; - CC_FOR_TARGET = "${targetPlatform.config}-gcc"; NM_FOR_TARGET = "${targetPlatform.config}-nm"; + OBJCOPY_FOR_TARGET = "${targetPlatform.config}-objcopy"; + OBJDUMP_FOR_TARGET = "${targetPlatform.config}-objdump"; + RANLIB_FOR_TARGET = "${targetPlatform.config}-ranlib"; + SIZE_FOR_TARGET = "${targetPlatform.config}-size"; + STRINGS_FOR_TARGET = "${targetPlatform.config}-strings"; + STRIP_FOR_TARGET = "${targetPlatform.config}-strip"; + CC_FOR_TARGET = "${targetPlatform.config}-gcc"; CXX_FOR_TARGET = "${targetPlatform.config}-g++"; - # If we are making a cross compiler, targetPlatform != hostPlatform - NIX_CC_CROSS = optionalString (targetPlatform == hostPlatform) builtins.toString stdenv.cc; + dontStrip = true; - configureFlags = - optional (!enableMultilib) "--disable-multilib" ++ - optional (!enableShared) "--disable-shared" ++ - optional langJava "--with-ecj-jar=${javaEcj.crossDrv}" ++ - optional javaAwtGtk "--enable-java-awt=gtk" ++ - optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr.crossDrv}" ++ - [ - "--with-gmp=${gmp.crossDrv}" - "--with-mpfr=${mpfr.crossDrv}" - "--with-mpc=${libmpc.crossDrv}" - "--disable-libstdcxx-pch" - "--without-included-gettext" - "--with-system-zlib" - "--enable-languages=${ - concatStrings (intersperse "," - ( optional langC "c" - ++ optional langCC "c++" - ++ optional langFortran "fortran" - ++ optional langJava "java" - ++ optional langAda "ada" - ++ optional langVhdl "vhdl" - ++ optional langGo "go" - ) - ) - }" - ] ++ - optional langAda "--enable-libada" ++ - optional (xgccArch != null) "--with-arch=${xgccArch}" ++ - optional (xgccCpu != null) "--with-cpu=${xgccCpu}" ++ - optional (xgccAbi != null) "--with-abi=${xgccAbi}" ++ - optional (xgccFpu != null) "--with-fpu=${xgccFpu}" ++ - optional (xgccFloat != null) "--with-float=${xgccFloat}" - ; buildFlags = ""; }; + NIX_BUILD_CC = buildPackages.stdenv.cc; # Needed for the cross compilation to work AR = "ar"; @@ -458,18 +441,21 @@ stdenv.mkDerivation ({ # http://gcc.gnu.org/install/specific.html#x86-64-x-solaris210 CC = if stdenv.system == "x86_64-solaris" then "gcc -m64" else "gcc"; - # Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find - # the library headers and binaries, regarless of the language being - # compiled. - - # Note: When building the Java AWT GTK+ peer, the build system doesn't - # honor `--with-gmp' et al., e.g., when building - # `libjava/classpath/native/jni/java-math/gnu_java_math_GMP.c', so we just - # add them to $CPATH and $LIBRARY_PATH in this case. + # Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find the + # library headers and binaries, regarless of the language being compiled. + # + # Note: When building the Java AWT GTK+ peer, the build system doesn't honor + # `--with-gmp' et al., e.g., when building + # `libjava/classpath/native/jni/java-math/gnu_java_math_GMP.c', so we just add + # them to $CPATH and $LIBRARY_PATH in this case. # # Likewise, the LTO code doesn't find zlib. + # + # Cross-compiling, we need gcc not to read ./specs in order to build the g++ + # compiler (after the specs for the cross-gcc are created). Having + # LIBRARY_PATH= makes gcc read the specs from ., and the build breaks. - CPATH = makeSearchPathOutput "dev" "include" ([] + CPATH = optionals (targetPlatform == hostPlatform) (makeSearchPathOutput "dev" "include" ([] ++ optional (zlib != null) zlib ++ optional langJava boehmgc ++ optionals javaAwtGtk xlibs @@ -480,39 +466,38 @@ stdenv.mkDerivation ({ # On GNU/Hurd glibc refers to Mach & Hurd # headers. ++ optionals (libcCross != null && libcCross ? propagatedBuildInputs) - libcCross.propagatedBuildInputs); + libcCross.propagatedBuildInputs + )); - LIBRARY_PATH = makeLibraryPath ([] + LIBRARY_PATH = optionals (targetPlatform == hostPlatform) (makeLibraryPath ([] ++ optional (zlib != null) zlib ++ optional langJava boehmgc ++ optionals javaAwtGtk xlibs ++ optionals javaAwtGtk [ gmp mpfr ] - ++ optional (libpthread != null) libpthread); - - EXTRA_TARGET_CFLAGS = - if targetPlatform != hostPlatform && libcCross != null then [ - "-idirafter ${getDev libcCross}/include" - ] - ++ optionals (! crossStageStatic) [ - "-B${libcCross.out}/lib" - ] - else null; - - EXTRA_TARGET_LDFLAGS = - if targetPlatform != hostPlatform && libcCross != null then [ - "-Wl,-L${libcCross.out}/lib" - ] - ++ (if crossStageStatic then [ + ++ optional (libpthread != null) libpthread) + ); + + EXTRA_TARGET_FLAGS = optionals + (targetPlatform != hostPlatform && libcCross != null) + ([ + "-idirafter ${getDev libcCross}/include" + ] ++ optionals (! crossStageStatic) [ + "-B${libcCross.out}/lib" + ]); + + EXTRA_TARGET_LDFLAGS = optionals + (targetPlatform != hostPlatform && libcCross != null) + ([ + "-Wl,-L${libcCross.out}/lib" + ] ++ (if crossStageStatic then [ "-B${libcCross.out}/lib" ] else [ "-Wl,-rpath,${libcCross.out}/lib" "-Wl,-rpath-link,${libcCross.out}/lib" - ]) - ++ optionals (libpthreadCross != null) [ - "-L${libpthreadCross}/lib" - "-Wl,${libpthreadCross.TARGET_LDFLAGS}" - ] - else null; + ]) ++ optionals (libpthreadCross != null) [ + "-L${libpthreadCross}/lib" + "-Wl,${libpthreadCross.TARGET_LDFLAGS}" + ]); passthru = { inherit langC langCC langObjC langObjCpp langAda langFortran langVhdl langGo version; isGNU = true; }; diff --git a/pkgs/development/compilers/ghc/head.nix b/pkgs/development/compilers/ghc/head.nix index 92ba3f6a46ed..3f5dfa65958f 100644 --- a/pkgs/development/compilers/ghc/head.nix +++ b/pkgs/development/compilers/ghc/head.nix @@ -5,7 +5,7 @@ # If enabled GHC will be build with the GPL-free but slower integer-simple # library instead of the faster but GPLed integer-gmp library. , enableIntegerSimple ? false, gmp -, version ? "8.3.20170808" +, version ? "8.5.20171209" }: let @@ -13,7 +13,7 @@ let commonBuildInputs = [ ghc perl autoconf automake happy alex python3 ]; - rev = "14457cf6a50f708eecece8f286f08687791d51f7"; + rev = "4335c07ca7e64624819b22644d7591853826bd75"; commonPreConfigure = '' echo ${version} >VERSION @@ -34,7 +34,7 @@ in stdenv.mkDerivation (rec { src = fetchgit { url = "git://git.haskell.org/ghc.git"; inherit rev; - sha256 = "08vj9ca7rq7rv8pjfl14fg2lg9d6zisrwlq6bi5vzr006816dy8y"; + sha256 = "19csad94sk0bw2nj97ppmnwh4c193jg0jmg5w2sx9rqm9ih4yg85"; }; postPatch = "patchShebangs ."; diff --git a/pkgs/development/compilers/hhvm/default.nix b/pkgs/development/compilers/hhvm/default.nix index 4159b7bd52b7..2f84387a8888 100644 --- a/pkgs/development/compilers/hhvm/default.nix +++ b/pkgs/development/compilers/hhvm/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchgit, fetchurl, cmake, pkgconfig, boost, libunwind, libmemcached +{ stdenv, fetchgit, cmake, pkgconfig, boost, libunwind, libmemcached , pcre, libevent, gd, curl, libxml2, icu, flex, bison, openssl, zlib, php , expat, libcap, oniguruma, libdwarf, libmcrypt, tbb, gperftools, glog, libkrb5 , bzip2, openldap, readline, libelf, uwimap, binutils, cyrus_sasl, pam, libpng @@ -8,13 +8,13 @@ stdenv.mkDerivation rec { name = "hhvm-${version}"; - version = "3.21"; + version = "3.23.2"; # use git version since we need submodules src = fetchgit { url = "https://github.com/facebook/hhvm.git"; - rev = "56483773e2edd9e61782f1901ce40e47959e71b8"; - sha256 = "0dmdk98nv04m0fv6909gfbsxqlkckn369yi7kadhir0r7vxsj7wa"; + rev = "HHVM-${version}"; + sha256 = "1nic49j8nghx82lgvz0b95r78sqz46qaaqv4nx48p8yrj9ysnd7i"; fetchSubmodules = true; }; @@ -29,10 +29,6 @@ stdenv.mkDerivation rec { patches = [ ./flexible-array-members-gcc6.patch - (fetchurl { - url = https://github.com/facebook/hhvm/commit/b506902af2b7c53de6d6c92491c2086472292004.patch; - sha256 = "1br7diczqks6b1xjrdsac599fc62m9l17gcx7dvkc0qj54lq7ys4"; - }) ]; enableParallelBuilding = true; diff --git a/pkgs/development/compilers/jetbrains-jdk/default.nix b/pkgs/development/compilers/jetbrains-jdk/default.nix index aa3f49ca4d9f..7f23a4d507e7 100644 --- a/pkgs/development/compilers/jetbrains-jdk/default.nix +++ b/pkgs/development/compilers/jetbrains-jdk/default.nix @@ -16,7 +16,7 @@ let drv = stdenv.mkDerivation rec { sha256 = "1768f02i3dxdbxn8n29d522h8v0mkgnhpb8ixzq5p54vwjmfl6md"; } else - abort "unsupported system: ${stdenv.system}"; + throw "unsupported system: ${stdenv.system}"; nativeBuildInputs = [ file ]; @@ -73,7 +73,7 @@ let drv = stdenv.mkDerivation rec { your own risk. ''; homepage = "https://bintray.com/jetbrains/intellij-jdk/"; - licenses = licenses.gpl2; + license = licenses.gpl2; maintainers = with maintainers; [ edwtjo ]; platforms = with platforms; [ "x86_64-linux" ]; }; diff --git a/pkgs/development/compilers/ldc/default.nix b/pkgs/development/compilers/ldc/default.nix index 154da0707f67..73d798bb66fd 100644 --- a/pkgs/development/compilers/ldc/default.nix +++ b/pkgs/development/compilers/ldc/default.nix @@ -249,10 +249,13 @@ stdenv.mkDerivation rec { inherit ldcUnittests; name = "ldc-${version}"; phases = "installPhase"; + buildInputs = ldcBuild.buildInputs; installPhase = '' mkdir $out cp -r --symbolic-link ${ldcBuild}/* $out/ ''; + + meta = ldcBuild.meta; } diff --git a/pkgs/development/compilers/mono/4.4.nix b/pkgs/development/compilers/mono/4.4.nix index 1ec679e6e41b..f80cffe220ea 100644 --- a/pkgs/development/compilers/mono/4.4.nix +++ b/pkgs/development/compilers/mono/4.4.nix @@ -4,4 +4,5 @@ callPackage ./generic.nix (rec { inherit Foundation libobjc; version = "4.4.2.11"; sha256 = "0cxnypw1j7s253wr5hy05k42ghgg2s9qibp10kndwnp5bv12q34h"; + enableParallelBuilding = false; # #32386, https://hydra.nixos.org/build/65565737 }) diff --git a/pkgs/development/compilers/mono/4.6.nix b/pkgs/development/compilers/mono/4.6.nix index 283c34efb321..7c9918cdd397 100644 --- a/pkgs/development/compilers/mono/4.6.nix +++ b/pkgs/development/compilers/mono/4.6.nix @@ -4,4 +4,5 @@ callPackage ./generic.nix (rec { inherit Foundation libobjc; version = "4.6.2.16"; sha256 = "190f7kcrm1y5x61s1xwdmjnwc3czsg50s3mml4xmix7byh3x2rc9"; + enableParallelBuilding = false; # #32386, https://hydra.nixos.org/build/65617511 }) diff --git a/pkgs/development/compilers/mono/4.8.nix b/pkgs/development/compilers/mono/4.8.nix index 6d870ae30680..c3ba316cd13b 100644 --- a/pkgs/development/compilers/mono/4.8.nix +++ b/pkgs/development/compilers/mono/4.8.nix @@ -4,4 +4,5 @@ callPackage ./generic-cmake.nix (rec { inherit Foundation libobjc; version = "4.8.1.0"; sha256 = "1vyvp2g28ihcgxgxr8nhzyzdmzicsh5djzk8dk1hj5p5f2k3ijqq"; + enableParallelBuilding = false; # #32386, https://hydra.nixos.org/build/65600645 }) diff --git a/pkgs/development/compilers/mono/5.0.nix b/pkgs/development/compilers/mono/5.0.nix index 911ba0ae02a7..d10d6e3e6053 100644 --- a/pkgs/development/compilers/mono/5.0.nix +++ b/pkgs/development/compilers/mono/5.0.nix @@ -4,4 +4,5 @@ callPackage ./generic-cmake.nix (rec { inherit Foundation libobjc; version = "5.0.1.1"; sha256 = "064pgsmanpybpbhpam9jv9n8aicx6mlyb7a91yzh3kcksmqsxmj8"; + enableParallelBuilding = false; # #32386, https://hydra.nixos.org/build/65820147 }) diff --git a/pkgs/development/compilers/mono/generic-cmake.nix b/pkgs/development/compilers/mono/generic-cmake.nix index f6e3f5a0100b..de19e4b633e7 100644 --- a/pkgs/development/compilers/mono/generic-cmake.nix +++ b/pkgs/development/compilers/mono/generic-cmake.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, bison, pkgconfig, glib, gettext, perl, libgdiplus, libX11, callPackage, ncurses, zlib, withLLVM ? false, cacert, Foundation, libobjc, python, version, sha256, autoconf, libtool, automake, cmake, which }: +{ stdenv, fetchurl, bison, pkgconfig, glib, gettext, perl, libgdiplus, libX11, callPackage, ncurses, zlib, withLLVM ? false, cacert, Foundation, libobjc, python, version, sha256, autoconf, libtool, automake, cmake, which, enableParallelBuilding ? true }: let llvm = callPackage ./llvm.nix { }; @@ -45,9 +45,6 @@ stdenv.mkDerivation rec { # The file /nix/store/xxx-mono-2.4.2.1/lib/mscorlib.dll is an invalid CIL image dontStrip = true; - # Parallel building doesn't work, as shows http://hydra.nixos.org/build/2983601 - enableParallelBuilding = false; - # We want pkg-config to take priority over the dlls in the Mono framework and the GAC # because we control pkg-config patches = [ ./pkgconfig-before-gac.patch ]; @@ -83,6 +80,8 @@ stdenv.mkDerivation rec { ln -s $out/bin/mcs $out/bin/gmcs ''; + inherit enableParallelBuilding; + meta = { homepage = http://mono-project.com/; description = "Cross platform, open source .NET development framework"; diff --git a/pkgs/development/compilers/mono/generic.nix b/pkgs/development/compilers/mono/generic.nix index 3bc962859e28..51e39593fe14 100644 --- a/pkgs/development/compilers/mono/generic.nix +++ b/pkgs/development/compilers/mono/generic.nix @@ -1,4 +1,11 @@ -{ stdenv, fetchurl, bison, pkgconfig, glib, gettext, perl, libgdiplus, libX11, callPackage, ncurses, zlib, withLLVM ? false, cacert, Foundation, libobjc, python, version, sha256 }: +{ stdenv, fetchurl, bison, pkgconfig, glib, gettext, perl, libgdiplus, libX11 +, callPackage, ncurses, zlib +, cacert, Foundation, libobjc, python + +, version, sha256 +, withLLVM ? false +, enableParallelBuilding ? true +}: let llvm = callPackage ./llvm.nix { }; @@ -40,9 +47,6 @@ stdenv.mkDerivation rec { # The file /nix/store/xxx-mono-2.4.2.1/lib/mscorlib.dll is an invalid CIL image dontStrip = true; - # Parallel building doesn't work, as shows http://hydra.nixos.org/build/2983601 - enableParallelBuilding = false; - # We want pkg-config to take priority over the dlls in the Mono framework and the GAC # because we control pkg-config patches = [ ./pkgconfig-before-gac.patch ]; @@ -79,6 +83,8 @@ stdenv.mkDerivation rec { ln -s $out/bin/mcs $out/bin/gmcs ''; + inherit enableParallelBuilding; + meta = { homepage = http://mono-project.com/; description = "Cross platform, open source .NET development framework"; diff --git a/pkgs/development/compilers/nasm/default.nix b/pkgs/development/compilers/nasm/default.nix index a84c5bbf7605..5394f2bcbbfb 100644 --- a/pkgs/development/compilers/nasm/default.nix +++ b/pkgs/development/compilers/nasm/default.nix @@ -2,11 +2,11 @@ stdenv.mkDerivation rec { name = "nasm-${version}"; - version = "2.13.01"; + version = "2.13.02"; src = fetchurl { url = "http://www.nasm.us/pub/nasm/releasebuilds/${version}/${name}.tar.bz2"; - sha256 = "1ylqs4sqh0paia970v6hpdgq5icxns9zlg21qql232bz1apppy88"; + sha256 = "1gmvjckxvkmx1kbglgrakc98qhy55xlqlk5flrdihz5yhv92hc4d"; }; nativeBuildInputs = [ perl ]; diff --git a/pkgs/development/compilers/ocaml/ber-metaocaml-003.nix b/pkgs/development/compilers/ocaml/ber-metaocaml-104.nix index c95d29326a4e..81c8cd534025 100644 --- a/pkgs/development/compilers/ocaml/ber-metaocaml-003.nix +++ b/pkgs/development/compilers/ocaml/ber-metaocaml-104.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, ncurses, xlibsWrapper }: +{ stdenv, fetchurl, ncurses, libX11, xproto, buildEnv }: let useX11 = stdenv.isi686 || stdenv.isx86_64; @@ -7,52 +7,65 @@ let in stdenv.mkDerivation rec { - + name = "ber-metaocaml-${version}"; - version = "003"; - + version = "104"; + src = fetchurl { - url = "http://caml.inria.fr/pub/distrib/ocaml-3.11/ocaml-3.11.2.tar.bz2"; - sha256 = "0hw1yp1mmfyn1pmda232d0ry69m7ln1z0fn5lgi8nz3y1mx3iww6"; + url = "http://caml.inria.fr/pub/distrib/ocaml-4.04/ocaml-4.04.0.tar.gz"; + sha256 = "1pi2hdm9lxhn45qvfqfss1hpa4jijm14qgmrgajsadxqdiplhqyb"; }; metaocaml = fetchurl { - url = "http://okmij.org/ftp/ML/ber-metaocaml.tar.gz"; - sha256 = "1kq1if25c1wvcdiy4g46xk05dkc1am2gc4qvmg4x19wvvaz09gzf"; + url = "http://okmij.org/ftp/ML/ber-metaocaml-104.tar.gz"; + sha256 = "1gmwlxairxqcmqa2r6kbf8b4dxc7pfhfbh48g1s14d3z20rj8nib"; }; # Needed to avoid a SIGBUS on the final executable on mips NIX_CFLAGS_COMPILE = if stdenv.isMips then "-fPIC" else ""; - patches = optionals stdenv.isDarwin [ ./gnused-on-osx-fix.patch ]; + x11env = buildEnv { name = "x11env"; paths = [libX11 xproto];}; + x11lib = x11env + "/lib"; + x11inc = x11env + "/include"; prefixKey = "-prefix "; - configureFlags = ["-no-tk"] ++ optionals useX11 [ "-x11lib" xlibsWrapper ]; - buildFlags = "core coreboot all"; # "world" + optionalString useNativeCompilers " bootstrap world.opt"; - buildInputs = [ncurses] ++ optionals useX11 [ xlibsWrapper ]; + configureFlags = optionals useX11 [ "-x11lib" x11lib + "-x11include" x11inc ]; + + dontStrip = true; + buildInputs = [ncurses] ++ optionals useX11 [ libX11 xproto ]; installFlags = "-i"; installTargets = "install"; # + optionalString useNativeCompilers " installopt"; - prePatch = '' - CAT=$(type -tp cat) - sed -e "s@/bin/cat@$CAT@" -i config/auto-aux/sharpbang - patch -p0 < ${./mips64.patch} - ''; + postConfigure = '' tar -xvzf $metaocaml cd ${name} make patch cd .. ''; - postBuild = '' + buildPhase = '' + make world + make -i install + + make bootstrap + make opt.opt + make installopt mkdir -p $out/include ln -sv $out/lib/ocaml/caml $out/include/caml - ''; - postInstall = '' cd ${name} make all make install + make install.opt + cd .. + ''; + installPhase = ""; + postBuild = '' + ''; + checkPhase = '' + cd ${name} make test make test-compile + make test-native cd .. ''; @@ -67,6 +80,5 @@ stdenv.mkDerivation rec { A conservative extension of OCaml with the primitive type of code values, and three basic multi-stage expression forms: Brackets, Escape, and Run ''; - broken = true; }; } diff --git a/pkgs/development/compilers/oraclejdk/jdk8cpu-linux.nix b/pkgs/development/compilers/oraclejdk/jdk8cpu-linux.nix index cf3aadddd955..096fe9dbb2ba 100644 --- a/pkgs/development/compilers/oraclejdk/jdk8cpu-linux.nix +++ b/pkgs/development/compilers/oraclejdk/jdk8cpu-linux.nix @@ -4,7 +4,7 @@ import ./jdk-linux-base.nix { downloadUrl = http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html; sha256.i686-linux = "0w1snn9hxwvdnk77frhdzbsm6v30v99dy5zmpy8ij7yxd57z6ql0"; sha256.x86_64-linux = "0zq2dxbxmshz080yskhc8y2wbqi0y0kl9girxjbb4rwk837010n7"; - sha256.armv7l-linux = "10r3nyssx8piyjaspravwgj2bnq4537041pn0lz4fk5b3473kgfb"; + sha256.armv7l-linux = "0fdkvg1al7g9lqbq10rlw400aqr0xxi2a802319sw5n0zipkrjic"; sha256.aarch64-linux = "1xva22cjjpwa95h7x3xzyymn1bgxp1q67j5j304kn6cqah4k31j1"; jceName = "jce_policy-8.zip"; jceDownloadUrl = http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html; diff --git a/pkgs/development/compilers/oraclejdk/jdk8psu-linux.nix b/pkgs/development/compilers/oraclejdk/jdk8psu-linux.nix index 920583f1dc47..6c2816c8b87a 100644 --- a/pkgs/development/compilers/oraclejdk/jdk8psu-linux.nix +++ b/pkgs/development/compilers/oraclejdk/jdk8psu-linux.nix @@ -4,7 +4,7 @@ import ./jdk-linux-base.nix { downloadUrl = http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html; sha256.i686-linux = "0gjc7kcfx40f43z1w1qsn1fqxdz8d46wml2g11qgm55ishhv2q7w"; sha256.x86_64-linux = "1gv1348hrgna9l3sssv3g9jzs37y1lkx05xq83chav9z1hs3p2r1"; - sha256.armv7l-linux = "10r3nyssx8piyjaspravwgj2bnq4537041pn0lz4fk5b3473kgfb"; + sha256.armv7l-linux = "1w0hwslsd3z0kvb3z7gmbh20xsyiz73vglmdqz2108y7alim7arm"; sha256.aarch64-linux = "13qpxa8nxsnikmm7h6ysnsdqg5vl8j7hzfa8kgh20z8a17fhj9kk"; jceName = "jce_policy-8.zip"; jceDownloadUrl = http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html; diff --git a/pkgs/development/compilers/owl-lisp/default.nix b/pkgs/development/compilers/owl-lisp/default.nix index b01914afc295..4e2f8b2af5b4 100644 --- a/pkgs/development/compilers/owl-lisp/default.nix +++ b/pkgs/development/compilers/owl-lisp/default.nix @@ -23,7 +23,7 @@ stdenv.mkDerivation rec { doCheck = false; meta = with stdenv.lib; { - descripton = "A functional lisp"; + description = "A functional lisp"; homepage = https://github.com/aoh/owl-lisp; license = licenses.mit; maintainers = with maintainers; [ peterhoeg ]; diff --git a/pkgs/development/compilers/reason/default.nix b/pkgs/development/compilers/reason/default.nix index 54d39d8fa631..649f4bc4582b 100644 --- a/pkgs/development/compilers/reason/default.nix +++ b/pkgs/development/compilers/reason/default.nix @@ -3,13 +3,13 @@ buildOcaml rec { name = "reason"; - version = "3.0.3"; + version = "3.0.4"; src = fetchFromGitHub { owner = "facebook"; repo = "reason"; rev = version; - sha256 = "19kp1cnxi6dq89xh07c14q7kzkawbxdkwrvn1rl48l78d04agnxx"; + sha256 = "15qhx85him5rr4j0ygj3jh3qv9ijrn82ibr9scbn0qrnn43kj047"; }; propagatedBuildInputs = [ menhir merlin_extend ppx_tools_versioned ]; @@ -34,7 +34,7 @@ buildOcaml rec { ''; meta = with stdenv.lib; { - homepage = https://facebook.github.io/reason/; + homepage = https://reasonml.github.io/; description = "Facebook's friendly syntax to OCaml"; license = licenses.bsd3; maintainers = [ maintainers.volth ]; diff --git a/pkgs/development/compilers/yosys/default.nix b/pkgs/development/compilers/yosys/default.nix index b1c36f841a4b..117319c1ad5c 100644 --- a/pkgs/development/compilers/yosys/default.nix +++ b/pkgs/development/compilers/yosys/default.nix @@ -4,22 +4,22 @@ stdenv.mkDerivation rec { name = "yosys-${version}"; - version = "2017.11.05"; + version = "2017.12.06"; srcs = [ (fetchFromGitHub { - owner = "cliffordwolf"; - repo = "yosys"; - rev = "4f31cb6daddedcee467d85797d81b79360ce1826"; - sha256 = "1a5n0g5kpjsy8f99f64w81gkrr450wvffp407r1pddl8pmb0c3r7"; - name = "yosys"; + owner = "cliffordwolf"; + repo = "yosys"; + rev = "8f2638ae2f12a48dcad14f24b0211c16ac724762"; + sha256 = "0synbskclgn97hp28myvl0hp8pqp66awp37z4cv7zl154ipysfl1"; + name = "yosys"; }) (fetchFromBitbucket { - owner = "alanmi"; - repo = "abc"; - rev = "f6838749f234"; - sha256 = "0n7ywvih958h1c4n7a398a9w3qikhkv885fx5j3y2a0xwqc86m4y"; - name = "yosys-abc"; + owner = "alanmi"; + repo = "abc"; + rev = "31fc97b0aeed"; + sha256 = "0ljmclr4hfh3iiyfw7ji0fm8j983la8021xfpnfd20dyc807hh65"; + name = "yosys-abc"; }) ]; sourceRoot = "yosys"; |