Open spearman opened 1 month ago
That looks purely like an lld issue, and is not related to rust. It's probably better to open an issue in the llvm/lld project, we couldn't fix this on our side.
It also looks very common with lld when linking to libs linked with another linker like gold -- and e.g. fixable by linking everything with lld, but seems impossible in your case.
The other workarounds mentioned in the many projects like Android hitting this issue, like setting hidden visibility, disabling gc-sections, no start gc, ignoring fatal warnings, didn't seem to work on your project.
I don't believe there's anything we can do here.
That looks purely like an lld issue, and is not related to rust. It's probably better to open an issue in the llvm/lld project, we couldn't fix this on our side.
It also looks very common with lld when linking to libs linked with another linker like gold -- and e.g. fixable by linking everything with lld, but seems impossible in your case.
The other workarounds mentioned in the many projects like Android hitting this issue, like setting hidden visibility, disabling gc-sections, no start gc, ignoring fatal warnings, didn't seem to work on your project.
I don't believe there's anything we can do here.
Could you explain a little more what you mean that there is a problem with lld? If it wasn't clear, it builds and links normally with lld (no errors), the error only occurs when linking with rust-lld.
rust-lld is lld without modifications, just renamed. Any issue with rust-lld should be in lld. We just pass -fuse-ld=lld
and the paths in the sysroot, and that's it.
There are many e.g. reports online of this exact issue with lld, eg https://github.com/android/ndk/issues/927
Something weird must be going if e.g. lld without the -B path works...
Something weird must be going on indeed. For me, it doesn't work with a locally built lld but does with e.g. ubuntu's lld.
I've tried different versions of lld, and things seem to be consistent with my "the issue is in lld" theory:
Which versions did you try @spearman?
I have a project generating bindings for FMOD using bindgen: https://gitlab.com/spearman/fmod-rs/-/tree/master/fmod-sys
Trying to build and link an executable with rust-lld generates the following errors:
For now I am using the rustflags option
-Zlinker-features=-lld
to avoid using rust-lld