sailfishos / rust

3 stars 6 forks source link

WIP: Rust 1.61 #15

Closed rubdos closed 1 year ago

rubdos commented 2 years ago

TODO list:

Thaodan commented 2 years ago

Are there any new requirements regarding LLVM 12 plus? I think it would make sense to also update LLVM at the same time.

rubdos commented 2 years ago

Are there any new requirements regarding LLVM 12 plus? I think it would make sense to also update LLVM at the same time.

I'm not sure, I have not looked at it. I rebased the patches and waited for errors to pop up. Rust claims it needs LLVM 12, so that's next to try!

rubdos commented 2 years ago

Another observation. I tried LLVM 14.0.5 and 12.0.1, and both require CMake 3.13.4 or later.

Seems like https://github.com/sailfishos/cmake has the right version, so I'll retry with a more up-to-date sdk.

rubdos commented 2 years ago

FWIW, using https://github.com/sailfishos/llvm/pull/1 I have a working Rust compile that can compile Whisperfish. I'll start dog feeding this compiler while I finish https://github.com/sailfishos/llvm/pull/1: clang still needs some massaging.

rubdos commented 2 years ago

The Aarch compiler seems a bit broken on certain crates. Excerpt:

  = note: /srv/mer/toolings/SailfishOS-4.4.0.58/opt/cross/bin/aarch64-meego-linux-gnu-ld: /usr/lib/rustlib/aarch64-unknown-linux-gnu/lib/libstd-9f7aba56fd08eb25.rlib(std-9f7aba56fd08eb25.std.923c915b-cgu.0.rcgu.o): in function `core::sync::atomic::atomic_sub':
          /home/rsmet/rpmbuild/BUILD/rustc-1.61.0-src/library/core/src/sync/atomic.rs:2618: undefined reference to `__aarch64_ldadd8_rel'
          /srv/mer/toolings/SailfishOS-4.4.0.58/opt/cross/bin/aarch64-meego-linux-gnu-ld: /home/rsmet/rpmbuild/BUILD/rustc-1.61.0-src/library/core/src/sync/atomic.rs:2618: undefined reference to `__aarch64_ldadd8_rel'
          /srv/mer/toolings/SailfishOS-4.4.0.58/opt/cross/bin/aarch64-meego-linux-gnu-ld: /home/rsmet/rpmbuild/BUILD/rustc-1.61.0-src/library/core/src/sync/atomic.rs:2618: undefined reference to `__aarch64_ldadd8_rel'
          /srv/mer/toolings/SailfishOS-4.4.0.58/opt/cross/bin/aarch64-meego-linux-gnu-ld: /home/rsmet/rpmbuild/BUILD/rustc-1.61.0-src/library/core/src/sync/atomic.rs:2618: undefined reference to `__aarch64_ldadd8_rel'

I might need to patch rustc in here to just turn the outline-atomics off, because disabling it with RUSTFLAGS as per the internet seems not to work.

This should be fixed whenever Sailfish OS gets gcc 9.3.1 or higher.

mlehtima commented 1 year ago

I managed to get rust aarch64 compiler to work so I will be probably making a new PR later where I will try to update to even newer rust.

mlehtima commented 1 year ago

Changes merged in https://github.com/sailfishos/rust/pull/18. Closing this PR.