Hi,
I am trying to build swift-lldb from the swift-4.1-branch
branch and it is failing. It fails with the following:
CMake Error at cmake/modules/HandleLLVMOptions.cmake:403 (message):
LLVM requires C++11 support but the '-std=c++11' flag isn't supported.
Call Stack (most recent call first):
CMakeLists.txt:593 (include)
Any help appreciated.
The following is the output of the CMakeError.log
`Determining if the include file malloc/malloc.h exists failed with the following output:
Change Dir: /home/scottdensmore/Dev/swift-source/build/Ninja-DebugAssert/llvm-linux-x86_64/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/ninja" "cmTC_75a7d"
[1/2] Building C object CMakeFiles/cmTC_75a7d.dir/CheckIncludeFile.c.o
FAILED: /usr/bin/clang -Wno-unknown-warning-option -Werror=unguarded-availability-new -g -o CMakeFiles/cmTC_75a7d.dir/CheckIncludeFile.c.o -c CheckIncludeFile.c
CheckIncludeFile.c:1:10: fatal error: 'malloc/malloc.h' file not found
#include <malloc/malloc.h>
^
1 error generated.
ninja: build stopped: subcommand failed.
Determining if the include file ndir.h exists failed with the following output:
Change Dir: /home/scottdensmore/Dev/swift-source/build/Ninja-DebugAssert/llvm-linux-x86_64/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/ninja" "cmTC_15954"
[1/2] Building C object CMakeFiles/cmTC_15954.dir/CheckIncludeFile.c.o
FAILED: /usr/bin/clang -Wno-unknown-warning-option -Werror=unguarded-availability-new -g -o CMakeFiles/cmTC_15954.dir/CheckIncludeFile.c.o -c CheckIncludeFile.c
CheckIncludeFile.c:1:10: fatal error: 'ndir.h' file not found
#include <ndir.h>
^
1 error generated.
ninja: build stopped: subcommand failed.
Determining if the include file sys/ndir.h exists failed with the following output:
Change Dir: /home/scottdensmore/Dev/swift-source/build/Ninja-DebugAssert/llvm-linux-x86_64/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/ninja" "cmTC_fb434"
[1/2] Building C object CMakeFiles/cmTC_fb434.dir/CheckIncludeFile.c.o
FAILED: /usr/bin/clang -Wno-unknown-warning-option -Werror=unguarded-availability-new -g -o CMakeFiles/cmTC_fb434.dir/CheckIncludeFile.c.o -c CheckIncludeFile.c
CheckIncludeFile.c:1:10: fatal error: 'sys/ndir.h' file not found
#include <sys/ndir.h>
^
1 error generated.
ninja: build stopped: subcommand failed.
Determining if the include file valgrind/valgrind.h exists failed with the following output:
Change Dir: /home/scottdensmore/Dev/swift-source/build/Ninja-DebugAssert/llvm-linux-x86_64/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/ninja" "cmTC_e80e6"
[1/2] Building C object CMakeFiles/cmTC_e80e6.dir/CheckIncludeFile.c.o
FAILED: /usr/bin/clang -Wno-unknown-warning-option -Werror=unguarded-availability-new -g -o CMakeFiles/cmTC_e80e6.dir/CheckIncludeFile.c.o -c CheckIncludeFile.c
CheckIncludeFile.c:1:10: fatal error: 'valgrind/valgrind.h' file not found
#include <valgrind/valgrind.h>
^
1 error generated.
ninja: build stopped: subcommand failed.
Determining if the include file mach/mach.h exists failed with the following output:
Change Dir: /home/scottdensmore/Dev/swift-source/build/Ninja-DebugAssert/llvm-linux-x86_64/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/ninja" "cmTC_d3b27"
[1/2] Building C object CMakeFiles/cmTC_d3b27.dir/CheckIncludeFile.c.o
FAILED: /usr/bin/clang -Wno-unknown-warning-option -Werror=unguarded-availability-new -g -o CMakeFiles/cmTC_d3b27.dir/CheckIncludeFile.c.o -c CheckIncludeFile.c
CheckIncludeFile.c:1:10: fatal error: 'mach/mach.h' file not found
#include <mach/mach.h>
^
1 error generated.
ninja: build stopped: subcommand failed.
Determining if the include file CrashReporterClient.h exists failed with the following output:
Change Dir: /home/scottdensmore/Dev/swift-source/build/Ninja-DebugAssert/llvm-linux-x86_64/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/ninja" "cmTC_0707e"
[1/2] Building C object CMakeFiles/cmTC_0707e.dir/CheckIncludeFile.c.o
FAILED: /usr/bin/clang -Wno-unknown-warning-option -Werror=unguarded-availability-new -g -o CMakeFiles/cmTC_0707e.dir/CheckIncludeFile.c.o -c CheckIncludeFile.c
CheckIncludeFile.c:1:10: fatal error: 'CrashReporterClient.h' file not found
#include <CrashReporterClient.h>
^
1 error generated.
ninja: build stopped: subcommand failed.
Determining if the pthread_create exist failed with the following output:
Change Dir: /home/scottdensmore/Dev/swift-source/build/Ninja-DebugAssert/llvm-linux-x86_64/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/ninja" "cmTC_ea1c8"
[1/2] Building C object CMakeFiles/cmTC_ea1c8.dir/CheckSymbolExists.c.o
[2/2] Linking C executable cmTC_ea1c8
FAILED: : && /usr/bin/clang -Wno-unknown-warning-option -Werror=unguarded-availability-new -g -fuse-ld=gold CMakeFiles/cmTC_ea1c8.dir/CheckSymbolExists.c.o -o cmTC_ea1c8 -lm && :
CheckSymbolExists.c:8: error: undefined reference to 'pthread_create'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.
File /home/scottdensmore/Dev/swift-source/build/Ninja-DebugAssert/llvm-linux-x86_64/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
/* */
#include <pthread.h>
int main(int argc, char** argv)
{
(void)argv;
#ifndef pthread_create
return ((int*)(&pthread_create))[argc];
#else
(void)argc;
return 0;
#endif
}
Determining if the function pthread_create exists in the pthreads failed with the following output:
Change Dir: /home/scottdensmore/Dev/swift-source/build/Ninja-DebugAssert/llvm-linux-x86_64/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/ninja" "cmTC_40bc3"
[1/2] Building C object CMakeFiles/cmTC_40bc3.dir/CheckFunctionExists.c.o
[2/2] Linking C executable cmTC_40bc3
FAILED: : && /usr/bin/clang -Wno-unknown-warning-option -Werror=unguarded-availability-new -g -DCHECK_FUNCTION_EXISTS=pthread_create -fuse-ld=gold CMakeFiles/cmTC_40bc3.dir/CheckFunctionExists.c.o -o cmTC_40bc3 -lpthreads -lm && :
/usr/bin/ld.gold: error: cannot find -lpthreads
/usr/share/cmake-3.5/Modules/CheckFunctionExists.c:14: error: undefined reference to 'pthread_create'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.
Determining if the function xar_open exists in the xar failed with the following output:
Change Dir: /home/scottdensmore/Dev/swift-source/build/Ninja-DebugAssert/llvm-linux-x86_64/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/ninja" "cmTC_5dcc3"
[1/2] Building C object CMakeFiles/cmTC_5dcc3.dir/CheckFunctionExists.c.o
[2/2] Linking C executable cmTC_5dcc3
FAILED: : && /usr/bin/clang -Wno-unknown-warning-option -Werror=unguarded-availability-new -g -DCHECK_FUNCTION_EXISTS=xar_open -fuse-ld=gold CMakeFiles/cmTC_5dcc3.dir/CheckFunctionExists.c.o -o cmTC_5dcc3 -lxar -lm && :
/usr/bin/ld.gold: error: cannot find -lxar
/usr/share/cmake-3.5/Modules/CheckFunctionExists.c:14: error: undefined reference to 'xar_open'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.
Determining if the arc4random exist failed with the following output:
Change Dir: /home/scottdensmore/Dev/swift-source/build/Ninja-DebugAssert/llvm-linux-x86_64/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/ninja" "cmTC_25c81"
[1/2] Building C object CMakeFiles/cmTC_25c81.dir/CheckSymbolExists.c.o
FAILED: /usr/bin/clang -Wno-unknown-warning-option -Werror=unguarded-availability-new -g -o CMakeFiles/cmTC_25c81.dir/CheckSymbolExists.c.o -c CheckSymbolExists.c
CheckSymbolExists.c:8:19: error: use of undeclared identifier 'arc4random'; did you mean 'srandom'?
return ((int*)(&arc4random))[argc];
^~~~~~~~~~
srandom
/usr/include/stdlib.h:324:13: note: 'srandom' declared here
extern void srandom (unsigned int __seed) __THROW;
^
1 error generated.
ninja: build stopped: subcommand failed.
File /home/scottdensmore/Dev/swift-source/build/Ninja-DebugAssert/llvm-linux-x86_64/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
/* */
#include <stdlib.h>
int main(int argc, char** argv)
{
(void)argv;
#ifndef arc4random
return ((int*)(&arc4random))[argc];
#else
(void)argc;
return 0;
#endif
}
Determining if the mallctl exist failed with the following output:
Change Dir: /home/scottdensmore/Dev/swift-source/build/Ninja-DebugAssert/llvm-linux-x86_64/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/ninja" "cmTC_154f2"
[1/2] Building C object CMakeFiles/cmTC_154f2.dir/CheckSymbolExists.c.o
FAILED: /usr/bin/clang -Wno-unknown-warning-option -Werror=unguarded-availability-new -g -Werror=unguarded-availability-new -o CMakeFiles/cmTC_154f2.dir/CheckSymbolExists.c.o -c CheckSymbolExists.c
CheckSymbolExists.c:2:10: fatal error: 'malloc_np.h' file not found
#include <malloc_np.h>
^
1 error generated.
ninja: build stopped: subcommand failed.
File /home/scottdensmore/Dev/swift-source/build/Ninja-DebugAssert/llvm-linux-x86_64/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
/* */
#include <malloc_np.h>
int main(int argc, char** argv)
{
(void)argv;
#ifndef mallctl
return ((int*)(&mallctl))[argc];
#else
(void)argc;
return 0;
#endif
}
Determining if the malloc_zone_statistics exist failed with the following output:
Change Dir: /home/scottdensmore/Dev/swift-source/build/Ninja-DebugAssert/llvm-linux-x86_64/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/ninja" "cmTC_2dde3"
[1/2] Building C object CMakeFiles/cmTC_2dde3.dir/CheckSymbolExists.c.o
FAILED: /usr/bin/clang -Wno-unknown-warning-option -Werror=unguarded-availability-new -g -Werror=unguarded-availability-new -o CMakeFiles/cmTC_2dde3.dir/CheckSymbolExists.c.o -c CheckSymbolExists.c
CheckSymbolExists.c:2:10: fatal error: 'malloc/malloc.h' file not found
#include <malloc/malloc.h>
^
1 error generated.
ninja: build stopped: subcommand failed.
File /home/scottdensmore/Dev/swift-source/build/Ninja-DebugAssert/llvm-linux-x86_64/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
/* */
#include <malloc/malloc.h>
int main(int argc, char** argv)
{
(void)argv;
#ifndef malloc_zone_statistics
return ((int*)(&malloc_zone_statistics))[argc];
#else
(void)argc;
return 0;
#endif
}
Determining if the strerror_s exist failed with the following output:
Change Dir: /home/scottdensmore/Dev/swift-source/build/Ninja-DebugAssert/llvm-linux-x86_64/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/ninja" "cmTC_dc056"
[1/2] Building C object CMakeFiles/cmTC_dc056.dir/CheckSymbolExists.c.o
FAILED: /usr/bin/clang -Wno-unknown-warning-option -Werror=unguarded-availability-new -g -Werror=unguarded-availability-new -o CMakeFiles/cmTC_dc056.dir/CheckSymbolExists.c.o -c CheckSymbolExists.c
CheckSymbolExists.c:8:19: error: use of undeclared identifier 'strerror_s'
return ((int*)(&strerror_s))[argc];
^
1 error generated.
ninja: build stopped: subcommand failed.
File /home/scottdensmore/Dev/swift-source/build/Ninja-DebugAssert/llvm-linux-x86_64/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
/* */
#include <string.h>
int main(int argc, char** argv)
{
(void)argv;
#ifndef strerror_s
return ((int*)(&strerror_s))[argc];
#else
(void)argc;
return 0;
#endif
}
Determining if the dladdr exist failed with the following output:
Change Dir: /home/scottdensmore/Dev/swift-source/build/Ninja-DebugAssert/llvm-linux-x86_64/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/ninja" "cmTC_90059"
[1/2] Building C object CMakeFiles/cmTC_90059.dir/CheckSymbolExists.c.o
FAILED: /usr/bin/clang -Wno-unknown-warning-option -Werror=unguarded-availability-new -g -Werror=unguarded-availability-new -o CMakeFiles/cmTC_90059.dir/CheckSymbolExists.c.o -c CheckSymbolExists.c
CheckSymbolExists.c:8:19: error: use of undeclared identifier 'dladdr'
return ((int*)(&dladdr))[argc];
^
1 error generated.
ninja: build stopped: subcommand failed.
File /home/scottdensmore/Dev/swift-source/build/Ninja-DebugAssert/llvm-linux-x86_64/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
/* */
#include <dlfcn.h>
int main(int argc, char** argv)
{
(void)argv;
#ifndef dladdr
return ((int*)(&dladdr))[argc];
#else
(void)argc;
return 0;
#endif
}
Performing C++ SOURCE FILE Test SUPPORTS_VARIADIC_MACROS_FLAG failed with the following output:
Change Dir: /home/scottdensmore/Dev/swift-source/build/Ninja-DebugAssert/llvm-linux-x86_64/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/ninja" "cmTC_c00f0"
[1/2] Building CXX object CMakeFiles/cmTC_c00f0.dir/src.cxx.o
warning: unknown warning option '-Werror=unguarded-availability-new'; did you mean '-Werror=partial-availability'? [-Wunknown-warning-option]
1 warning generated.
[2/2] Linking CXX executable cmTC_c00f0
Source file was:
int main() { return 0; }
Performing C++ SOURCE FILE Test SUPPORTS_GNU_ZERO_VARIADIC_MACRO_ARGUMENTS_FLAG failed with the following output:
Change Dir: /home/scottdensmore/Dev/swift-source/build/Ninja-DebugAssert/llvm-linux-x86_64/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/ninja" "cmTC_a4c80"
[1/2] Building CXX object CMakeFiles/cmTC_a4c80.dir/src.cxx.o
warning: unknown warning option '-Werror=unguarded-availability-new'; did you mean '-Werror=partial-availability'? [-Wunknown-warning-option]
1 warning generated.
[2/2] Linking CXX executable cmTC_a4c80
Source file was:
int main() { return 0; }
Performing C++ SOURCE FILE Test CXX_SUPPORTS_FPIC failed with the following output:
Change Dir: /home/scottdensmore/Dev/swift-source/build/Ninja-DebugAssert/llvm-linux-x86_64/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/ninja" "cmTC_9f04e"
[1/2] Building CXX object CMakeFiles/cmTC_9f04e.dir/src.cxx.o
FAILED: /usr/bin/clang++ -fno-limit-debug-info -DCXX_SUPPORTS_FPIC -Werror=unguarded-availability-new -Werror -fPIC -o CMakeFiles/cmTC_9f04e.dir/src.cxx.o -c src.cxx
error: unknown warning option '-Werror=unguarded-availability-new'; did you mean '-Werror=partial-availability'? [-Werror,-Wunknown-warning-option]
ninja: build stopped: subcommand failed.
Source file was:
int main() { return 0; }
Performing C++ SOURCE FILE Test SUPPORTS_FVISIBILITY_INLINES_HIDDEN_FLAG failed with the following output:
Change Dir: /home/scottdensmore/Dev/swift-source/build/Ninja-DebugAssert/llvm-linux-x86_64/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/ninja" "cmTC_d230e"
[1/2] Building CXX object CMakeFiles/cmTC_d230e.dir/src.cxx.o
warning: unknown warning option '-Werror=unguarded-availability-new'; did you mean '-Werror=partial-availability'? [-Wunknown-warning-option]
1 warning generated.
[2/2] Linking CXX executable cmTC_d230e
Source file was:
int main() { return 0; }
Performing C++ SOURCE FILE Test CXX_SUPPORTS_WERROR_DATE_TIME failed with the following output:
Change Dir: /home/scottdensmore/Dev/swift-source/build/Ninja-DebugAssert/llvm-linux-x86_64/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/ninja" "cmTC_d7a99"
[1/2] Building CXX object CMakeFiles/cmTC_d7a99.dir/src.cxx.o
FAILED: /usr/bin/clang++ -fno-limit-debug-info -DCXX_SUPPORTS_WERROR_DATE_TIME -Werror=unguarded-availability-new -Werror -Werror=date-time -o CMakeFiles/cmTC_d7a99.dir/src.cxx.o -c src.cxx
error: unknown warning option '-Werror=unguarded-availability-new'; did you mean '-Werror=partial-availability'? [-Werror,-Wunknown-warning-option]
ninja: build stopped: subcommand failed.
Source file was:
int main() { return 0; }
Performing C++ SOURCE FILE Test CXX_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW failed with the following output:
Change Dir: /home/scottdensmore/Dev/swift-source/build/Ninja-DebugAssert/llvm-linux-x86_64/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/ninja" "cmTC_68254"
[1/2] Building CXX object CMakeFiles/cmTC_68254.dir/src.cxx.o
FAILED: /usr/bin/clang++ -fno-limit-debug-info -DCXX_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW -Werror=unguarded-availability-new -Werror -Werror=unguarded-availability-new -o CMakeFiles/cmTC_68254.dir/src.cxx.o -c src.cxx
error: unknown warning option '-Werror=unguarded-availability-new'; did you mean '-Werror=partial-availability'? [-Werror,-Wunknown-warning-option]
error: unknown warning option '-Werror=unguarded-availability-new'; did you mean '-Werror=partial-availability'? [-Werror,-Wunknown-warning-option]
ninja: build stopped: subcommand failed.
Source file was:
int main() { return 0; }
Performing C++ SOURCE FILE Test CXX_SUPPORTS_CXX11 failed with the following output:
Change Dir: /home/scottdensmore/Dev/swift-source/build/Ninja-DebugAssert/llvm-linux-x86_64/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/ninja" "cmTC_e2edb"
[1/2] Building CXX object CMakeFiles/cmTC_e2edb.dir/src.cxx.o
warning: unknown warning option '-Werror=unguarded-availability-new'; did you mean '-Werror=partial-availability'? [-Wunknown-warning-option]
1 warning generated.
[2/2] Linking CXX executable cmTC_e2edb
Source file was:
int main() { return 0; }`