<html>
<head>
<base href="http://llvm.org/bugs/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - [cmake] check_cxx_compiler_flag test for -std=c++11 fails to use linker flags, unable to find nonstandard location of libc++"
href="http://llvm.org/bugs/show_bug.cgi?id=19071">19071</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>[cmake] check_cxx_compiler_flag test for -std=c++11 fails to use linker flags, unable to find nonstandard location of libc++
</td>
</tr>
<tr>
<th>Product</th>
<td>Build scripts
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>All
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>cmake
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>fang@csl.cornell.edu
</td>
</tr>
<tr>
<th>CC</th>
<td>geek4civic@gmail.com, llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>On a system where libc++ is installed in a nonstandard location, the test for
-std=c++11 fails when trying to link the test executable, even when -L is
passed to linker flags:
-- Target triple: powerpc-apple-darwin8.11.0
-- Host OS X version: 10.4
-- Native target architecture is PowerPC
-- Threads enabled.
-- Doxygen disabled.
-- Building with -fPIC
CMake Error at cmake/modules/HandleLLVMOptions.cmake:298 (message):
LLVM requires C++11 support but the '-std=c++11' flag isn't supported.
Call Stack (most recent call first):
CMakeLists.txt:301 (include)
-- Configuring incomplete, errors occurred!
make: *** [cmake_check_build_system] Error 1
from CMakeFiles/CMakeError.log:
Performing C++ SOURCE FILE Test CXX_SUPPORTS_CXX11 failed with the following
output:
Change Dir:
/Users/fang/local/src/LLVM-svn/clang34-stage1-build/CMakeFiles/CMakeTmp
Run Build Command:/sw/bin/make "cmTryCompileExec1310359099/fast"
make[1]: Entering directory
`/Volumes/Isolde/builds/LLVM/clang34-stage1-build/CMakeFiles/CMakeTmp'
/sw/bin/make -f CMakeFiles/cmTryCompileExec1310359099.dir/build.make
CMakeFiles/cmTryCompileExec1310359099.dir/build
make[2]: Entering directory
`/Volumes/Isolde/builds/LLVM/clang34-stage1-build/CMakeFiles/CMakeTmp'
/Volumes/Mercedes2/sw/bin/cmake -E cmake_progress_report
/Users/fang/local/src/LLVM-svn/clang34-stage1-build/CMakeFiles/CMakeTmp/CMakeFiles
1
Building CXX object CMakeFiles/cmTryCompileExec1310359099.dir/src.cxx.o
/sw/opt/llvm-3.4/bin/clang++ -std=c++11 -stdlib=libc++ -cxx-isystem
/sw/include/c++/v1 -B/sw/lib/odcctools/bin -no-integrated-as -fPIC
-fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter -Wwrite-strings
-Wmissing-field-initializers -pedantic -Wno-long-long -Wcovered-switch-default
-Wnon-virtual-dtor -DCXX_SUPPORTS_CXX11 -std=c++11 -o
CMakeFiles/cmTryCompileExec1310359099.dir/src.cxx.o -c
/Users/fang/local/src/LLVM-svn/clang34-stage1-build/CMakeFiles/CMakeTmp/src.cxx
Linking CXX executable cmTryCompileExec1310359099
/Volumes/Mercedes2/sw/bin/cmake -E cmake_link_script
CMakeFiles/cmTryCompileExec1310359099.dir/link.txt --verbose=1
/sw/opt/llvm-3.4/bin/clang++ -std=c++11 -stdlib=libc++ -cxx-isystem
/sw/include/c++/v1 -B/sw/lib/odcctools/bin -no-integrated-as -fPIC
-fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter -Wwrite-strings
-Wmissing-field-initializers -pedantic -Wno-long-long -Wcovered-switch-default
-Wnon-virtual-dtor -DCXX_SUPPORTS_CXX11 -Wl,-search_paths_first
-Wl,-headerpad_max_install_names
CMakeFiles/cmTryCompileExec1310359099.dir/src.cxx.o -o
cmTryCompileExec1310359099 -lm
ld: library not found for -lc++
clang-3.4: error: linker command failed with exit code 1 (use -v to see
invocation)
make[2]: Leaving directory
`/Volumes/Isolde/builds/LLVM/clang34-stage1-build/CMakeFiles/CMakeTmp'
make[1]: Leaving directory
`/Volumes/Isolde/builds/LLVM/clang34-stage1-build/CMakeFiles/CMakeTmp'
make[2]: *** [cmTryCompileExec1310359099] Error 1
make[1]: *** [cmTryCompileExec1310359099/fast] Error 2
% grep LINKER_FLAGS CMakeCache.txt
CMAKE_EXE_LINKER_FLAGS:STRING= -L/sw/lib/c++
CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING=
CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING=
CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING=
CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING=
CMAKE_MODULE_LINKER_FLAGS:STRING= -L/sw/lib/c++
CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING=
CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING=
CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING=
CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING=
CMAKE_SHARED_LINKER_FLAGS:STRING= -L/sw/lib/c++
CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING=
CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING=
CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING=
CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING=
and libc++ lives at /sw/lib/c++/libc++.dylib so that user may choose which
libc++ to use (vendor's vs. built).
Can the trivial executable test be fixed to account for linker flags?
Better yet would be if there were an equivalent option to -cxx-isystem for
linking.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>