Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on build with latest version of emscripten #14

Open
robert-j-webb opened this issue Feb 14, 2021 · 1 comment
Open

Error on build with latest version of emscripten #14

robert-j-webb opened this issue Feb 14, 2021 · 1 comment
Labels

Comments

@robert-j-webb
Copy link

Following instructions from the readme and emscripten, I get this error

stockfish.js git/ddugovic  
❯ ./build.sh


Config:
debug: 'no'
sanitize: 'no'
optimize: 'yes'
arch: 'any'
bits: '32'
kernel: 'Darwin'
os: ''
prefetch: 'no'
popcnt: 'no'
sse: 'no'
pext: 'no'

Flags:
CXX: em++
CXXFLAGS: -Wall -Wcast-qual -std=c++11  -DANTI -DATOMIC -DCRAZYHOUSE -DHORDE -DKOTH -DRACE -DTHREECHECK -DNDEBUG -O3 -mdynamic-no-pic -DNO_PREFETCH -flto
LDFLAGS:  -s TOTAL_MEMORY=33554432 --memory-init-file 0 -s NO_EXIT_RUNTIME=1 -s EXPORTED_FUNCTIONS=[_main, _uci_command] -s EXTRA_EXPORTED_RUNTIME_METHODS=[ccall] --pre-js pre.js -s WASM=0 -s LEGACY_VM_SUPPORT=1 -O3 -Wall -Wcast-qual -std=c++11  -DANTI -DATOMIC -DCRAZYHOUSE -DHORDE -DKOTH -DRACE -DTHREECHECK -DNDEBUG -O3 -mdynamic-no-pic -DNO_PREFETCH -flto

Testing config sanity. If this fails, try 'make help' ...

/Library/Developer/CommandLineTools/usr/bin/make ARCH=js COMP=emscripten all
em++ -Wall -Wcast-qual -std=c++11  -DANTI -DATOMIC -DCRAZYHOUSE -DHORDE -DKOTH -DRACE -DTHREECHECK -DNDEBUG -O3 -mdynamic-no-pic -DNO_PREFETCH -flto   -c -o bitbase.o bitbase.cpp
em++ -Wall -Wcast-qual -std=c++11  -DANTI -DATOMIC -DCRAZYHOUSE -DHORDE -DKOTH -DRACE -DTHREECHECK -DNDEBUG -O3 -mdynamic-no-pic -DNO_PREFETCH -flto   -c -o bitboard.o bitboard.cpp
clang-13: error: unsupported option '-mdynamic-no-pic' for target 'wasm32-unknown-emscripten'
clang-13: error: unsupported option '-mdynamic-no-pic' for target 'wasm32-unknown-emscripten'
em++: error: '/Users/robertwebb/emsdk/upstream/bin/clang++ -DEMSCRIPTEN -fignore-exceptions -flto=full -Xclang -iwithsysroot/include/SDL -target wasm32-unknown-emscripten -D__EMSCRIPTEN_major__=2 -D__EMSCRIPTEN_minor__=0 -D__EMSCRIPTEN_tiny__=14 -D_LIBCPP_ABI_VERSION=2 -Dunix -D__unix -D__unix__ -flegacy-pass-manager -Werror=implicit-function-declaration --sysroot=/Users/robertwebb/emsdk/upstream/emscripten/cache/sysroot -Xclang -iwithsysroot/include/compat -Wall -Wcast-qual -std=c++11 -DANTI -DATOMIC -DCRAZYHOUSE -DHORDE -DKOTH -DRACE -DTHREECHECK -DNDEBUG -O3 -mdynamic-no-pic -DNO_PREFETCH -flto -c bitboard.cpp -o bitboard.o' failed (1)
make[1]: *** [bitboard.o] Error 1
make[1]: *** Waiting for unfinished jobs....
clang-13: error: unsupported option '-mdynamic-no-pic' for target 'wasm32-unknown-emscripten'
clang-13: error: unsupported option '-mdynamic-no-pic' for target 'wasm32-unknown-emscripten'
em++: error: '/Users/robertwebb/emsdk/upstream/bin/clang++ -DEMSCRIPTEN -fignore-exceptions -flto=full -Xclang -iwithsysroot/include/SDL -target wasm32-unknown-emscripten -D__EMSCRIPTEN_major__=2 -D__EMSCRIPTEN_minor__=0 -D__EMSCRIPTEN_tiny__=14 -D_LIBCPP_ABI_VERSION=2 -Dunix -D__unix -D__unix__ -flegacy-pass-manager -Werror=implicit-function-declaration --sysroot=/Users/robertwebb/emsdk/upstream/emscripten/cache/sysroot -Xclang -iwithsysroot/include/compat -Wall -Wcast-qual -std=c++11 -DANTI -DATOMIC -DCRAZYHOUSE -DHORDE -DKOTH -DRACE -DTHREECHECK -DNDEBUG -O3 -mdynamic-no-pic -DNO_PREFETCH -flto -c bitbase.cpp -o bitbase.o' failed (1)
make[1]: *** [bitbase.o] Error 1
make: *** [build] Error 2
                                    

This is probably due to latest emscripten being incompatible with this build, going to try to find either a different stockfish js or the correct version of emscripten to use.

@niklasf niklasf added the bug label Feb 15, 2021
@niklasf
Copy link
Member

niklasf commented Feb 15, 2021

Thanks for reporting. I am not actively maintaining this repository, because it is superceded by https://github.com/niklasf/stockfish.wasm in modern browsers, but I will merge proposed fixes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants