Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


LLVM: Update to 3.1 #12529

wants to merge 2 commits into from

6 participants

Bob Aman Samuel John 2bits Elliot Saba cycld Mike McQuaid
Bob Aman

However, this removes the bottles for Lion and Snow Leopard which are still on 3.0.

Samuel John

@sporkmonger, it works for me. Hashes are ok, compiles fine unless I add --shared but I think that is an issue either with 3.0 version, too, or has to do with my Xcode-only setup.

I don't know much about bottles.

ping @adamv, @mikemcquaid ?

Bob Aman

Actually, I'm pretty sure I needed to use --shared when I installed it. Can someone else chime in and see if they're having issues with that?

Samuel John

Tested again.

LLVM 3.0 builds with brew install llvm --with-clang --analyzer --shared --all-targets --rtti --jit :-)
LLVM 3.1 fails with brew install llvm --with-clang --analyzer --shared --all-targets --rtti --jit :-(


llvm[2]: Linking Release+Asserts unit test VMCore (without symbols)
Undefined symbols for architecture x86_64:
  "llvm::DominatorTreeBase<llvm::BasicBlock>::isReachableFromEntry(llvm::BasicBlock const*) const", referenced from:
      llvm::(anonymous namespace)::DPass::runOnFunction(llvm::Function&) in DominatorTreeTest.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

My config.log

It can be due to my Xcode only setup (see #10510). I have to double check with my other Mac that has the Command Line Tools for Xcode installed.

Samuel John

And here the full output.

Samuel John

I just tested to compile llvm 3.1 with adding ENV.no_optimization and surprisingly the build went fine o.O

... that is the direction to investigate further.

/cc @2Bits


Try compiling it with llvm :-)
It works then, while it fails with clang on my system too, 10.7.4 w/XCode 4.3.3.

brew install llvm --with-clang --analyzer --shared --all-targets --rtti --jit --use-llvm
Samuel John

@2bits using --use-llvm when building llvm was no problem. But the point is that I can make ffmpeg build successfully if I add ENV.no_optimization to the llvm.rb formula. Can you verify this?

I think that was your initial question, right? So, I suspect it to be some too aggresive optimization?

Samuel John

@2bits oh, now I mixed the two threads. Of course here it's about compiling llvm with --shared (and the other options still on).

I'll try with --use-llvm as you suggest.

Samuel John

@2bits yep, using either options lead to a successful compilation:

  • brew install llvm --with-clang --analyzer --shared --all-targets --rtti --jit --use-llvm
  • brew install llvm --with-clang --analyzer --shared --all-targets --rtti --jit
    with ENV.no_optimization.
Samuel John

Am I the only one (OS X 10.7.4 with latest Xcode) where the plain brew install llvm --with-clang --analyzer --shared --all-targets --rtti --jit fails with the llvm 3.1 from this pull request? And also using --HEAD fails with tat options.

Samuel John

@sporkmonger could you test that again with these options I used?


while it fails with clang on my system too, 10.7.4 w/XCode 4.3.3.

brew install llvm --with-clang --analyzer --shared --all-targets --rtti --jit

Samuel John

So what do we do now?
The default optimization of homebrew currently is -Os and if that brakes clang 3.1+ we can either

  • go with --use-llvm i.e. we need a fails_with :clang block for this llvm.rb formula or
  • ENV.no_optimization

does anybody know what llvm/clang/Apple suggest here? Is there some info in a INSTALL.txt or so @sporkmonger?


So what do we do now?

Try building this software without Homebrew to see how it optimizes. There is a page on that explains how to build it. I would prefer to force llvm rather than go with no optimization, but we still have some questions we should answer, now that we've come this far.

Samuel John

Side note: We can get rid of --all-targets, because:

Controls which targets will be built and linked into llc. The default value for target_options is "all" which builds and links all available targets. The value "host-only" can be specified to build only a native compiler (no cross-compiler targets available). The "native" target is selected as the target of the build host. You can also specify a comma separated list of target names that you want available in llc. The target names use all lower case. The current set of targets is:
arm, cpp, hexagon, mblaze, mips, mipsel, msp430, powerpc, ptx, sparc, spu, x86, x86_64, xcore. -- link

Samuel John

Using clang to build llvm seems fine:

We routinely use GCC 4.2 (and higher) or Clang. link

Samuel John

Any update on this?
I'd go with @2bits and declare llvm 3.1 to build with --use-llvm and then pull this.

@sporkmonger could you integrate the fails_with :clang block?


Nice link. It says they use gcc to compile llvm and clang. So we have to build that too? :-)

Samuel John
Bob Aman

I'm running on 10.6.8 and XCode 3.2.2, so I don't know I'm the best person to test these. I ran with --with-clang --analyzer --shared --all-targets --rtti --jit options, no errors, everything worked fine.


@sporkmonger If you have a few minutes to spare, test your clang by using it to build ffmpeg.

Bob Aman

@2bits Confirmed. ffmpeg builds just fine with my clang.


That's a good sign. Even if ML is coming out this week by the rumor and if it has clang-4.0, this would still be good to accept so that we have a 3.1 reference commit in brew version llvm

Elliot Saba

I just confirmed that this formula compiles properly on my 10.8 machine with Xcode 4.4 (and the corresponding CLT).


Hi, i just opened another pull request with an update to llvm 3.1, and some option cleanup.
Please look here:

Your pull request will likely need some iterations, as you have two commits, and you need to at least squash them.

Bob Aman

@cycld Looks like you've already done all the work. Any reason we shouldn't just double-check your commit, close this pull request and merge yours instead?

Mike McQuaid

Let's move this to #13895. @sporkmonger thanks for your hard work which helped get there.

Mike McQuaid mikemcquaid closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 31, 2012
  1. Bob Aman

    LLVM: Update to 3.1

    sporkmonger authored
  2. Apparently you can't have old bottles hanging around if they haven't …

    Bob Aman authored
    …been updated.
This page is out of date. Refresh to see the latest.
Showing with 4 additions and 9 deletions.
  1. +4 −9 Library/Formula/llvm.rb
13 Library/Formula/llvm.rb
@@ -10,24 +10,19 @@ def build_jit?; ARGV.include? '--jit'; end
class Clang < Formula
homepage ''
- url ''
- md5 '43350706ae6cf05d0068885792ea0591'
+ url ''
+ md5 '59bf2d3120a3805f27cafda3823caaf8'
head ''
class Llvm < Formula
homepage ''
- url ''
- md5 'a8e5f5f1c1adebae7b4a654c376a6005'
+ url ''
+ md5 '16eaa7679f84113f65b12760fdfe4ee1'
head ''
- bottle do
- sha1 'f6feaab7d1e4f45cd5f0b63d465e65f491fcc27c' => :lion
- sha1 '0b4a9baac5cd07192f992ef3621371e9cde3979a' => :snowleopard
- end
def patches
# changes the link options for the shared library build
# to use the preferred way to build libraries in Mac OS X
Something went wrong with that request. Please try again.