-
-
Notifications
You must be signed in to change notification settings - Fork 42
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
"The encapsulation symbol needs to be retained under --gc-sections properly" #49
Comments
LLVM's instructions on how to solve the problem in C are here, but I don't know the Rust compiler well enough to apply its advice: A workaround is to use |
Mentioning @knan-md @allanjude in case either of you know of a way to fix this. The FreeBSD implementation is from #42. |
I see what looks like the same error on Linux (Fedora 36, using either Fedora's Rust or Rust 1.65.0 installed using rustup) if I link with [target.'cfg(not(any(target_os = "windows", target_arch = "wasm32")))']
rustflags = ["-C", "linker=clang", "-C", "link-args=-fuse-ld=/usr/bin/ld.lld"] in If I read https://lld.llvm.org/ELF/start-stop-gc right that's expected, (I don't know enough about linkers and how Rust interacts with them to help fix this, sorry...) |
Putting |
I get this same error targeting Chromeos and Android: For some reason it's not appearing for Linux and MacOS, though they are using lld. |
This does not help us in Chromium, it seems. Applying that to the crate that has the |
These errors are resolved for me by enabling the Example successful link here: https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket/8774385254500438081/+/u/compile__with_patch_/stdout#L41799_0 |
It works when it's built with RUSTFLAGS="-Clink-dead-code" Broken with dtolnay/linkme@64e7c63 Reported here: dtolnay/linkme#49
This workaround also helped me with a very basic example I was building. It appears that FWIW, I'm on Debian Linux, so it's not particularly immune to this issue either. |
- Add support for OpenBSD, same as for FreeBSD - Tests OK with RUSTFLAGS="-Clink-arg=-fuse-ld=lld -Clink-arg=-z -Clink-arg=nostart-stop-gc" See dtolnay#49 for explanations Signed-off-by: Laurent Cheylus <foxy@free.fr>
The current master branch fails to build on FreeBSD 14.0-CURRENT amd64, even though it still works on FreeBSD stable/13.
The text was updated successfully, but these errors were encountered: