nvc: revision for llvm

Closes #11088.

Signed-off-by: ilovezfs <ilovezfs@icloud.com>
This commit is contained in:
ilovezfs 2017-03-14 04:40:38 -07:00
parent f94f5510b1
commit 12605532c7

View file

@ -1,8 +1,33 @@
class Nvc < Formula
desc "VHDL compiler and simulator"
homepage "https://github.com/nickg/nvc"
url "https://github.com/nickg/nvc/releases/download/r1.1.0/nvc-1.1.0.tar.gz"
sha256 "b3b5f67ee91046ab802112e544b7883f7a92b69d25041b5b8187c07016dfda75"
revision 1
head "https://github.com/nickg/nvc.git"
stable do
url "https://github.com/nickg/nvc/releases/download/r1.1.0/nvc-1.1.0.tar.gz"
sha256 "b3b5f67ee91046ab802112e544b7883f7a92b69d25041b5b8187c07016dfda75"
# Remove for > 1.1.0
# LLVM 3.9 compatibility
# Fix "Undefined symbols for architecture x86_64: '_LLVMLinkModules'"
# Upstream commit from 8 Jan 2017 "Use LLVMLinkModules2 where available."
# Reported 8 Jan 2017 https://github.com/nickg/nvc/issues/310
patch do
url "https://github.com/nickg/nvc/commit/cd427e4.patch"
sha256 "5223274735e72bfa5f55ca7d7a97f1c1d254b8104fe4adb40e47ae67311f2c28"
end
# Remove for > 1.1.0
# LLVM 4.0 compatibility
# Fix "use of undeclared identifier 'LLVMNoUnwindAttribute'"
# Upstream commit from 7 Mar 2017 "Update for new LLVM attribute API."
# Reported 16 Feb 2017 https://github.com/nickg/nvc/issues/313
patch do
url "https://github.com/nickg/nvc/commit/028ece6.patch"
sha256 "9c2ae65129b6f3e5e6efb1eff77bd2bde790f3d8168b7fe482b4bf9f1115fd63"
end
end
bottle do
sha256 "1e9c83fa64952cccf301e1652516697c6ab9e17a3d05e6f5f3861cb97689f1c0" => :sierra
@ -10,13 +35,9 @@ class Nvc < Formula
sha256 "1b530bdf998bb161222efaae1ee59fe135889d6ed245f28dd2cee06e845ddc0e" => :yosemite
end
head do
url "https://github.com/nickg/nvc.git"
depends_on "automake" => :build
depends_on "autoconf" => :build
end
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "pkg-config" => :build
depends_on "llvm" => :build
depends_on "check" => :build
@ -25,18 +46,18 @@ class Nvc < Formula
:revision => "c112c17f098f13719784df90c277683051b61d05"
end
# LLVM 3.9 compatibility
# Fix "Undefined symbols for architecture x86_64: '_LLVMLinkModules'"
# Reported 8 Jan 2017 https://github.com/nickg/nvc/issues/310
patch :DATA
def install
args = %W[
--with-llvm=#{Formula["llvm"].opt_bin}/llvm-config
--prefix=#{prefix}
]
system "./autogen.sh" unless build.stable?
if build.head?
system "./autogen.sh"
else
system "autoreconf", "-fiv"
end
system "./tools/fetch-ieee.sh"
system "./configure", *args
system "make"
@ -48,19 +69,3 @@ class Nvc < Formula
system "#{bin}/nvc", "-a", "#{testpath}/basic_library/very_common_pkg.vhd"
end
end
__END__
diff --git a/src/link.c b/src/link.c
index 850de56..2592b84 100644
--- a/src/link.c
+++ b/src/link.c
@@ -158,8 +158,8 @@ static void link_context_bc_fn(lib_t lib, tree_t unit, FILE *deps)
tree_remove_attr(unit, llvm_i);
char *outmsg;
- if (LLVMLinkModules(module, src, LLVMLinkerDestroySource, &outmsg))
- fatal("LLVM link failed: %s", outmsg);
+ if (LLVMLinkModules2(module, src))
+ fatal("LLVM link failed");
}
}