gnat12: Add support for x86_64-darwin

+78 -10
+1 -1
pkgs/development/compilers/gcc/10/default.nix
··· 185 185 186 186 preConfigure = (import ../common/pre-configure.nix { 187 187 inherit lib; 188 - inherit version targetPlatform hostPlatform gnatboot langAda langGo langJit crossStageStatic enableMultilib; 188 + inherit version targetPlatform hostPlatform buildPlatform gnatboot langAda langGo langJit crossStageStatic enableMultilib; 189 189 }) + '' 190 190 ln -sf ${libxcrypt}/include/crypt.h libsanitizer/sanitizer_common/crypt.h 191 191 '';
+1 -1
pkgs/development/compilers/gcc/11/default.nix
··· 189 189 190 190 preConfigure = (import ../common/pre-configure.nix { 191 191 inherit lib; 192 - inherit version targetPlatform hostPlatform gnatboot langAda langGo langJit crossStageStatic enableMultilib; 192 + inherit version targetPlatform hostPlatform buildPlatform gnatboot langAda langGo langJit crossStageStatic enableMultilib; 193 193 }) + '' 194 194 ln -sf ${libxcrypt}/include/crypt.h libsanitizer/sanitizer_common/crypt.h 195 195 '';
+4 -1
pkgs/development/compilers/gcc/12/default.nix
··· 109 109 }) 110 110 ] 111 111 112 + # Fix detection of bootstrap compiler Ada support (cctools as) on Nix Darwin 113 + ++ optional (stdenv.isDarwin && langAda) ../ada-cctools-as-detection-configure.patch 114 + 112 115 # Obtain latest patch with ../update-mcfgthread-patches.sh 113 116 ++ optional (!crossStageStatic && targetPlatform.isMinGW && threadsCross.model == "mcf") ./Added-mcf-thread-model-support-from-mcfgthread.patch; 114 117 ··· 227 230 228 231 preConfigure = (import ../common/pre-configure.nix { 229 232 inherit lib; 230 - inherit version targetPlatform hostPlatform gnatboot langAda langGo langJit crossStageStatic enableMultilib; 233 + inherit version targetPlatform hostPlatform buildPlatform gnatboot langAda langGo langJit crossStageStatic enableMultilib; 231 234 }) + '' 232 235 ln -sf ${libxcrypt}/include/crypt.h libsanitizer/sanitizer_common/crypt.h 233 236 '';
+1 -1
pkgs/development/compilers/gcc/4.8/default.nix
··· 192 192 193 193 preConfigure = import ../common/pre-configure.nix { 194 194 inherit lib; 195 - inherit version targetPlatform hostPlatform langJava langGo crossStageStatic enableMultilib; 195 + inherit version targetPlatform hostPlatform buildPlatform langJava langGo crossStageStatic enableMultilib; 196 196 }; 197 197 198 198 dontDisableStatic = true;
+1 -1
pkgs/development/compilers/gcc/4.9/default.nix
··· 212 212 213 213 preConfigure = import ../common/pre-configure.nix { 214 214 inherit lib; 215 - inherit version targetPlatform hostPlatform langJava langGo crossStageStatic enableMultilib; 215 + inherit version targetPlatform hostPlatform buildPlatform langJava langGo crossStageStatic enableMultilib; 216 216 }; 217 217 218 218 dontDisableStatic = true;
+1 -1
pkgs/development/compilers/gcc/6/default.nix
··· 223 223 224 224 preConfigure = import ../common/pre-configure.nix { 225 225 inherit lib; 226 - inherit version targetPlatform hostPlatform gnatboot langJava langAda langGo crossStageStatic enableMultilib; 226 + inherit version targetPlatform hostPlatform buildPlatform gnatboot langJava langAda langGo crossStageStatic enableMultilib; 227 227 }; 228 228 229 229 dontDisableStatic = true;
+1 -1
pkgs/development/compilers/gcc/7/default.nix
··· 191 191 192 192 preConfigure = import ../common/pre-configure.nix { 193 193 inherit lib; 194 - inherit version targetPlatform hostPlatform langGo crossStageStatic enableMultilib; 194 + inherit version targetPlatform hostPlatform buildPlatform langGo crossStageStatic enableMultilib; 195 195 }; 196 196 197 197 dontDisableStatic = true;
+1 -1
pkgs/development/compilers/gcc/8/default.nix
··· 173 173 174 174 preConfigure = import ../common/pre-configure.nix { 175 175 inherit lib; 176 - inherit version targetPlatform hostPlatform langGo crossStageStatic enableMultilib; 176 + inherit version targetPlatform hostPlatform buildPlatform langGo crossStageStatic enableMultilib; 177 177 }; 178 178 179 179 dontDisableStatic = true;
+1 -1
pkgs/development/compilers/gcc/9/default.nix
··· 186 186 187 187 preConfigure = import ../common/pre-configure.nix { 188 188 inherit lib; 189 - inherit version targetPlatform hostPlatform gnatboot langAda langGo langJit crossStageStatic enableMultilib; 189 + inherit version targetPlatform hostPlatform buildPlatform gnatboot langAda langGo langJit crossStageStatic enableMultilib; 190 190 }; 191 191 192 192 dontDisableStatic = true;
+33
pkgs/development/compilers/gcc/ada-cctools-as-detection-configure.patch
··· 1 + As originally implemented, the error message check 2 + described in the configure script 3 + breaks detection of Ada compiler support on x86_64-darwin, 4 + because the assembler in the version of cctools currently used 5 + unconditionally emits a deprecation message to stdout, 6 + with no way to disable it. 7 + 8 + Furthermore, GCC 3.4 was the minimum version needed to build GNAT 9 + as far back as GCC 4.4 (see the GCC git repo, tags/releases/gcc-4.4.0, 10 + gcc/doc/install.texi, lines 2052-2053 [1]); 11 + GCC 3.4 is newer than any of the broken GCC versions 12 + that the configure script works around 13 + (see the part of the comment in the configure script 14 + before the context in the patch below), 15 + and GCC 4.4 is older than any GCC that Nix currently packages (GCC 4.8). 16 + 17 + We therefore choose to not check for error messages, 18 + and just check for an error code. 19 + There's no harm in still checking for an object file being created, though. 20 + 21 + [1]: https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=gcc/doc/install.texi;h=6bdfbece981f7fb6c26da672d45e5d3ba7879c69;hb=b7fc996728085c0591ea7c5d0e1c84a8f6a29bd8#l2052 22 + --- a/configure 2022-08-19 18:09:52.000000000 +1000 23 + +++ b/configure 2022-12-26 17:30:49.000000000 +1100 24 + @@ -5622,8 +5622,7 @@ 25 + # Other compilers, like HP Tru64 UNIX cc, exit successfully when 26 + # given a .adb file, but produce no object file. So we must check 27 + # if an object file was really produced to guard against this. 28 + -errors=`(${CC} -c conftest.adb) 2>&1 || echo failure` 29 + -if test x"$errors" = x && test -f conftest.$ac_objext; then 30 + +if ${CC} -c conftest.adb && test -f conftest.$ac_objext; then 31 + acx_cv_cc_gcc_supports_ada=yes 32 + fi 33 + rm -f conftest.*
+26 -1
pkgs/development/compilers/gcc/common/pre-configure.nix
··· 1 - { lib, version, hostPlatform, targetPlatform 1 + { lib, version, buildPlatform, hostPlatform, targetPlatform 2 2 , gnatboot ? null 3 3 , langAda ? false 4 4 , langJava ? false ··· 22 22 export lib=$out; 23 23 '' + lib.optionalString langAda '' 24 24 export PATH=${gnatboot}/bin:$PATH 25 + '' 26 + 27 + # On x86_64-darwin, the gnatboot bootstrap compiler that we need to build a 28 + # native GCC with Ada support emits assembly that is accepted by the Clang 29 + # integrated assembler, but not by the GNU assembler in cctools-port that Nix 30 + # usually in the x86_64-darwin stdenv. In particular, x86_64-darwin gnatboot 31 + # emits MOVQ as the mnemonic for quadword interunit moves, such as between XMM 32 + # and general registers (e.g "movq %xmm0, %rbp"); the cctools-port assembler, 33 + # however, only recognises MOVD for such moves. 34 + # 35 + # Therefore, for native x86_64-darwin builds that support Ada, we have to use 36 + # the Clang integrated assembler to build (at least stage 1 of) GCC, but have to 37 + # target GCC at the cctools-port GNU assembler. In the wrapped x86_64-darwin 38 + # gnatboot, the former is provided as `as`, while the latter is provided as 39 + # `gas`. 40 + # 41 + + lib.optionalString ( 42 + langAda 43 + && buildPlatform == hostPlatform 44 + && hostPlatform == targetPlatform 45 + && targetPlatform.isx86_64 46 + && targetPlatform.isDarwin 47 + ) '' 48 + export AS_FOR_BUILD=${gnatboot}/bin/as 49 + export AS_FOR_TARGET=${gnatboot}/bin/gas 25 50 '' 26 51 27 52 # NOTE 2020/3/18: This environment variable prevents configure scripts from
+7
pkgs/top-level/all-packages.nix
··· 14491 14491 && stdenv.buildPlatform == stdenv.hostPlatform 14492 14492 then buildPackages.gnatboot12 14493 14493 else buildPackages.gnat12; 14494 + stdenv = 14495 + if stdenv.hostPlatform == stdenv.targetPlatform 14496 + && stdenv.buildPlatform == stdenv.hostPlatform 14497 + && stdenv.buildPlatform.isDarwin 14498 + && stdenv.buildPlatform.isx86_64 14499 + then overrideCC stdenv gnatboot12 14500 + else stdenv; 14494 14501 }); 14495 14502 14496 14503 gnatboot = gnatboot12;