Building on macOS Sierra 10.12.5, I'm getting
Jukkas-Mac-Pro:master_64bit_binaryen clb$ make VERBOSE=1
/usr/local/Cellar/cmake/3.5.2/bin/cmake -H/Users/clb/emsdk/binaryen/master -B/Users/clb/emsdk/binaryen/master_64bit_binaryen --check-build-system CMakeFiles/Makefile.cmake 0
/usr/local/Cellar/cmake/3.5.2/bin/cmake -E cmake_progress_start /Users/clb/emsdk/binaryen/master_64bit_binaryen/CMakeFiles /Users/clb/emsdk/binaryen/master_64bit_binaryen/CMakeFiles/progress.marks
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/Makefile2 all
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f src/wasm/CMakeFiles/wasm.dir/build.make src/wasm/CMakeFiles/wasm.dir/depend
cd /Users/clb/emsdk/binaryen/master_64bit_binaryen && /usr/local/Cellar/cmake/3.5.2/bin/cmake -E cmake_depends "Unix Makefiles" /Users/clb/emsdk/binaryen/master /Users/clb/emsdk/binaryen/master/src/wasm /Users/clb/emsdk/binaryen/master_64bit_binaryen /Users/clb/emsdk/binaryen/master_64bit_binaryen/src/wasm /Users/clb/emsdk/binaryen/master_64bit_binaryen/src/wasm/CMakeFiles/wasm.dir/DependInfo.cmake --color=
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f src/wasm/CMakeFiles/wasm.dir/build.make src/wasm/CMakeFiles/wasm.dir/build
[ 1%] Building CXX object src/wasm/CMakeFiles/wasm.dir/literal.cpp.o
cd /Users/clb/emsdk/binaryen/master_64bit_binaryen/src/wasm && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -I/Users/clb/emsdk/binaryen/master/src -stdlib=libc++ -std=c++11 -Wall -Werror -Wextra -Wno-unused-parameter -fno-omit-frame-pointer -fPIC -O3 -DNDEBUG -O2 -UNDEBUG -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -o CMakeFiles/wasm.dir/literal.cpp.o -c /Users/clb/emsdk/binaryen/master/src/wasm/literal.cpp
In file included from /Users/clb/emsdk/binaryen/master/src/wasm/literal.cpp:22:
In file included from /Users/clb/emsdk/binaryen/master/src/emscripten-optimizer/simple_ast.h:36:
In file included from /Users/clb/emsdk/binaryen/master/src/emscripten-optimizer/parser.h:31:
/Users/clb/emsdk/binaryen/master/src/emscripten-optimizer/istring.h:72:5: error: thread-local storage is not supported for the current target
thread_local static StringSet strings;
^
1 error generated.
make[2]: *** [src/wasm/CMakeFiles/wasm.dir/literal.cpp.o] Error 1
make[1]: *** [src/wasm/CMakeFiles/wasm.dir/all] Error 2
make: *** [all] Error 2
Jukkas-Mac-Pro:master_64bit_binaryen clb$ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ --version
Apple LLVM version 7.3.0 (clang-703.0.31)
Target: x86_64-apple-darwin16.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
Jukkas-Mac-Pro:master_64bit_binaryen clb$
Not quite sure yet what the story is here, though before searching around, is this anything you've seen before? Oddly, this is occurring on the Mac Pro workstation PC (the 2013 trash can model), but not on a 13" MacBook Pro from 2016, even though both are on the same macOS version.
Very odd that it doesn't support thread-local storage. Never seen such an error before.
Some searching suggests it was a bug in xcode http://textmate.1073791.n5.nabble.com/error-thread-local-storage-is-not-supported-for-the-current-target-td29117.html#a29133
I'm got exactly the same error trying to build on OSX 10.11.6 with the same clang version as above.
I fixed it by building with homebrew clang instead of Apple clang:
brew install llvm --with-clang --with-asan
It installed:
$ /usr/local/opt/llvm/bin/clang++ -v
clang version 4.0.0 (tags/RELEASE_400/final)
Target: x86_64-apple-darwin15.6.0
Thread model: posix
InstalledDir: /usr/local/opt/llvm/bin
Then in CMakeCache.txt I changed:
CMAKE_CXX_COMPILER:FILEPATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
to
CMAKE_CXX_COMPILER:FILEPATH=/usr/local/opt/llvm/bin/clang++
and make worked without errors.
I am also running into this issue on macOS (OS X Yosemite 10.10.5).
Good find @kripken , it indeed seems to have been a temporary bug. When reporting this, I had assumed that Xcode was already at its latest version, since generally Xcode updates via OS X autoupdates, but looks like that is no longer(?) the case here, and I had to explicitly reinstall Xcode to get to a newer version.
So updating Xcode from 7.3.3 to 8.3.1 resolved this issue.
However this means that we only support macOS Sierra from now on, and older OS X versions are not supported. On OS X side, people are often quite eager to update, so perhaps that won't be any trouble.
@juj regarding the OS X side of things, I believe you have two counterexamples in this thread of people who are not running the latest macOS.
For anyone else coming to this thread, after upgrading to macOS Serria I had to then delete
.emscripten_cache/
.emscripten_cache.lock
.emscripten_ports/
From my home directory, otherwise I got a bunch of errors about missing header files like
Relooper.h:25:10: fatal error: 'assert.h' file not found
Once I did that I was able to compile easy-peasy.
I have the same problem with xcode 8.3.3 on sierra
@hgarrereyn could you please elaborate how to install? What do you mean by building with homebrew clang instead of Apple clang and where is CMakeCache.txt?
Do this:
brew install llvm --with-clang --with-asan
then in the root directory of the binaryen source distribution, do this (on one line):
cmake . -DCMAKE_C_COMPILER=/usr/local/opt/llvm/bin/clang -DCMAKE_CXX_COMPILER=/usr/local/opt/llvm/bin/clang++
then
make
then
make install
Worked for me on macOS 10.11.4
Warning: llvm: this formula has no --with-asan option so it will be ignored!
Warning: llvm: this formula has no --with-clang option so it will be ignored!
Thanks all, it solved by updated my Mac system and Xcode. My clang++ was working for c++11, but maybe not good incompatible for "thread-local". I think the only thing need to do is update xcode (if there are some problem for update xcode, we have to update the Mac system first) if somebody have the same issue. Thanks all again!
Most helpful comment
Warning: llvm: this formula has no --with-asan option so it will be ignored!
Warning: llvm: this formula has no --with-clang option so it will be ignored!