[Libclc-dev] [PATCH] Make libclc link if llvm was built with --enable-libcpp --enable-cxx11

Jeroen Ketema j.ketema at imperial.ac.uk
Tue Jun 18 14:47:10 PDT 2013


If llvm was built with

   --enable-libcpp --enable-cxx11

then any C++ code compiled and linked against LLVM
needs to include

   -stdlib=libc++ -std=c++11

Unfortunately, these just occur in --cxxflags of
llvm-config and not in --ldflags. Hence, the flags
are not passed when linking prepare-builtins. As a
work around pass all --cxxflags at the linking stage.
---
  configure.py | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/configure.py b/configure.py
index 9ae49b7..3753dcd 100755
--- a/configure.py
+++ b/configure.py
@@ -36,7 +36,8 @@ def llvm_config(args):

  llvm_bindir = llvm_config(['--bindir'])
  llvm_core_libs = llvm_config(['--libs', 'core', 'bitreader', 
'bitwriter']) + ' ' + \
-                 llvm_config(['--ldflags'])
+                 llvm_config(['--ldflags']) + ' ' + \
+                 llvm_config(['--cxxflags'])
  llvm_cxxflags = llvm_config(['--cxxflags']) + ' -fno-exceptions -fno-rtti'

  llvm_clang = os.path.join(llvm_bindir, 'clang')
-- 
1.7.12.4 (Apple Git-37)





More information about the Libclc-dev mailing list