Dolphin, the GameCube and Wii emulator - Forums

Full Version: Build error when using clang
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Not sure if this is supposed to go under support or development

OS: Arch Linux, Kernel 4.12.10-1-ARCH
Clang 4.0.1 (5.0.0 and 6.0.0-svn also tested)
Libc++ 4.0.1
Cmake settings:
Code:
cmake -D CMAKE_CXX_FLAGS="-stdlib=libc++" -D CMAKE_C_COMPILER="clang" -D CMAKE_CXX_COMPILER="clang++" -D CMAKE_BUILD_TYPE="Release"


When building dolphin-master using clang and libc++, it will fail at


Code:
[ 20%] Building CXX object Source/Core/Common/CMakeFiles/common.dir/Analytics.cpp.o
[ 20%] Building CXX object Source/Core/Common/CMakeFiles/common.dir/CDUtils.cpp.o
[ 20%] Building CXX object Source/Core/Common/CMakeFiles/common.dir/ColorUtil.cpp.o
[ 20%] Building CXX object Source/Core/Common/CMakeFiles/common.dir/CommonFuncs.cpp.o
In file included from /home/brian/git/dolphin/Source/Core/Common/CommonFuncs.cpp:21:
In file included from /home/brian/git/dolphin/Source/Core/Common/CommonFuncs.h:8:
In file included from /usr/bin/../include/c++/v1/string:470:
In file included from /usr/bin/../include/c++/v1/string_view:171:
In file included from /usr/bin/../include/c++/v1/__string:56:
In file included from /usr/bin/../include/c++/v1/algorithm:640:
In file included from /usr/bin/../include/c++/v1/memory:629:
In file included from /usr/bin/../include/c++/v1/typeinfo:61:
In file included from /usr/bin/../include/c++/v1/exception:82:
/usr/bin/../include/c++/v1/cstdlib:157:9: error: no member named 'aligned_alloc' in the global namespace
using ::aligned_alloc;
     ~~^
1 error generated.
make[3]: *** [Source/Core/Common/CMakeFiles/common.dir/build.make:135: Source/Core/Common/CMakeFiles/common.dir/CommonFuncs.cpp.o] Error 1
make[2]: *** [CMakeFiles/Makefile2:859: Source/Core/Common/CMakeFiles/common.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:871: Source/Core/Common/CMakeFiles/common.dir/rule] Error 2
make: *** [Makefile:368: common] Error 2
Pretty sure dolphin requires you to be on clang version 3.8
If that's true, then it isn't documented anywhere obvious.
This appears to be a bug in libc++ or the clang compiler bits/ headers. It's using a function that wasn't defined in the library headers without defining it, nothing to do with dolphin.

I don't think dolphin "required" clang 3.8 - so much as that's the only one it's been tested on.