[PATCH] Fix build on Linux using libc++

Ryan Goodfellow rcgoodfellow at gmail.com
Thu Jun 20 23:55:24 PDT 2013


Hi,

When building using autoconf with libc++ on Linux, the override directive
in 'lib/Target/PowerPC/TargetInfo/Makefile' on the CPPFLAGS variable causes
compilation and linking errors. For compilation if the location of the
libc++ headers are specified as command line overrides to gmake these will
get clobbered, for linking the -stdlib=libc++ gets clobbered so
LLVMPowerPCInfo.a is linked with libstdc++ causing undefined symbol errors
when linking with libc++ linked libraries.

As an example here is how I configure the llvm build to produce errors.

LD_LIBRARY_PATH="/usr/local/lib/libc++:/usr/local/lib/libc++abi" CC=clang
CXX=clang++ CPPFLAGS="-I/usr/local/include/c++/v1
-I/usr/local/include/c++abi" LDFLAGS="-L/usr/local/lib/libc++
-L/usr/local/lib/libc++abi -lc++ -lc++abi" ../configure --enable-optimized
--enable-cxx11 --enable-libcpp

Attached is a patch that I think resolves the issue and is consistent with
other TargetInfo makefiles.

Thanks
~ry
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130620/24a2aba4/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ppc_targetinfo_makefile.diff
Type: application/octet-stream
Size: 514 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130620/24a2aba4/attachment.obj>


More information about the llvm-commits mailing list