From 60f57d9c666c2ff2b3e235ea71128a931e911ca5 Mon Sep 17 00:00:00 2001 From: Misty De Meo Date: Sun, 9 Feb 2025 17:55:42 -0800 Subject: [PATCH 01/16] gcc14 14.2.0 --- Library/Formula/gcc14.rb | 256 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 256 insertions(+) create mode 100644 Library/Formula/gcc14.rb diff --git a/Library/Formula/gcc14.rb b/Library/Formula/gcc14.rb new file mode 100644 index 0000000000..25918e69f4 --- /dev/null +++ b/Library/Formula/gcc14.rb @@ -0,0 +1,256 @@ +class Gcc14 < Formula + def arch + if Hardware::CPU.type == :intel + if MacOS.prefer_64_bit? + "x86_64" + else + "i686" + end + elsif Hardware::CPU.type == :ppc + if MacOS.prefer_64_bit? + "powerpc64" + else + "powerpc" + end + end + end + + def osmajor + `uname -r`.chomp + end + + desc "GNU compiler collection" + homepage "https://gcc.gnu.org" + url "https://ftp.gnu.org/gnu/gcc/gcc-14.2.0/gcc-14.2.0.tar.xz" + mirror "https://ftpmirror.gnu.org/gcc/gcc-14.2.0/gcc-14.2.0.tar.xz" + sha256 "a7b39bc69cbf9e25826c5a60ab26477001f7c08d85cec04bc0e29cabed6f3cc9" + + bottle do + end + + option "with-nls", "Build with native language support (localization)" + # enabling multilib on a host that can't run 64-bit results in build failures + option "without-multilib", "Build without multilib support" if MacOS.prefer_64_bit? + # JIT fails to build on i386, or any platform for Tiger + if !(Hardware::CPU.type == :intel && !MacOS.prefer_64_bit?) || MacOS.version > :leopard + option "with-jit", "Build just-in-time compiler" + end + + # System texinfo is too old + depends_on "texinfo" => :build + depends_on "gmp" + depends_on "libmpc" + depends_on "mpfr" + depends_on "isl" + # System zlib is missing crc32_combine on Tiger + depends_on "zlib" + + if MacOS.version < :leopard + # The as that comes with Tiger isn't capable of dealing with the + # PPC asm that comes in libitm + depends_on "cctools" + # GCC invokes ld with flags the system ld doesn't have + depends_on "ld64" + end + + # Needs a newer tigerbrew-provided GCC to build + fails_with :gcc_4_0 + fails_with :gcc + fails_with :llvm + + # GCC bootstraps itself, so it is OK to have an incompatible C++ stdlib + cxxstdlib_check :skip + + # Applied upstream: https://github.com/gcc-mirror/gcc/commit/1cfe4a4d0d4447b364815d5e5c889deb2e533669 + # Can remove in a later version. + patch :p0 do + url "https://github.com/macports/macports-ports/raw/b5a5b6679f59dcad1b21f66bb01e3f8a3a377b4b/lang/gcc14/files/darwin-ppc-fpu.patch" + sha256 "7f14356f2e9efdf46503ca1156302c9b294db52569f4d56073267142b6d2ee71" + end + + # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117834 + patch :p0 do + url "https://github.com/macports/macports-ports/raw/b5a5b6679f59dcad1b21f66bb01e3f8a3a377b4b/lang/gcc14/files/darwin8-define-PTHREAD_RWLOCK_INITIALIZER.patch" + sha256 "57ffac38f4d5eb4d92634d9e7c339f961e3eb908d13a944d622bfc6915a4f435" + end + + # The bottles are built on systems with the CLT installed, and do not work + # out of the box on Xcode-only systems due to an incorrect sysroot. + def pour_bottle? + MacOS::CLT.installed? + end + + def version_suffix + version.to_s.slice(/\d\d/) + end + + def install + # GCC Bug 25127 for PowerPC + # https://gcc.gnu.org/bugzilla//show_bug.cgi?id=25127 + # ../../../libgcc/unwind.inc: In function '_Unwind_RaiseException': + # ../../../libgcc/unwind.inc:136:1: internal compiler error: in rs6000_emit_prologue, at config/rs6000/rs6000.c:26535 + # GCC 7 fails to install on 10.6 x86_64 at stage3 + # https://github.com/mistydemeo/tigerbrew/issues/554 + ENV.no_optimization + + # Otherwise libstdc++ will be incorrectly tagged with cpusubtype 10 (G4e) + # https://github.com/mistydemeo/tigerbrew/issues/538 + if Hardware::CPU.family == :g3 || ARGV.bottle_arch == :g3 + ENV.append_to_cflags "-force_cpusubtype_ALL" + end + + # We avoiding building: + # - Ada, which requires a pre-existing GCC Ada compiler to bootstrap + # - Go, currently not supported on macOS + # - BRIG + languages = %w[c c++ objc obj-c++ fortran] + + # JIT compiler is off by default, enabling it has performance cost + languages << "jit" if build.with? "jit" + + args = [ + "--build=#{arch}-apple-darwin#{osmajor}", + "--prefix=#{prefix}", + "--libdir=#{lib}/gcc/#{version_suffix}", + "--enable-languages=#{languages.join(",")}", + # Make most executables versioned to avoid conflicts. + "--program-suffix=-#{version_suffix}", + "--with-gmp=#{Formula["gmp"].opt_prefix}", + "--with-mpfr=#{Formula["mpfr"].opt_prefix}", + "--with-mpc=#{Formula["libmpc"].opt_prefix}", + "--with-isl=#{Formula["isl"].opt_prefix}", + "--with-system-zlib", + "--enable-checking=release", + "--with-pkgversion=Tigerbrew #{name} #{pkg_version} #{build.used_options*" "}".strip, + "--with-bugurl=https://github.com/mistydemeo/tigerbrew/issues", + ] + + # "Building GCC with plugin support requires a host that supports + # -fPIC, -shared, -ldl and -rdynamic." + args << "--enable-plugin" if MacOS.version > :leopard + + # Otherwise make fails during comparison at stage 3 + # See: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45248 + args << "--with-dwarf2" if MacOS.version < :leopard + + args << "--disable-nls" if build.without? "nls" + + if build.without?("multilib") || !MacOS.prefer_64_bit? + args << "--disable-multilib" + else + args << "--enable-multilib" + end + + args << "--enable-host-shared" if build.with?("jit") + + # These two flags are required for zlib to be found in the last stage + inreplace "gcc/Makefile.in" do |s| + s.change_make_var! "ZLIB", "-L#{Formula["zlib"].opt_lib} -lz" + s.change_make_var! "ZLIBINC", "-I#{Formula["zlib"].opt_include}" + end + + if MacOS.version < :leopard + # We need to use a newer as to build, but we also want the compiler + # to use it at runtime + ENV["AS"] = ENV["AS_FOR_TARGET"] = "#{Formula["cctools"].bin}/as" + # Following Macports on which tools to specify both in the environment + # and as configure args + args << "--with-as=#{Formula["cctools"].bin}/as" + # We'll also configure the compiler to use the rest of the newer cctools + ENV["AR_FOR_TARGET"] = "#{Formula["cctools"].bin}/ar" + args << "--with-ar=#{Formula["cctools"].bin}/ar" + ENV["NM_FOR_TARGET"] = "#{Formula["cctools"].bin}/nm" + ENV["RANLIB_FOR_TARGET"] = "#{Formula["cctools"].bin}/ranlib" + ENV["STRIP_FOR_TARGET"] = "#{Formula["cctools"].bin}/strip" + + # We need ld both for the build and for the end result compiler to use + # Note that unlike the above, which are more nice-to-haves, gcc-14 + # will actually fail to use the system ld on Tiger. + ENV.ld64 + ENV["LD_FOR_TARGET"] = ENV["LD"] + args << "--with-ld=#{ENV["LD"]}" + + # Avoids the need for the ttyname_r patch + # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117857 + # https://github.com/mistydemeo/tigerbrew/pull/1286#issuecomment-2664224824 + ENV.append_to_cflags "-D__DARWIN_UNIX03" + end + + mkdir "build" do + unless MacOS::CLT.installed? + # For Xcode-only systems, we need to tell the sysroot path. + # "native-system-headers" will be appended + args << "--with-native-system-header-dir=/usr/include" + args << "--with-sysroot=#{MacOS.sdk_path}" + end + + system "../configure", *args + system "make" + system "make", "install" + end + + # Handle conflicts between GCC formulae and avoid interfering + # with system compilers. + # Since GCC 4.8 libffi stuff are no longer shipped. + # Rename man7. + Dir.glob(man7/"*.7") { |file| add_suffix file, version_suffix } + # Even when suffixes are appended, the info pages conflict when + # install-info is run. TODO fix this. + info.rmtree + end + + def add_suffix(file, suffix) + dir = File.dirname(file) + ext = File.extname(file) + base = File.basename(file, ext) + File.rename file, "#{dir}/#{base}-#{suffix}#{ext}" + end + + def caveats + if build.with?("multilib") then <<-EOS.undent + GCC has been built with multilib support. Notably, OpenMP may not work: + https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60670 + If you need OpenMP support you may want to + brew reinstall gcc --without-multilib + EOS + end + end + + test do + (testpath/"hello-c.c").write <<-EOS.undent + #include + int main() + { + puts("Hello, world!"); + return 0; + } + EOS + system "#{bin}/gcc-#{version_suffix}", "-o", "hello-c", "hello-c.c" + assert_equal "Hello, world!\n", `./hello-c` + + (testpath/"hello-cc.cc").write <<-EOS.undent + #include + int main() + { + std::cout << "Hello, world!" << std::endl; + return 0; + } + EOS + system "#{bin}/g++-#{version_suffix}", "-o", "hello-cc", "hello-cc.cc" + assert_equal "Hello, world!\n", `./hello-cc` + + (testpath/"test.f90").write <<-EOS.undent + integer,parameter::m=10000 + real::a(m), b(m) + real::fact=0.5 + + do concurrent (i=1:m) + a(i) = a(i) + fact*b(i) + end do + write(*,"(A)") "Done" + end + EOS + system "#{bin}/gfortran-8", "-o", "test", "test.f90" + assert_equal "Done\n", `./test` + end +end From f44a4ac131f6e2300a769d6a3759bb353b655044 Mon Sep 17 00:00:00 2001 From: Misty De Meo Date: Wed, 19 Feb 2025 17:36:10 -0800 Subject: [PATCH 02/16] isl018 0.18 --- Library/Formula/isl018.rb | 58 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 Library/Formula/isl018.rb diff --git a/Library/Formula/isl018.rb b/Library/Formula/isl018.rb new file mode 100644 index 0000000000..6ae3014b5a --- /dev/null +++ b/Library/Formula/isl018.rb @@ -0,0 +1,58 @@ +class Isl018 < Formula + desc "Integer Set Library for the polyhedral model" + homepage "https://libisl.sourceforge.io" + # Note: Always use tarball instead of git tag for stable version. + # + # Currently isl detects its version using source code directory name + # and update isl_version() function accordingly. All other names will + # result in isl_version() function returning "UNKNOWN" and hence break + # package detection. + url "https://libisl.sourceforge.io/isl-0.18.tar.bz2" + mirror "https://gcc.gnu.org/pub/gcc/infrastructure/isl-0.18.tar.bz2" + sha256 "6b8b0fd7f81d0a957beb3679c81bbb34ccc7568d5682844d8924424a0dadcb1b" + + bottle do + cellar :any + sha256 "8561e09544a30e9d7bfef5483e9c54dff72c4ecd06ed2e7d3e4f9a3ef08f5dd0" => :tiger_g4e + sha256 "478c188866c0ae28e7446f0a63fc13d5a3938766accc7a2c1bfaa040a2d378ad" => :leopard_g4e + end + + head do + url "https://repo.or.cz/r/isl.git" + + depends_on "autoconf" => :build + depends_on "automake" => :build + depends_on "libtool" => :build + end + + keg_only "Conflicts with isl." + + depends_on "gmp" + + def install + system "./autogen.sh" if build.head? + system "./configure", "--disable-dependency-tracking", + "--disable-silent-rules", + "--prefix=#{prefix}", + "--with-gmp=system", + "--with-gmp-prefix=#{Formula["gmp"].opt_prefix}" + system "make", "check" + system "make", "install" + (share/"gdb/auto-load").install Dir["#{lib}/*-gdb.py"] + end + + test do + (testpath/"test.c").write <<-EOS.undent + #include + + int main() + { + isl_ctx* ctx = isl_ctx_alloc(); + isl_ctx_free(ctx); + return 0; + } + EOS + system ENV.cc, "test.c", "-L#{lib}", "-lisl", "-o", "test" + system "./test" + end +end From d174491fdd358211e675504fb64f24ba33a8eeb6 Mon Sep 17 00:00:00 2001 From: Misty De Meo Date: Wed, 19 Feb 2025 17:36:49 -0800 Subject: [PATCH 03/16] gcc/gcc8: use isl018 --- Library/Formula/gcc.rb | 5 +++-- Library/Formula/gcc8.rb | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Library/Formula/gcc.rb b/Library/Formula/gcc.rb index 48700b69d6..a9727c8fab 100644 --- a/Library/Formula/gcc.rb +++ b/Library/Formula/gcc.rb @@ -24,6 +24,7 @@ def osmajor url "https://ftp.gnu.org/gnu/gcc/gcc-8.5.0/gcc-8.5.0.tar.xz" mirror "https://ftpmirror.gnu.org/gcc/gcc-8.5.0/gcc-8.5.0.tar.xz" sha256 "d308841a511bb830a6100397b0042db24ce11f642dab6ea6ee44842e5325ed50" + revision 1 bottle do sha256 "092a1e615cdea11f55784252145d1da94f968d1a0ec59266d4f3a9e846be242d" => :tiger_altivec @@ -39,7 +40,7 @@ def osmajor depends_on "gmp" depends_on "libmpc" depends_on "mpfr" - depends_on "isl" + depends_on "isl018" if MacOS.version < :leopard # The as that comes with Tiger isn't capable of dealing with the @@ -105,7 +106,7 @@ def install "--with-gmp=#{Formula["gmp"].opt_prefix}", "--with-mpfr=#{Formula["mpfr"].opt_prefix}", "--with-mpc=#{Formula["libmpc"].opt_prefix}", - "--with-isl=#{Formula["isl"].opt_prefix}", + "--with-isl=#{Formula["isl018"].opt_prefix}", "--with-system-zlib", "--enable-checking=release", "--with-pkgversion=Tigerbrew #{name} #{pkg_version} #{build.used_options*" "}".strip, diff --git a/Library/Formula/gcc8.rb b/Library/Formula/gcc8.rb index 7794e09a5f..d4207755ca 100644 --- a/Library/Formula/gcc8.rb +++ b/Library/Formula/gcc8.rb @@ -24,6 +24,7 @@ def osmajor url "https://ftp.gnu.org/gnu/gcc/gcc-8.5.0/gcc-8.5.0.tar.xz" mirror "https://ftpmirror.gnu.org/gcc/gcc-8.5.0/gcc-8.5.0.tar.xz" sha256 "d308841a511bb830a6100397b0042db24ce11f642dab6ea6ee44842e5325ed50" + revision 1 bottle do end @@ -38,7 +39,7 @@ def osmajor depends_on "gmp" depends_on "libmpc" depends_on "mpfr" - depends_on "isl" + depends_on "isl018" if MacOS.version < :leopard # The as that comes with Tiger isn't capable of dealing with the @@ -104,7 +105,7 @@ def install "--with-gmp=#{Formula["gmp"].opt_prefix}", "--with-mpfr=#{Formula["mpfr"].opt_prefix}", "--with-mpc=#{Formula["libmpc"].opt_prefix}", - "--with-isl=#{Formula["isl"].opt_prefix}", + "--with-isl=#{Formula["isl018"].opt_prefix}", "--with-system-zlib", "--enable-checking=release", "--with-pkgversion=Tigerbrew #{name} #{pkg_version} #{build.used_options*" "}".strip, From 8e5d694d63eadcb3db44e8649a94ff97fd147582 Mon Sep 17 00:00:00 2001 From: Misty De Meo Date: Wed, 19 Feb 2025 17:39:43 -0800 Subject: [PATCH 04/16] gcc7: use isl018 --- Library/Formula/gcc7.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Library/Formula/gcc7.rb b/Library/Formula/gcc7.rb index c600e09109..c61d011674 100644 --- a/Library/Formula/gcc7.rb +++ b/Library/Formula/gcc7.rb @@ -24,9 +24,9 @@ def osmajor url "https://ftp.gnu.org/gnu/gcc/gcc-7.5.0/gcc-7.5.0.tar.xz" mirror "https://ftpmirror.gnu.org/gcc/gcc-7.5.0/gcc-7.5.0.tar.xz" sha256 "b81946e7f01f90528a1f7352ab08cc602b9ccc05d4e44da4bd501c5a189ee661" + revision 1 bottle do - sha256 "6aaaec70d0d139ab61709a09365d37bcc0901486704599c068731bcf75681986" => :tiger_altivec end option "with-nls", "Build with native language support (localization)" @@ -37,7 +37,7 @@ def osmajor depends_on "gmp" depends_on "libmpc" depends_on "mpfr" - depends_on "isl" + depends_on "isl018" if MacOS.version < :leopard # The as that comes with Tiger isn't capable of dealing with the @@ -114,7 +114,7 @@ def install "--with-gmp=#{Formula["gmp"].opt_prefix}", "--with-mpfr=#{Formula["mpfr"].opt_prefix}", "--with-mpc=#{Formula["libmpc"].opt_prefix}", - "--with-isl=#{Formula["isl"].opt_prefix}", + "--with-isl=#{Formula["isl018"].opt_prefix}", "--with-system-zlib", "--enable-checking=release", "--with-pkgversion=Tigerbrew #{name} #{pkg_version} #{build.used_options*" "}".strip, From 84fec0687884f1bd413529e9eea0f9b8ddcc350f Mon Sep 17 00:00:00 2001 From: Misty De Meo Date: Wed, 19 Feb 2025 17:41:03 -0800 Subject: [PATCH 05/16] cloog: use isl018 --- Library/Formula/cloog.rb | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Library/Formula/cloog.rb b/Library/Formula/cloog.rb index 2a32307304..9865b78e94 100644 --- a/Library/Formula/cloog.rb +++ b/Library/Formula/cloog.rb @@ -3,12 +3,10 @@ class Cloog < Formula homepage "http://www.cloog.org/" url "http://www.bastoul.net/cloog/pages/download/count.php3?url=./cloog-0.18.3.tar.gz" sha256 "460c6c740acb8cdfbfbb387156b627cf731b3837605f2ec0001d079d89c69734" + revision 1 bottle do cellar :any - sha1 "e169f6e0745ddcb4ab3460afc4b51ec3dd8bfb28" => :tiger_altivec - sha1 "f7945f830390060dce393f4137220d599485200e" => :leopard_g3 - sha1 "64402d3c088200a45ee65d0ac4aa37cc968d98d1" => :leopard_altivec end head do @@ -20,7 +18,7 @@ class Cloog < Formula depends_on "pkg-config" => :build depends_on "gmp" - depends_on "isl" + depends_on "isl018" def install system "./autogen.sh" if build.head? @@ -32,7 +30,7 @@ def install "--with-gmp=system", "--with-gmp-prefix=#{Formula["gmp"].opt_prefix}", "--with-isl=system", - "--with-isl-prefix=#{Formula["isl"].opt_prefix}" + "--with-isl-prefix=#{Formula["isl018"].opt_prefix}" ] args << "--with-osl=bundled" if build.head? From 3250f2fad41437e0ed241cea2c75f12c608d17e8 Mon Sep 17 00:00:00 2001 From: Misty De Meo Date: Wed, 19 Feb 2025 17:45:21 -0800 Subject: [PATCH 06/16] isl 0.27 --- Library/Formula/isl.rb | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Library/Formula/isl.rb b/Library/Formula/isl.rb index 31809832d0..b83d94efca 100644 --- a/Library/Formula/isl.rb +++ b/Library/Formula/isl.rb @@ -7,14 +7,11 @@ class Isl < Formula # and update isl_version() function accordingly. All other names will # result in isl_version() function returning "UNKNOWN" and hence break # package detection. - url "https://libisl.sourceforge.io/isl-0.18.tar.bz2" - mirror "https://gcc.gnu.org/pub/gcc/infrastructure/isl-0.18.tar.bz2" - sha256 "6b8b0fd7f81d0a957beb3679c81bbb34ccc7568d5682844d8924424a0dadcb1b" + url "https://libisl.sourceforge.io/isl-0.27.tar.xz" + sha256 "6d8babb59e7b672e8cb7870e874f3f7b813b6e00e6af3f8b04f7579965643d5c" bottle do cellar :any - sha256 "8561e09544a30e9d7bfef5483e9c54dff72c4ecd06ed2e7d3e4f9a3ef08f5dd0" => :tiger_g4e - sha256 "478c188866c0ae28e7446f0a63fc13d5a3938766accc7a2c1bfaa040a2d378ad" => :leopard_g4e end head do @@ -34,7 +31,7 @@ def install "--prefix=#{prefix}", "--with-gmp=system", "--with-gmp-prefix=#{Formula["gmp"].opt_prefix}" - system "make", "check" + system "make" system "make", "install" (share/"gdb/auto-load").install Dir["#{lib}/*-gdb.py"] end From 65fab5e7271b0a63158aea091d3c6f4eba776627 Mon Sep 17 00:00:00 2001 From: Misty De Meo Date: Wed, 19 Feb 2025 17:59:23 -0800 Subject: [PATCH 07/16] isl: add bottle --- Library/Formula/isl.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/Library/Formula/isl.rb b/Library/Formula/isl.rb index b83d94efca..c4f14312a8 100644 --- a/Library/Formula/isl.rb +++ b/Library/Formula/isl.rb @@ -12,6 +12,7 @@ class Isl < Formula bottle do cellar :any + sha256 "90a210935291327e174b4f602c0fb1929fecb27024a0bec0b15531adcc98d5ea" => :tiger_altivec end head do From 4278bbe454f64fbf1ce5deb02dd31b6e634311ca Mon Sep 17 00:00:00 2001 From: Misty De Meo Date: Wed, 19 Feb 2025 17:59:42 -0800 Subject: [PATCH 08/16] isl027 0.27 --- Library/Formula/isl027.rb | 56 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 Library/Formula/isl027.rb diff --git a/Library/Formula/isl027.rb b/Library/Formula/isl027.rb new file mode 100644 index 0000000000..4819b9a27c --- /dev/null +++ b/Library/Formula/isl027.rb @@ -0,0 +1,56 @@ +class Isl027 < Formula + desc "Integer Set Library for the polyhedral model" + homepage "https://libisl.sourceforge.io" + # Note: Always use tarball instead of git tag for stable version. + # + # Currently isl detects its version using source code directory name + # and update isl_version() function accordingly. All other names will + # result in isl_version() function returning "UNKNOWN" and hence break + # package detection. + url "https://libisl.sourceforge.io/isl-0.27.tar.xz" + sha256 "6d8babb59e7b672e8cb7870e874f3f7b813b6e00e6af3f8b04f7579965643d5c" + + bottle do + cellar :any + sha256 "90a210935291327e174b4f602c0fb1929fecb27024a0bec0b15531adcc98d5ea" => :tiger_altivec + end + + head do + url "https://repo.or.cz/r/isl.git" + + depends_on "autoconf" => :build + depends_on "automake" => :build + depends_on "libtool" => :build + end + + keg_only "Conflicts with isl." + + depends_on "gmp" + + def install + system "./autogen.sh" if build.head? + system "./configure", "--disable-dependency-tracking", + "--disable-silent-rules", + "--prefix=#{prefix}", + "--with-gmp=system", + "--with-gmp-prefix=#{Formula["gmp"].opt_prefix}" + system "make" + system "make", "install" + (share/"gdb/auto-load").install Dir["#{lib}/*-gdb.py"] + end + + test do + (testpath/"test.c").write <<-EOS.undent + #include + + int main() + { + isl_ctx* ctx = isl_ctx_alloc(); + isl_ctx_free(ctx); + return 0; + } + EOS + system ENV.cc, "test.c", "-L#{lib}", "-lisl", "-o", "test" + system "./test" + end +end From 0fe625d98651cca7994162de615664241049919c Mon Sep 17 00:00:00 2001 From: Misty De Meo Date: Wed, 19 Feb 2025 18:09:55 -0800 Subject: [PATCH 09/16] isl018: add bottle --- Library/Formula/isl018.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Library/Formula/isl018.rb b/Library/Formula/isl018.rb index 6ae3014b5a..ba2dde04fc 100644 --- a/Library/Formula/isl018.rb +++ b/Library/Formula/isl018.rb @@ -13,8 +13,7 @@ class Isl018 < Formula bottle do cellar :any - sha256 "8561e09544a30e9d7bfef5483e9c54dff72c4ecd06ed2e7d3e4f9a3ef08f5dd0" => :tiger_g4e - sha256 "478c188866c0ae28e7446f0a63fc13d5a3938766accc7a2c1bfaa040a2d378ad" => :leopard_g4e + sha256 "978dc72f4ff0f2ad9c67ed726affd2f8c71f91d6048067d9827b3adb0ea2ff0d" => :tiger_altivec end head do From 474902863891c033974c299dace1806ad3191e8c Mon Sep 17 00:00:00 2001 From: Misty De Meo Date: Wed, 19 Feb 2025 18:15:43 -0800 Subject: [PATCH 10/16] isl027: add bottle --- Library/Formula/isl027.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Formula/isl027.rb b/Library/Formula/isl027.rb index 4819b9a27c..4100a34fc4 100644 --- a/Library/Formula/isl027.rb +++ b/Library/Formula/isl027.rb @@ -12,7 +12,7 @@ class Isl027 < Formula bottle do cellar :any - sha256 "90a210935291327e174b4f602c0fb1929fecb27024a0bec0b15531adcc98d5ea" => :tiger_altivec + sha256 "d4b0640fbfb124dd4c22330d883d54d70956339f037a9218141649b1068b9181" => :tiger_altivec end head do From 7103d76fc9318746c4601d735be8a1499d34b14e Mon Sep 17 00:00:00 2001 From: Misty De Meo Date: Thu, 20 Feb 2025 09:05:05 -0800 Subject: [PATCH 11/16] gcc8: add bottle --- Library/Formula/gcc8.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/Library/Formula/gcc8.rb b/Library/Formula/gcc8.rb index d4207755ca..ebb7fa5d93 100644 --- a/Library/Formula/gcc8.rb +++ b/Library/Formula/gcc8.rb @@ -27,6 +27,7 @@ def osmajor revision 1 bottle do + sha256 "36666a794e7ddca183b156cf499871af08a3f91613ed041bf97008003a85d567" => :tiger_altivec end conflicts_with "gcc", :because => "both install the same version of GCC" From 8f696a4b3dd6d2f8d028ca29cc4d1e54ee1eb9b8 Mon Sep 17 00:00:00 2001 From: Misty De Meo Date: Thu, 20 Feb 2025 09:08:48 -0800 Subject: [PATCH 12/16] gcc14: promote to gcc --- Library/Formula/gcc.rb | 87 +++++++++---- Library/Formula/gcc14.rb | 256 --------------------------------------- 2 files changed, 64 insertions(+), 279 deletions(-) delete mode 100644 Library/Formula/gcc14.rb diff --git a/Library/Formula/gcc.rb b/Library/Formula/gcc.rb index a9727c8fab..9acbe4a071 100644 --- a/Library/Formula/gcc.rb +++ b/Library/Formula/gcc.rb @@ -21,41 +21,59 @@ def osmajor desc "GNU compiler collection" homepage "https://gcc.gnu.org" - url "https://ftp.gnu.org/gnu/gcc/gcc-8.5.0/gcc-8.5.0.tar.xz" - mirror "https://ftpmirror.gnu.org/gcc/gcc-8.5.0/gcc-8.5.0.tar.xz" - sha256 "d308841a511bb830a6100397b0042db24ce11f642dab6ea6ee44842e5325ed50" - revision 1 + url "https://ftp.gnu.org/gnu/gcc/gcc-14.2.0/gcc-14.2.0.tar.xz" + mirror "https://ftpmirror.gnu.org/gcc/gcc-14.2.0/gcc-14.2.0.tar.xz" + sha256 "a7b39bc69cbf9e25826c5a60ab26477001f7c08d85cec04bc0e29cabed6f3cc9" bottle do - sha256 "092a1e615cdea11f55784252145d1da94f968d1a0ec59266d4f3a9e846be242d" => :tiger_altivec end - conflicts_with "gcc8", :because => "both install the same version of GCC" - option "with-nls", "Build with native language support (localization)" - option "with-jit", "Build just-in-time compiler" # enabling multilib on a host that can't run 64-bit results in build failures option "without-multilib", "Build without multilib support" if MacOS.prefer_64_bit? + # JIT fails to build on i386, or any platform for Tiger + if !(Hardware::CPU.type == :intel && !MacOS.prefer_64_bit?) || MacOS.version > :leopard + option "with-jit", "Build just-in-time compiler" + end + # System texinfo is too old + depends_on "texinfo" => :build depends_on "gmp" depends_on "libmpc" depends_on "mpfr" - depends_on "isl018" + depends_on "isl" + # System zlib is missing crc32_combine on Tiger + depends_on "zlib" if MacOS.version < :leopard # The as that comes with Tiger isn't capable of dealing with the # PPC asm that comes in libitm - depends_on "cctools" => :build + depends_on "cctools" + # GCC invokes ld with flags the system ld doesn't have + depends_on "ld64" end - # Bug 21514 - [DR 488] templates and anonymous enum - fixed in 4.0.2 - # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=21514 + # Needs a newer tigerbrew-provided GCC to build fails_with :gcc_4_0 + fails_with :gcc fails_with :llvm # GCC bootstraps itself, so it is OK to have an incompatible C++ stdlib cxxstdlib_check :skip + # Applied upstream: https://github.com/gcc-mirror/gcc/commit/1cfe4a4d0d4447b364815d5e5c889deb2e533669 + # Can remove in a later version. + patch :p0 do + url "https://github.com/macports/macports-ports/raw/b5a5b6679f59dcad1b21f66bb01e3f8a3a377b4b/lang/gcc14/files/darwin-ppc-fpu.patch" + sha256 "7f14356f2e9efdf46503ca1156302c9b294db52569f4d56073267142b6d2ee71" + end + + # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117834 + patch :p0 do + url "https://github.com/macports/macports-ports/raw/b5a5b6679f59dcad1b21f66bb01e3f8a3a377b4b/lang/gcc14/files/darwin8-define-PTHREAD_RWLOCK_INITIALIZER.patch" + sha256 "57ffac38f4d5eb4d92634d9e7c339f961e3eb908d13a944d622bfc6915a4f435" + end + # The bottles are built on systems with the CLT installed, and do not work # out of the box on Xcode-only systems due to an incorrect sysroot. def pour_bottle? @@ -63,12 +81,10 @@ def pour_bottle? end def version_suffix - version.to_s.slice(/\d/) + version.to_s.slice(/\d\d/) end def install - # GCC will suffer build errors if forced to use a particular linker. - ENV.delete "LD" # GCC Bug 25127 for PowerPC # https://gcc.gnu.org/bugzilla//show_bug.cgi?id=25127 # ../../../libgcc/unwind.inc: In function '_Unwind_RaiseException': @@ -83,10 +99,6 @@ def install ENV.append_to_cflags "-force_cpusubtype_ALL" end - if MacOS.version < :leopard - ENV["AS"] = ENV["AS_FOR_TARGET"] = "#{Formula["cctools"].bin}/as" - end - # We avoiding building: # - Ada, which requires a pre-existing GCC Ada compiler to bootstrap # - Go, currently not supported on macOS @@ -106,7 +118,7 @@ def install "--with-gmp=#{Formula["gmp"].opt_prefix}", "--with-mpfr=#{Formula["mpfr"].opt_prefix}", "--with-mpc=#{Formula["libmpc"].opt_prefix}", - "--with-isl=#{Formula["isl018"].opt_prefix}", + "--with-isl=#{Formula["isl"].opt_prefix}", "--with-system-zlib", "--enable-checking=release", "--with-pkgversion=Tigerbrew #{name} #{pkg_version} #{build.used_options*" "}".strip, @@ -131,9 +143,38 @@ def install args << "--enable-host-shared" if build.with?("jit") - # Ensure correct install names when linking against libgcc_s; - # see discussion in https://github.com/Homebrew/homebrew/pull/34303 - inreplace "libgcc/config/t-slibgcc-darwin", "@shlib_slibdir@", "#{HOMEBREW_PREFIX}/lib/gcc/#{version_suffix}" + # These two flags are required for zlib to be found in the last stage + inreplace "gcc/Makefile.in" do |s| + s.change_make_var! "ZLIB", "-L#{Formula["zlib"].opt_lib} -lz" + s.change_make_var! "ZLIBINC", "-I#{Formula["zlib"].opt_include}" + end + + if MacOS.version < :leopard + # We need to use a newer as to build, but we also want the compiler + # to use it at runtime + ENV["AS"] = ENV["AS_FOR_TARGET"] = "#{Formula["cctools"].bin}/as" + # Following Macports on which tools to specify both in the environment + # and as configure args + args << "--with-as=#{Formula["cctools"].bin}/as" + # We'll also configure the compiler to use the rest of the newer cctools + ENV["AR_FOR_TARGET"] = "#{Formula["cctools"].bin}/ar" + args << "--with-ar=#{Formula["cctools"].bin}/ar" + ENV["NM_FOR_TARGET"] = "#{Formula["cctools"].bin}/nm" + ENV["RANLIB_FOR_TARGET"] = "#{Formula["cctools"].bin}/ranlib" + ENV["STRIP_FOR_TARGET"] = "#{Formula["cctools"].bin}/strip" + + # We need ld both for the build and for the end result compiler to use + # Note that unlike the above, which are more nice-to-haves, gcc-14 + # will actually fail to use the system ld on Tiger. + ENV.ld64 + ENV["LD_FOR_TARGET"] = ENV["LD"] + args << "--with-ld=#{ENV["LD"]}" + + # Avoids the need for the ttyname_r patch + # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117857 + # https://github.com/mistydemeo/tigerbrew/pull/1286#issuecomment-2664224824 + ENV.append_to_cflags "-D__DARWIN_UNIX03" + end mkdir "build" do unless MacOS::CLT.installed? diff --git a/Library/Formula/gcc14.rb b/Library/Formula/gcc14.rb deleted file mode 100644 index 25918e69f4..0000000000 --- a/Library/Formula/gcc14.rb +++ /dev/null @@ -1,256 +0,0 @@ -class Gcc14 < Formula - def arch - if Hardware::CPU.type == :intel - if MacOS.prefer_64_bit? - "x86_64" - else - "i686" - end - elsif Hardware::CPU.type == :ppc - if MacOS.prefer_64_bit? - "powerpc64" - else - "powerpc" - end - end - end - - def osmajor - `uname -r`.chomp - end - - desc "GNU compiler collection" - homepage "https://gcc.gnu.org" - url "https://ftp.gnu.org/gnu/gcc/gcc-14.2.0/gcc-14.2.0.tar.xz" - mirror "https://ftpmirror.gnu.org/gcc/gcc-14.2.0/gcc-14.2.0.tar.xz" - sha256 "a7b39bc69cbf9e25826c5a60ab26477001f7c08d85cec04bc0e29cabed6f3cc9" - - bottle do - end - - option "with-nls", "Build with native language support (localization)" - # enabling multilib on a host that can't run 64-bit results in build failures - option "without-multilib", "Build without multilib support" if MacOS.prefer_64_bit? - # JIT fails to build on i386, or any platform for Tiger - if !(Hardware::CPU.type == :intel && !MacOS.prefer_64_bit?) || MacOS.version > :leopard - option "with-jit", "Build just-in-time compiler" - end - - # System texinfo is too old - depends_on "texinfo" => :build - depends_on "gmp" - depends_on "libmpc" - depends_on "mpfr" - depends_on "isl" - # System zlib is missing crc32_combine on Tiger - depends_on "zlib" - - if MacOS.version < :leopard - # The as that comes with Tiger isn't capable of dealing with the - # PPC asm that comes in libitm - depends_on "cctools" - # GCC invokes ld with flags the system ld doesn't have - depends_on "ld64" - end - - # Needs a newer tigerbrew-provided GCC to build - fails_with :gcc_4_0 - fails_with :gcc - fails_with :llvm - - # GCC bootstraps itself, so it is OK to have an incompatible C++ stdlib - cxxstdlib_check :skip - - # Applied upstream: https://github.com/gcc-mirror/gcc/commit/1cfe4a4d0d4447b364815d5e5c889deb2e533669 - # Can remove in a later version. - patch :p0 do - url "https://github.com/macports/macports-ports/raw/b5a5b6679f59dcad1b21f66bb01e3f8a3a377b4b/lang/gcc14/files/darwin-ppc-fpu.patch" - sha256 "7f14356f2e9efdf46503ca1156302c9b294db52569f4d56073267142b6d2ee71" - end - - # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117834 - patch :p0 do - url "https://github.com/macports/macports-ports/raw/b5a5b6679f59dcad1b21f66bb01e3f8a3a377b4b/lang/gcc14/files/darwin8-define-PTHREAD_RWLOCK_INITIALIZER.patch" - sha256 "57ffac38f4d5eb4d92634d9e7c339f961e3eb908d13a944d622bfc6915a4f435" - end - - # The bottles are built on systems with the CLT installed, and do not work - # out of the box on Xcode-only systems due to an incorrect sysroot. - def pour_bottle? - MacOS::CLT.installed? - end - - def version_suffix - version.to_s.slice(/\d\d/) - end - - def install - # GCC Bug 25127 for PowerPC - # https://gcc.gnu.org/bugzilla//show_bug.cgi?id=25127 - # ../../../libgcc/unwind.inc: In function '_Unwind_RaiseException': - # ../../../libgcc/unwind.inc:136:1: internal compiler error: in rs6000_emit_prologue, at config/rs6000/rs6000.c:26535 - # GCC 7 fails to install on 10.6 x86_64 at stage3 - # https://github.com/mistydemeo/tigerbrew/issues/554 - ENV.no_optimization - - # Otherwise libstdc++ will be incorrectly tagged with cpusubtype 10 (G4e) - # https://github.com/mistydemeo/tigerbrew/issues/538 - if Hardware::CPU.family == :g3 || ARGV.bottle_arch == :g3 - ENV.append_to_cflags "-force_cpusubtype_ALL" - end - - # We avoiding building: - # - Ada, which requires a pre-existing GCC Ada compiler to bootstrap - # - Go, currently not supported on macOS - # - BRIG - languages = %w[c c++ objc obj-c++ fortran] - - # JIT compiler is off by default, enabling it has performance cost - languages << "jit" if build.with? "jit" - - args = [ - "--build=#{arch}-apple-darwin#{osmajor}", - "--prefix=#{prefix}", - "--libdir=#{lib}/gcc/#{version_suffix}", - "--enable-languages=#{languages.join(",")}", - # Make most executables versioned to avoid conflicts. - "--program-suffix=-#{version_suffix}", - "--with-gmp=#{Formula["gmp"].opt_prefix}", - "--with-mpfr=#{Formula["mpfr"].opt_prefix}", - "--with-mpc=#{Formula["libmpc"].opt_prefix}", - "--with-isl=#{Formula["isl"].opt_prefix}", - "--with-system-zlib", - "--enable-checking=release", - "--with-pkgversion=Tigerbrew #{name} #{pkg_version} #{build.used_options*" "}".strip, - "--with-bugurl=https://github.com/mistydemeo/tigerbrew/issues", - ] - - # "Building GCC with plugin support requires a host that supports - # -fPIC, -shared, -ldl and -rdynamic." - args << "--enable-plugin" if MacOS.version > :leopard - - # Otherwise make fails during comparison at stage 3 - # See: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45248 - args << "--with-dwarf2" if MacOS.version < :leopard - - args << "--disable-nls" if build.without? "nls" - - if build.without?("multilib") || !MacOS.prefer_64_bit? - args << "--disable-multilib" - else - args << "--enable-multilib" - end - - args << "--enable-host-shared" if build.with?("jit") - - # These two flags are required for zlib to be found in the last stage - inreplace "gcc/Makefile.in" do |s| - s.change_make_var! "ZLIB", "-L#{Formula["zlib"].opt_lib} -lz" - s.change_make_var! "ZLIBINC", "-I#{Formula["zlib"].opt_include}" - end - - if MacOS.version < :leopard - # We need to use a newer as to build, but we also want the compiler - # to use it at runtime - ENV["AS"] = ENV["AS_FOR_TARGET"] = "#{Formula["cctools"].bin}/as" - # Following Macports on which tools to specify both in the environment - # and as configure args - args << "--with-as=#{Formula["cctools"].bin}/as" - # We'll also configure the compiler to use the rest of the newer cctools - ENV["AR_FOR_TARGET"] = "#{Formula["cctools"].bin}/ar" - args << "--with-ar=#{Formula["cctools"].bin}/ar" - ENV["NM_FOR_TARGET"] = "#{Formula["cctools"].bin}/nm" - ENV["RANLIB_FOR_TARGET"] = "#{Formula["cctools"].bin}/ranlib" - ENV["STRIP_FOR_TARGET"] = "#{Formula["cctools"].bin}/strip" - - # We need ld both for the build and for the end result compiler to use - # Note that unlike the above, which are more nice-to-haves, gcc-14 - # will actually fail to use the system ld on Tiger. - ENV.ld64 - ENV["LD_FOR_TARGET"] = ENV["LD"] - args << "--with-ld=#{ENV["LD"]}" - - # Avoids the need for the ttyname_r patch - # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117857 - # https://github.com/mistydemeo/tigerbrew/pull/1286#issuecomment-2664224824 - ENV.append_to_cflags "-D__DARWIN_UNIX03" - end - - mkdir "build" do - unless MacOS::CLT.installed? - # For Xcode-only systems, we need to tell the sysroot path. - # "native-system-headers" will be appended - args << "--with-native-system-header-dir=/usr/include" - args << "--with-sysroot=#{MacOS.sdk_path}" - end - - system "../configure", *args - system "make" - system "make", "install" - end - - # Handle conflicts between GCC formulae and avoid interfering - # with system compilers. - # Since GCC 4.8 libffi stuff are no longer shipped. - # Rename man7. - Dir.glob(man7/"*.7") { |file| add_suffix file, version_suffix } - # Even when suffixes are appended, the info pages conflict when - # install-info is run. TODO fix this. - info.rmtree - end - - def add_suffix(file, suffix) - dir = File.dirname(file) - ext = File.extname(file) - base = File.basename(file, ext) - File.rename file, "#{dir}/#{base}-#{suffix}#{ext}" - end - - def caveats - if build.with?("multilib") then <<-EOS.undent - GCC has been built with multilib support. Notably, OpenMP may not work: - https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60670 - If you need OpenMP support you may want to - brew reinstall gcc --without-multilib - EOS - end - end - - test do - (testpath/"hello-c.c").write <<-EOS.undent - #include - int main() - { - puts("Hello, world!"); - return 0; - } - EOS - system "#{bin}/gcc-#{version_suffix}", "-o", "hello-c", "hello-c.c" - assert_equal "Hello, world!\n", `./hello-c` - - (testpath/"hello-cc.cc").write <<-EOS.undent - #include - int main() - { - std::cout << "Hello, world!" << std::endl; - return 0; - } - EOS - system "#{bin}/g++-#{version_suffix}", "-o", "hello-cc", "hello-cc.cc" - assert_equal "Hello, world!\n", `./hello-cc` - - (testpath/"test.f90").write <<-EOS.undent - integer,parameter::m=10000 - real::a(m), b(m) - real::fact=0.5 - - do concurrent (i=1:m) - a(i) = a(i) + fact*b(i) - end do - write(*,"(A)") "Done" - end - EOS - system "#{bin}/gfortran-8", "-o", "test", "test.f90" - assert_equal "Done\n", `./test` - end -end From df4ccc76ff82f254d3c406b6ee134f60a937627c Mon Sep 17 00:00:00 2001 From: Misty De Meo Date: Fri, 21 Feb 2025 15:45:52 -0800 Subject: [PATCH 13/16] gcc: add bottle --- Library/Formula/gcc.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/Library/Formula/gcc.rb b/Library/Formula/gcc.rb index 9acbe4a071..552c4dd63e 100644 --- a/Library/Formula/gcc.rb +++ b/Library/Formula/gcc.rb @@ -26,6 +26,7 @@ def osmajor sha256 "a7b39bc69cbf9e25826c5a60ab26477001f7c08d85cec04bc0e29cabed6f3cc9" bottle do + sha256 "3fe35fc0c089cd1b15e48fa0ab9de4c32d6ea0e2219802316a0e09ffba71011a" => :tiger_altivec end option "with-nls", "Build with native language support (localization)" From 80972659c7bd335f51ec87942d25a9a8128bde23 Mon Sep 17 00:00:00 2001 From: Misty De Meo Date: Fri, 21 Feb 2025 15:46:11 -0800 Subject: [PATCH 14/16] gcc8: no longer conflicts with gcc --- Library/Formula/gcc8.rb | 2 -- 1 file changed, 2 deletions(-) diff --git a/Library/Formula/gcc8.rb b/Library/Formula/gcc8.rb index ebb7fa5d93..c2de0ffcf6 100644 --- a/Library/Formula/gcc8.rb +++ b/Library/Formula/gcc8.rb @@ -30,8 +30,6 @@ def osmajor sha256 "36666a794e7ddca183b156cf499871af08a3f91613ed041bf97008003a85d567" => :tiger_altivec end - conflicts_with "gcc", :because => "both install the same version of GCC" - option "with-nls", "Build with native language support (localization)" option "with-jit", "Build just-in-time compiler" # enabling multilib on a host that can't run 64-bit results in build failures From a9ddeb087483be2260859ab4fa89bd69d45bdf0a Mon Sep 17 00:00:00 2001 From: Misty De Meo Date: Fri, 21 Feb 2025 21:22:22 -0800 Subject: [PATCH 15/16] compilers: add support for gcc-14 --- Library/Homebrew/compilers.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/compilers.rb b/Library/Homebrew/compilers.rb index c85d9896cb..0107aa38ae 100644 --- a/Library/Homebrew/compilers.rb +++ b/Library/Homebrew/compilers.rb @@ -1,7 +1,7 @@ # @private module CompilerConstants - GNU_GCC_VERSIONS = %w[4.3 4.4 4.5 4.6 4.7 4.8 4.9 5 6 7 8] - GNU_GCC_REGEXP = /^gcc-(4\.[3-9]|[5-8])$/ + GNU_GCC_VERSIONS = %w[4.3 4.4 4.5 4.6 4.7 4.8 4.9 5 6 7 8 14] + GNU_GCC_REGEXP = /^gcc-(4\.[3-9]|[5-8]|14)$/ COMPILER_SYMBOL_MAP = { "gcc-4.0" => :gcc_4_0, "gcc-4.2" => :gcc, From be5b9274b88834e666997cdf761e93e42f2f9a37 Mon Sep 17 00:00:00 2001 From: Misty De Meo Date: Fri, 21 Feb 2025 23:28:50 -0800 Subject: [PATCH 16/16] ENV: update c++11 regex --- Library/Homebrew/extend/ENV/std.rb | 2 +- Library/Homebrew/extend/ENV/super.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/extend/ENV/std.rb b/Library/Homebrew/extend/ENV/std.rb index f6f09a9f13..273f85f061 100644 --- a/Library/Homebrew/extend/ENV/std.rb +++ b/Library/Homebrew/extend/ENV/std.rb @@ -293,7 +293,7 @@ def cxx11 if compiler == :clang append "CXX", "-std=c++11" append "CXX", "-stdlib=libc++" - elsif compiler =~ /gcc-(4\.(8|9)|5)/ + elsif compiler =~ /^gcc-(4\.[8-9]|[5-8]|14)$/ append "CXX", "-std=c++11" else raise "The selected compiler doesn't support C++11: #{compiler}" diff --git a/Library/Homebrew/extend/ENV/super.rb b/Library/Homebrew/extend/ENV/super.rb index ad11692a96..a8ebd69dd2 100644 --- a/Library/Homebrew/extend/ENV/super.rb +++ b/Library/Homebrew/extend/ENV/super.rb @@ -293,7 +293,7 @@ def cxx11 when "clang" append "HOMEBREW_CCCFG", "x", "" append "HOMEBREW_CCCFG", "g", "" - when /gcc-(4\.(8|9)|5)/ + when /gcc-(4\.(8|9)|[5-8]|14)/ append "HOMEBREW_CCCFG", "x", "" else raise "The selected compiler doesn't support C++11: #{homebrew_cc}"