From 58c93198dd2c2ea745c0b0947539bece2950d56c Mon Sep 17 00:00:00 2001 From: nibbles 2bits Date: Sun, 12 Aug 2012 09:33:24 -0700 Subject: [PATCH] icarus-verilog: fix build error by specifying LD Icarus-verilog-0.9.5 crashes clang or llvm into an assertion error when either of those two binaries is used as the linker. Add a command to set `ENV['LD']`. It also works for XCode-only. Remove both the fails_with because it works now. Add a separate line to `make installdirs` that fixes a build error where a directory does not exist. Tested on ML with XCode-4.4.1 using clang and llvm. Fixes Homebrew/homebrew#13650 Closes Homebrew/homebrew#14138. Signed-off-by: Jack Nagel --- Formula/icarus-verilog.rb | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/Formula/icarus-verilog.rb b/Formula/icarus-verilog.rb index e345ed7b3a..434f0ba436 100644 --- a/Formula/icarus-verilog.rb +++ b/Formula/icarus-verilog.rb @@ -10,29 +10,13 @@ class IcarusVerilog < Formula sha1 '313ab0f5dc4d198bd4687daaf2e54749c67558b3' end - # Yes indeed, this software fails to compile out of the box with both - # LLVM and Clang. - - fails_with :llvm do - build '2336' - cause <<-EOS.undent - ld: warning: unexpected dylib (/usr/lib/libSystem.dylib) on link line - Assertion failed: (_machoSection != 0), function machoSection, file /SourceCache/ld64/ld64-128.2/src/ld/ld.hpp, line 565. - EOS - end - - fails_with :clang do - build '318' - cause <<-EOS.undent - ld: warning: unexpected dylib (/usr/lib/libSystem.dylib) on link line - Assertion failed: (_machoSection != 0), function machoSection, file /SourceCache/ld64/ld64-128.2/src/ld/ld.hpp, line 565. - EOS - end - def install + # Fixes an assertion when XCode-4.4 tries to link with clang or llvm-gcc. + ENV['LD'] = MacOS.locate("ld") system "./configure", "--prefix=#{prefix}" - system "make" # Separate steps, as install does not depend on compile properly - system "make install" + system 'make' + system 'make installdirs' + system 'make install' end end