Skip to content

gcc14 14.2.0 #1286

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
8 changes: 3 additions & 5 deletions Library/Formula/cloog.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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?
Expand All @@ -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?
Expand Down
83 changes: 63 additions & 20 deletions Library/Formula/gcc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,53 +21,71 @@ 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"
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
sha256 "3fe35fc0c089cd1b15e48fa0ab9de4c32d6ea0e2219802316a0e09ffba71011a" => :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 "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?
MacOS::CLT.installed?
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':
Expand All @@ -82,10 +100,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
Expand Down Expand Up @@ -130,9 +144,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?
Expand Down
6 changes: 3 additions & 3 deletions Library/Formula/gcc7.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
Expand All @@ -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
Expand Down Expand Up @@ -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,
Expand Down
8 changes: 4 additions & 4 deletions Library/Formula/gcc8.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ 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 "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
Expand All @@ -38,7 +38,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
Expand Down Expand Up @@ -104,7 +104,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,
Expand Down
10 changes: 4 additions & 6 deletions Library/Formula/isl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@ 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
sha256 "90a210935291327e174b4f602c0fb1929fecb27024a0bec0b15531adcc98d5ea" => :tiger_altivec
end

head do
Expand All @@ -34,7 +32,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
Expand Down
57 changes: 57 additions & 0 deletions Library/Formula/isl018.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
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 "978dc72f4ff0f2ad9c67ed726affd2f8c71f91d6048067d9827b3adb0ea2ff0d" => :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", "check"
system "make", "install"
(share/"gdb/auto-load").install Dir["#{lib}/*-gdb.py"]
end

test do
(testpath/"test.c").write <<-EOS.undent
#include <isl/ctx.h>

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
56 changes: 56 additions & 0 deletions Library/Formula/isl027.rb
Original file line number Diff line number Diff line change
@@ -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 "d4b0640fbfb124dd4c22330d883d54d70956339f037a9218141649b1068b9181" => :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 <isl/ctx.h>

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
4 changes: 2 additions & 2 deletions Library/Homebrew/compilers.rb
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/extend/ENV/std.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
Loading