Add -stdlib=c++ to the LDFLAGS when configuring llvm. The lldb

xcode project file sets the MACOSX_DEPLOYMENT_TARGET to 10.7.
llvm/configure (as of r199313) tries to compile a .cpp file which
includes <atomic> with -std=c++0x.  If the deployment target is set
to earlier than 10.9 and no C++ library is specified, clang will
error out at this point.

Fixes xcode building of lldb on Mac OS X.  If this change causes
problems for any of the other build workflows, please let me know
and I'll fix it.

llvm-svn: 199511
This commit is contained in:
Jason Molenda 2014-01-17 20:59:32 +00:00
parent f3d61de532
commit be1261a1ab
1 changed files with 6 additions and 0 deletions

View File

@ -242,6 +242,12 @@ sub build_llvm
print "Configuring clang ($arch) in '$llvm_dstroot_arch'...\n";
my $lldb_configuration_options = "--enable-targets=x86_64,arm $common_configure_options $llvm_config_href->{configure_options}";
# We're configuring llvm/clang with --enable-cxx11 and --enable-libcpp but llvm/configure doesn't
# pick up the right C++ standard library. If we have a MACOSX_DEPLOYMENT_TARGET of 10.7 or 10.8
# (or are using actually building on those releases), we need to specify "-stdlib=libc++" at link
# time or llvm/configure will not see <atomic> as available and error out (v. llvm r199313).
$ENV{LDFLAGS} = $ENV{LDFLAGS} . " -stdlib=libc++";
if ($is_arm)
{
$lldb_configuration_options .= " --host=arm-apple-darwin${os_release} --target=arm-apple-darwin${os_release} --build=i686-apple-darwin${os_release} --program-prefix=\"\"";