Skip to content

Error on build with latest version of emscripten #14

@robert-j-webb

Description

@robert-j-webb

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions