Skip to content
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

Can't use -C instrument-coverage with serde_derive #2552

Closed
J4CKVVH173 opened this issue Aug 2, 2023 · 3 comments
Closed

Can't use -C instrument-coverage with serde_derive #2552

J4CKVVH173 opened this issue Aug 2, 2023 · 3 comments

Comments

@J4CKVVH173
Copy link

When I try to run tests with RUSTFLAGS='-C instrument-coverage' I got the error = note: /usr/bin/ld: /usr/local/rustup/toolchains/1.71.0-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libprofiler_builtins-d779538be7a6fdb6.rlib(InstrProfilingPlatformLinux.o): relocation R_X86_64_PC32 against undefined hidden symbol__ehdr_start' can not be used when making a shared object
/usr/bin/ld: final link failed: nonrepresentable section on output
collect2: error: ld returned 1 exit status`

@dtolnay
Copy link
Member

dtolnay commented Aug 3, 2023

I was not able to reproduce this. Tests passed.

@J4CKVVH173
Copy link
Author

I've used this docker image for tests rust:buster. Inside the container I've created new empty project with one dependepncy serde = { version = "1.0", features = ["derive"] } and run LLVM_PROFILE_FILE='target/coverage/%p-%m.profraw' RUSTFLAGS='-C instrument-coverage' cargo test. This command raised this error error: linking with `cc` failed: exit status: 1 | = note: LC_ALL="C" PATH="/usr/local/rustup/toolchains/1.71.1-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin:/usr/local/cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" VSLANG="1033" "cc" "-Wl,--version-script=/tmp/rustcKzjaQD/list" "-Wl,--no-undefined-version" "-m64" "/tmp/rustcKzjaQD/symbols.o" "/home/kek/target/debug/deps/serde_derive-f97e869453b3161b.serde_derive.664d18b287a4daa2-cgu.0.rcgu.o" "/home/kek/target/debug/deps/serde_derive-f97e869453b3161b.serde_derive.664d18b287a4daa2-cgu.1.rcgu.o" "/home/kek/target/debug/deps/serde_derive-f97e869453b3161b.serde_deri....

= note: /usr/bin/ld: /usr/local/rustup/toolchains/1.71.1-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libprofiler_builtins-b8cf4bf4747f4a72.rlib(InstrProfilingPlatformLinux.o): relocation R_X86_64_PC32 against undefined hidden symbol `__ehdr_start' can not be used when making a shared object /usr/bin/ld: final link failed: nonrepresentable section on output collect2: error: ld returned 1 exit status

@dtolnay
Copy link
Member

dtolnay commented Aug 5, 2023

This does not seem related at all to serde. In rust:buster you get the same error even with a dependency on an empty proc macro instead of serde_derive.

@dtolnay dtolnay closed this as completed Aug 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants