[lld] [lld][WebAssembly] Report unsupported PIC relocations as errors (PR #104926)

Derek Schuff via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 20 14:22:04 PDT 2024


dschuff wrote:

This seems to have broken the Emscripten benchmark test `test_zzz_bullet`. (Build log [here](https://logs.chromium.org/logs/emscripten-releases/buildbucket/cr-buildbucket/8736423805323262737/+/u/Emscripten_benchmark/stdout)

The command line is `/b/s/w/ir/x/w/install/bin/wasm-ld -o .libs/libLinearMath.so.0.0.0 .libs/btQuickprof.o .libs/btGeometryUtil.o .libs/btAlignedAllocator.o .libs/btSerializer.o .libs/btConvexHull.o .libs/btConvexHullComputer.o -L/b/s/w/ir/x/w/install/emscripten/cache/sysroot/lib/wasm32-emscripten /b/s/w/ir/x/w/install/emscripten/cache/sysroot/lib/wasm32-emscripten/libGL-getprocaddr.a -lal -lhtml5 -lstubs-debug -lc-debug /b/s/w/ir/x/w/install/emscripten/cache/sysroot/lib/wasm32-emscripten/libdlmalloc.a -lcompiler_rt /b/s/w/ir/x/w/install/emscripten/cache/sysroot/lib/wasm32-emscripten/libc++-noexcept.a /b/s/w/ir/x/w/install/emscripten/cache/sysroot/lib/wasm32-emscripten/libc++abi-noexcept.a -lsockets -L/b/s/w/ir/x/w/install/emscripten/cache/sysroot/lib/wasm32-emscripten --relocatable -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr`

It looks like this command is trying to build a DSO but I also see it's using `--relocatable` and not `-shared`.
@sbc100 is this what that test is supposed to do? Maybe the test is broken somehow?

There are also warnings like 
`em++: warning: linking a library with `-shared` will emit a static object file.  This is a form of emulation to support existing build systems.  If you want to build a runtime shared library use the SIDE_MODULE setting. [-Wemcc]
em++: warning: ignoring unsupported linker flag: `-soname` [-Wlinkflags]`

which also seems maybe wrong.

https://github.com/llvm/llvm-project/pull/104926


More information about the llvm-commits mailing list