Skip to content

Use spidermonkey built using gplusplus instead of clang

Peng Hui Jiang edited this page Sep 17, 2019 · 1 revision

Symptom

When building and linking for ateles server in linux using spidermonkey built using clang, there is the following link error:

Scanning dependencies of target ateles
[ 37%] Building CXX object CMakeFiles/ateles.dir/ateles.pb.cc.o
[ 50%] Building CXX object CMakeFiles/ateles.dir/ateles.grpc.pb.cc.o
[ 62%] Building CXX object CMakeFiles/ateles.dir/c_src/js.cc.o
[ 75%] Building CXX object CMakeFiles/ateles.dir/c_src/jsutil.cc.o
[ 87%] Building CXX object CMakeFiles/ateles.dir/c_src/server.cc.o
[100%] Linking CXX executable ateles
CMakeFiles/ateles.dir/c_src/js.cc.o: In function `JS::GCPolicy<JS::Value>::trace(JSTracer*, JS::Value*, char const*)':
/usr/local/include/mozjs-60/js/Value.h:1346: undefined reference to `void js::UnsafeTraceManuallyBarrieredEdge<JS::Value>(JSTracer*, JS::Value*, char const*)'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [ateles] Error 1

Troubleshooting

https://gitlab.gnome.org/GNOME/gjs/issues/8#note_7811

I just realized what is happening here:

It fails when I build SpyderMonkey using clang;
But, it is ok to build SpyderMonkey with gcc and all the GNOME stuff with clang (the reason CI was working);
A "full" build using clang in CI also fails (as expected).

Solution

Problem was gone when backing to use spidermonkey built using g++

Clone this wiki locally