[llvm-bugs] [Bug 29013] New: llvm+libcxx cmake failing on SunOS: cc1plus: fatal error: llvm/Support/Solaris.h: No such file or directory
via llvm-bugs
llvm-bugs at lists.llvm.org
Wed Aug 17 05:30:13 PDT 2016
https://llvm.org/bugs/show_bug.cgi?id=29013
Bug ID: 29013
Summary: llvm+libcxx cmake failing on SunOS: cc1plus: fatal
error: llvm/Support/Solaris.h: No such file or
directory
Product: Build scripts
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: cmake
Assignee: unassignedbugs at nondot.org
Reporter: mgorny at gentoo.org
CC: llvm-bugs at lists.llvm.org
Classification: Unclassified
I'm attempting to build LLVM+clang+libcxx together on SunOS (OpenIndiana). When
the cmake process reaches libcxx, it fails with the following error:
-- Performing Test LIBCXX_SUPPORTS_STD_EQ_CXX11_FLAG
-- Performing Test LIBCXX_SUPPORTS_STD_EQ_CXX11_FLAG - Failed
CMake Error at projects/libcxx/CMakeLists.txt:308 (message):
C++11 or greater is required but the compiler does not support c++11
Looking into CMakeError.log, I find the following problem:
/usr/bin/c++ -fPIC -fvisibility-inlines-hidden -Wall -W
-Wno-unused-parameter -Wwrite-strings -Wcast-qual
-Wno-missing-field-initializers -Wno-long-long -Wno-maybe-uninitialized
-Wdelete-non-virtual-dtor -Wno-comment -std=c++11 -include
llvm/Support/Solaris.h -DLIBCXX_SUPPORTS_STD_EQ_CXX11_FLAG -std=c++11 -o
CMakeFiles/cmTC_9c6d6.dir/src.cxx.o -c
/root/mgorny-test/llvm/_build/CMakeFiles/CMakeTmp/src.cxx
cc1plus: fatal error: llvm/Support/Solaris.h: No such file or directory
compilation terminated.
It seems to be caused by the following block from top CMakeLists.txt file:
if( ${CMAKE_SYSTEM_NAME} MATCHES SunOS )
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -include llvm/Support/Solaris.h")
endif( ${CMAKE_SYSTEM_NAME} MATCHES SunOS )
This causes the listed header to be included unconditionally for all files
built, including subprojects. However, it seems that libcxx doesn't specify an
appropriate include dir, therefore causing everything using this to fail.
Depending on whether this is desired in subprojects, potential fixes are:
a. instead of appending to CMAKE_CXX_FLAGS, add the -include flag restrictively
for LLVM source files it needs and do not propagate it into subprojects,
b. or add appropriate include dirs where appropriate. The simplest fix would be
to add an appropriate -I flag in the same block.
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160817/4d9e977f/attachment-0001.html>
More information about the llvm-bugs
mailing list