Skip to content
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

nvc: revision for llvm #11088

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 36 additions & 31 deletions Formula/nvc.rb
Original file line number Diff line number Diff line change
@@ -1,22 +1,43 @@
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
sha256 "05d0071242e0e8cc1621e3ac0ea1e8b5bcdcfbfe9622db9bef8a7a3077c39983" => :el_capitan
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

Expand All @@ -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"
Expand All @@ -48,19 +69,3 @@ def install
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");
}
}