gcc 5.1.0

Update to latest stable release, add option and patch for JIT, remove CLooG dependency,
refactor language selection, add HEAD, use HTTPS mirror.
This commit is contained in:
David Christenson 2015-05-02 18:58:17 -06:00 committed by Xu Cheng
parent be50e58298
commit 742d97cd1d

View file

@ -19,11 +19,10 @@ class Gcc < Formula
`uname -r`.chomp
end
homepage "http://gcc.gnu.org"
url "http://ftpmirror.gnu.org/gcc/gcc-4.9.2/gcc-4.9.2.tar.bz2"
mirror "ftp://gcc.gnu.org/pub/gcc/releases/gcc-4.9.2/gcc-4.9.2.tar.bz2"
sha1 "79dbcb09f44232822460d80b033c962c0237c6d8"
revision 1
homepage "https://gcc.gnu.org"
url "http://ftpmirror.gnu.org/gcc/gcc-5.1.0/gcc-5.1.0.tar.bz2"
mirror "https://ftp.gnu.org/gnu/gcc/gcc-5.1.0/gcc-5.1.0.tar.bz2"
sha256 "b7dafdf89cbb0e20333dbf5b5349319ae06e3d1a30bf3515b5488f7e89dca5ad"
bottle do
revision 1
@ -35,6 +34,7 @@ class Gcc < Formula
option "with-java", "Build the gcj compiler"
option "with-all-languages", "Enable all compilers and languages, except Ada"
option "with-nls", "Build with native language support (localization)"
option "with-jit", "Build the jit compiler"
option "without-fortran", "Build without the gfortran 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?
@ -42,7 +42,6 @@ class Gcc < Formula
depends_on "gmp"
depends_on "libmpc"
depends_on "mpfr"
depends_on "cloog"
depends_on "isl"
depends_on "ecj" if build.with?("java") || build.with?("all-languages")
@ -68,6 +67,10 @@ class Gcc < Formula
version.to_s.slice(/\d\.\d/)
end
# Fix for libgccjit.so linkage on Darwin
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64089
patch :DATA
def install
# GCC will suffer build errors if forced to use a particular linker.
ENV.delete "LD"
@ -76,14 +79,19 @@ class Gcc < Formula
ENV["AS"] = ENV["AS_FOR_TARGET"] = "#{Formula["cctools"].bin}/as"
end
# C, C++, ObjC compilers are always built
languages = %w[c c++ objc obj-c++]
if build.with? "all-languages"
# Everything but Ada, which requires a pre-existing GCC Ada compiler
# (gnat) to bootstrap. GCC 4.6.0 adds go as a language option, but it is
# currently only compilable on Linux.
languages = %w[c c++ objc obj-c++ fortran java jit]
else
# C, C++, ObjC compilers are always built
languages = %w[c c++ objc obj-c++]
# Everything but Ada, which requires a pre-existing GCC Ada compiler
# (gnat) to bootstrap. GCC 4.6.0 add go as a language option, but it is
# currently only compilable on Linux.
languages << "fortran" if build.with?("fortran") || build.with?("all-languages")
languages << "java" if build.with?("java") || build.with?("all-languages")
languages << "fortran" if build.with? "fortran"
languages << "java" if build.with? "java"
languages << "jit" if build.with? "jit"
end
args = [
"--build=#{arch}-apple-darwin#{osmajor}",
@ -95,7 +103,6 @@ class Gcc < Formula
"--with-gmp=#{Formula["gmp"].opt_prefix}",
"--with-mpfr=#{Formula["mpfr"].opt_prefix}",
"--with-mpc=#{Formula["libmpc"].opt_prefix}",
"--with-cloog=#{Formula["cloog"].opt_prefix}",
"--with-isl=#{Formula["isl"].opt_prefix}",
"--with-system-zlib",
"--enable-libstdcxx-time=yes",
@ -105,8 +112,6 @@ class Gcc < Formula
# Use 'bootstrap-debug' build configuration to force stripping of object
# files prior to comparison during bootstrap (broken by Xcode 6.3).
"--with-build-config=bootstrap-debug",
# A no-op unless --HEAD is built because in head warnings will
# raise errors. But still a good idea to include.
"--disable-werror",
"--with-pkgversion=Homebrew #{name} #{pkg_version} #{build.used_options*" "}".strip,
"--with-bugurl=https://github.com/Homebrew/homebrew/issues",
@ -132,6 +137,8 @@ class Gcc < Formula
args << "--enable-multilib"
end
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}"
@ -139,7 +146,7 @@ class Gcc < Formula
mkdir "build" do
unless MacOS::CLT.installed?
# For Xcode-only systems, we need to tell the sysroot path.
# "native-system-header's will be appended
# "native-system-headers" will be appended
args << "--with-native-system-header-dir=/usr/include"
args << "--with-sysroot=#{MacOS.sdk_path}"
end
@ -235,3 +242,18 @@ class Gcc < Formula
end
end
end
__END__
diff --git a/gcc/jit/Make-lang.in b/gcc/jit/Make-lang.in
index 44d0750..4df2a9c 100644
--- a/gcc/jit/Make-lang.in
+++ b/gcc/jit/Make-lang.in
@@ -85,8 +85,7 @@ $(LIBGCCJIT_FILENAME): $(jit_OBJS) \
$(jit_OBJS) libbackend.a libcommon-target.a libcommon.a \
$(CPPLIB) $(LIBDECNUMBER) $(LIBS) $(BACKENDLIBS) \
$(EXTRA_GCC_OBJS) \
- -Wl,--version-script=$(srcdir)/jit/libgccjit.map \
- -Wl,-soname,$(LIBGCCJIT_SONAME)
+ -Wl,-install_name,$(LIBGCCJIT_SONAME)
$(LIBGCCJIT_SONAME_SYMLINK): $(LIBGCCJIT_FILENAME)
ln -sf $(LIBGCCJIT_FILENAME) $(LIBGCCJIT_SONAME_SYMLINK)