Skip to content

Provide rust-lld on s390x (for the wasm target) #94324

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

Closed
uweigand opened this issue Feb 24, 2022 · 5 comments · Fixed by #94361
Closed

Provide rust-lld on s390x (for the wasm target) #94324

uweigand opened this issue Feb 24, 2022 · 5 comments · Fixed by #94361

Comments

@uweigand
Copy link
Contributor

Trying to build for the wasm32-unknown-unknown target on a s390x host fails with:

  `rust-lld` not found, please install it!

This seems to be because - unlike on other architectures - rust-lld is not built and packaged as part of the rust toolchain.

Now, it is true that LLD currently does not support the s390x architecture. But that is only an issue when trying to use the s390x architecture as target - it is completely fine to build LLD on a s390x host and use it to link binaries for any other target architecture it supports, in particular including wasm.

Would it be possible to include rust-lld on s390x as well, to make building wasm binaries more straightforward?

@nikic
Copy link
Contributor

nikic commented Feb 24, 2022

I believe we don't build lld for most non-x86 hosts, though I don't see any particular issue with including it. I think all it would take is an --enable-lld in

ENV RUST_CONFIGURE_ARGS --enable-extended --disable-docs

@Mark-Simulacrum
Copy link
Member

Yep, if CI passes with it added it's generally fine to do so for tier 2 with host tools targets (or better), though it may get removed if it causes undue CI time burden (unlikely).

@uweigand
Copy link
Contributor Author

Thanks for the comments! Would you like me to submit a PR adding the --enable-lld flag as described above? (I'm not really familiar with how the automated builds work, so I'm not sure how to verify this works correctly ...)

@nikic
Copy link
Contributor

nikic commented Feb 24, 2022

Normally, you'd be able to verify using sudo src/ci/docker/run.sh dist-s390x-linux. However, it's not possible to actually build this docker image anymore, due to the Ubuntu 16.04 certificate expiration issue. And unfortunately, this one doesn't upgrade to Ubuntu 20.04 cleanly, because it's on make 3 + old crosstool-ng. It would be nice to upgrade it, but probably this workaround would work in the meantime:

FROM ubuntu:20.04
RUN apt-get update && \
apt-get install -y --no-install-recommends \
curl \
ca-certificates
WORKDIR /tmp
RUN curl -f https://curl.se/ca/cacert.pem -o cacert.pem
FROM ubuntu:16.04
# The ca-certificates in ubuntu-16 is too old, so update the certificates
# with something more recent.
COPY --from=0 /tmp/cacert.pem /tmp/cacert.pem
ENV CURL_CA_BUNDLE /tmp/cacert.pem

@uweigand
Copy link
Contributor Author

OK, I'll give it a try.

As an aside, Ubuntu 20.04 contains a full cross-toolchain targeting s390x out of the box, so I'm not sure we'd really need crosstool-ng at all - unless there's a particular reason the Rust build requires it?

However, if we update this to Ubuntu 20.04, would this have the side effect that the generated Rust toolchains would no longer install on older distros? We really don't want that.

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.

3 participants