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

librsvg: rustc 1.54.0 build fails on ARM64 (Linux and macOS) #109

Closed
lovell opened this issue Aug 3, 2021 · 4 comments · Fixed by #110
Closed

librsvg: rustc 1.54.0 build fails on ARM64 (Linux and macOS) #109

lovell opened this issue Aug 3, 2021 · 4 comments · Fixed by #110

Comments

@lovell
Copy link
Owner

lovell commented Aug 3, 2021

rustc 1.53.0 works but 1.54.0 fails; needs investigating.

macOS

stable-x86_64-apple-darwin installed - rustc 1.54.0 (a178d0322 2021-07-26)
libtool:   error: object name conflicts in archive: .libs/librsvg-2.lax/librsvg_c_api.a//Users/runner/work/sharp-libvips/sharp-libvips/deps/svg/./.libs/librsvg_c_api.a

Linux glibc

stable-x86_64-unknown-linux-gnu installed - rustc 1.54.0 (a178d0322 2021-07-26)
libtool:   error: object name conflicts in archive: .libs/librsvg-2.lax/librsvg_c_api.a//deps/svg/./.libs/librsvg_c_api.a

Interestingly, Linux musl ARM64 works and that uses rustc nightly so I guess whatever causes this might already be fixed there.

@kleisauke
Copy link
Collaborator

It looks like this is the same issue as the one mentioned in #73 (comment). I think it's due to commit rust-lang/compiler-builtins@96bc62e which causes fp_mode.o to also conflict for non-musl ARM64 targets.

This can be resolved by rebuilding Rust's standard library using the build-std feature, similar as the musl ARM64 target (see e.g. commit 9f54bfd). Unfortunately, this requires a nightly version of Rust.

Perhaps there's a better way to resolve this?

@lovell
Copy link
Owner Author

lovell commented Aug 3, 2021

I was kind of hoping this might be a new problem 😅

Switching to nightly rustc everywhere is probably the best approach right now, plus might unlock useful new features e.g. panic_immediate_abort can reduce binary size.

kleisauke added a commit to kleisauke/libvips-packaging that referenced this issue Aug 7, 2021
lovell pushed a commit that referenced this issue Aug 7, 2021
@kleisauke
Copy link
Collaborator

I think it's due to commit rust-lang/compiler-builtins@96bc62e which causes fp_mode.o to also conflict for non-musl ARM64 targets.

This assumption was incorrect, the fp_mode.o duplicate is actually resolved with that commit. The -Zbuild-std feature is no longer needed once PR rust-lang/compiler-builtins#444 is merged and this crate is updated in Rust. I guess it may take some time before it becomes available in a stable version.

The reason why the -Zbuild-std feature actually resolved this build error is that the c feature of the compiler-builtins crate is then implicitly skipped, this means that it doesn't leverage LLVM's optimized implementations (available in compiler-rt). Work-in-progress commit kleisauke@1a3f69d enables this feature, and currently fails for ARM64 in CI (as expected).

@kleisauke
Copy link
Collaborator

PR #123 removes this -Zbuild-std feature flag.

kleisauke added a commit to kleisauke/libvips-packaging that referenced this issue May 30, 2022
The underlying issue (lovell#109) should be fixed with compiler-builtins
v0.1.55, available in Rust 1.59.0.
lovell pushed a commit that referenced this issue May 30, 2022
The underlying issue (#109) should be fixed with compiler-builtins
v0.1.55, available in Rust 1.59.0.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants