Rust 1.59 using linux-musl and PIE

I'm trying to upgrade our codebase to rust 1.59.0. It compiles fine on 1.58.0.

For linux targets, we compile using the x86_64-unknown-linux-musl target.
But with 1.59.0, I'm getting many such errors

relocation R_X86_64_32 against `.bss.internal_state.3389' can not be used when making a PIE object; recompile with -fPIE

Followed by this

final link failed: nonrepresentable section on output

I'm guessing this has to do with this change.

I tried compiling with both -C relocation-model=pie and relocation-model=static but it did not seem to change much.

Any advice?

I would create a ticket against the Rust repo, mark it as a regression, and link to the PR you think might have introduced the issue.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.