Linking fails on x86_64-unknown-linux-musl

#1

Builds of my drivers have started failing to link on x86_64-unknown-linux-musl. At first I thought it was a nightly mishap but now it also happens on the beta channel.
Here the relevant messages:

/usr/bin/ld: elf.o: access beyond end of merged section (2531)
....
/usr/bin/ld: /home/travis/.rustup/toolchains/beta-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-musl/lib/libbacktrace_sys-8a74141a1d23839e.rlib(elf.o)(.debug_info+0x1af8): reloc against `.text.elf_add': error 2
/usr/bin/ld: final link failed: Nonrepresentable section on output

See the build log here

Do you know how to solve this?

#2

There was a regression causing builds to have troubles with older binutils versions: https://github.com/rust-lang/rust/issues/59411

You should be able to switch travis to use a newer Ubuntu version to work around it.

1 Like
#3

I see. I will do that. Thanks!