dtolnay/linkme

"The encapsulation symbol needs to be retained under --gc-sections properly"

Open

#49 opened on Jul 9, 2022

View on GitHub
 (14 comments) (0 reactions) (0 assignees)Rust (46 forks)github user discovery
help wanted

Repository metrics

Stars
 (862 stars)
PR merge metrics
 (Avg merge 2m) (1 merged PR in 30d)

Description

The current master branch fails to build on FreeBSD 14.0-CURRENT amd64, even though it still works on FreeBSD stable/13.

$ cargo test
...
  = note: ld: error: undefined symbol: __start_linkme_SHENANIGANS
          >>> referenced by x4z07wsgcl2z4i4
          >>>               /usr/home/somers/src/rust/linkme/target/debug/deps/distributed_slice-425b465e5440679a.x4z07wsgcl2z4i4.rcgu.o:(distributed_slice::SHENANIGANS::hca25c6519cd4df0f)
          >>> the encapsulation symbol needs to be retained under --gc-sections properly; consider -z nostart-stop-gc (see https://lld.llvm.org/ELF/start-stop-gc)
          
          ld: error: undefined symbol: __stop_linkme_SHENANIGANS
          >>> referenced by x4z07wsgcl2z4i4
          >>>               /usr/home/somers/src/rust/linkme/target/debug/deps/distributed_slice-425b465e5440679a.x4z07wsgcl2z4i4.rcgu.o:(distributed_slice::SHENANIGANS::hca25c6519cd4df0f)
          
          ld: error: undefined symbol: __start_linkme_EMPTY
          >>> referenced by x4z07wsgcl2z4i4
          >>>               /usr/home/somers/src/rust/linkme/target/debug/deps/distributed_slice-425b465e5440679a.x4z07wsgcl2z4i4.rcgu.o:(distributed_slice::test_empty::EMPTY::h31c7f9e37773eb8f)
          >>> the encapsulation symbol needs to be retained under --gc-sections properly; consider -z nostart-stop-gc (see https://lld.llvm.org/ELF/start-stop-gc)
          
          ld: error: undefined symbol: __stop_linkme_EMPTY
          >>> referenced by x4z07wsgcl2z4i4
          >>>               /usr/home/somers/src/rust/linkme/target/debug/deps/distributed_slice-425b465e5440679a.x4z07wsgcl2z4i4.rcgu.o:(distributed_slice::test_empty::EMPTY::h31c7f9e37773eb8f)
          
          ld: error: undefined symbol: __start_linkme_NONCOPY
          >>> referenced by x4z07wsgcl2z4i4
          >>>               /usr/home/somers/src/rust/linkme/target/debug/deps/distributed_slice-425b465e5440679a.x4z07wsgcl2z4i4.rcgu.o:(distributed_slice::test_non_copy::NONCOPY::h920eb5b4a050a94d)
          >>> the encapsulation symbol needs to be retained under --gc-sections properly; consider -z nostart-stop-gc (see https://lld.llvm.org/ELF/start-stop-gc)
          
          ld: error: undefined symbol: __stop_linkme_NONCOPY
          >>> referenced by x4z07wsgcl2z4i4
          >>>               /usr/home/somers/src/rust/linkme/target/debug/deps/distributed_slice-425b465e5440679a.x4z07wsgcl2z4i4.rcgu.o:(distributed_slice::test_non_copy::NONCOPY::h920eb5b4a050a94d)
          cc: error: linker command failed with exit code 1 (use -v to see invocation)
          

error: could not compile `linkme` due to previous error
error: could not compile `linkme` due to previous error
error: could not compile `linkme` due to previous error

Contributor guide