diff --git a/pkgs/development/compilers/gcc/11/default.nix b/pkgs/development/compilers/gcc/11/default.nix index 3a9f50be3e7..73f3d7b2a97 100644 --- a/pkgs/development/compilers/gcc/11/default.nix +++ b/pkgs/development/compilers/gcc/11/default.nix @@ -68,7 +68,7 @@ let majorVersion = "11"; url = "https://git.busybox.net/buildroot/plain/package/gcc/${version}/0900-remove-selftests.patch?id=11271540bfe6adafbc133caf6b5b902a816f5f02"; sha256 = ""; # TODO: uncomment and check hash when available. }) */ - ++ optional langAda ../gnat-cflags.patch + ++ optional langAda ../gnat-cflags-11.patch ++ optional langFortran ../gfortran-driving.patch ++ optional (targetPlatform.libc == "musl" && targetPlatform.isPower) ../ppc-musl.patch diff --git a/pkgs/development/compilers/gcc/gnat-cflags-11.patch b/pkgs/development/compilers/gcc/gnat-cflags-11.patch new file mode 100644 index 00000000000..03ef2866452 --- /dev/null +++ b/pkgs/development/compilers/gcc/gnat-cflags-11.patch @@ -0,0 +1,35 @@ +diff --git a/gcc/ada/gcc-interface/Makefile.in b/gcc/ada/gcc-interface/Makefile.in +index 4e74252bd74..0d848b5b4e3 100644 +--- a/gcc/ada/gcc-interface/Makefile.in ++++ b/gcc/ada/gcc-interface/Makefile.in +@@ -111,7 +111,7 @@ NO_OMIT_ADAFLAGS = -fno-omit-frame-pointer + NO_SIBLING_ADAFLAGS = -fno-optimize-sibling-calls + NO_REORDER_ADAFLAGS = -fno-toplevel-reorder + GNATLIBFLAGS = -W -Wall -gnatg -nostdinc +-GNATLIBCFLAGS = -g -O2 ++GNATLIBCFLAGS = -g -O2 $(CFLAGS_FOR_TARGET) + # Pretend that _Unwind_GetIPInfo is available for the target by default. This + # should be autodetected during the configuration of libada and passed down to + # here, but we need something for --disable-libada and hope for the best. +@@ -198,7 +198,7 @@ RTSDIR = rts$(subst /,_,$(MULTISUBDIR)) + # Link flags used to build gnat tools. By default we prefer to statically + # link with libgcc to avoid a dependency on shared libgcc (which is tricky + # to deal with as it may conflict with the libgcc provided by the system). +-GCC_LINK_FLAGS=-static-libstdc++ -static-libgcc ++GCC_LINK_FLAGS=-static-libstdc++ -static-libgcc $(CFLAGS_FOR_TARGET) + + # End of variables for you to override. + +diff --git a/libada/Makefile.in b/libada/Makefile.in +index 522b9207326..ca866c74471 100644 +--- a/libada/Makefile.in ++++ b/libada/Makefile.in +@@ -59,7 +59,7 @@ LDFLAGS= + CFLAGS=-g + PICFLAG = @PICFLAG@ + GNATLIBFLAGS= -W -Wall -gnatpg -nostdinc +-GNATLIBCFLAGS= -g -O2 ++GNATLIBCFLAGS= -g -O2 $(CFLAGS) + GNATLIBCFLAGS_FOR_C = -W -Wall $(GNATLIBCFLAGS) $(CFLAGS_FOR_TARGET) \ + -fexceptions -DIN_RTS @have_getipinfo@ @have_capability@ + diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 9e1f13fe0a0..24fbb63792b 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -10618,6 +10618,14 @@ in profiledCompiler = false; }); + gfortran11 = wrapCC (gcc11.cc.override { + name = "gfortran"; + langFortran = true; + langCC = false; + langC = false; + profiledCompiler = false; + }); + libgccjit = gcc.cc.override { name = "libgccjit"; langFortran = false; @@ -10669,6 +10677,15 @@ in gnatboot = gnat6; }); + gnat11 = wrapCC (gcc11.cc.override { + name = "gnat"; + langC = true; + langCC = false; + langAda = true; + profiledCompiler = false; + gnatboot = gnat6; + }); + gnatboot = wrapCC (callPackage ../development/compilers/gnatboot { }); gnu-smalltalk = callPackage ../development/compilers/gnu-smalltalk { };