rust-lang / rust-lang/rust

CI llvm related issue when trying to cross compile for Solaris

Open
#137,997 12 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-cross A-linkage A-linkers A-LLVM C-bug E-needs-investigation O-solaris T-bootstrap
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

This is rather question than the real issue. I try to cross compile Rust for Solaris with following modification:

https://github.com/psumbera/rust/commit/9519cac242c9bf67a078776d7e4d2ddc4e876cec (this is based on illumos build scripts)

using:

cargo run --manifest-path src/ci/citool/Cargo.toml run-local dist-x86_64-solaris

But I'm getting following weired issue:

   Compiling rustc_driver v0.0.0 (/checkout/compiler/rustc_driver)
[RUSTC-TIMING] rustc_driver test:false 7.010
error: linking with `x86_64-solaris-gcc` failed: exit status: 1
  |
  = note:  "x86_64-solaris-gcc" "-m64" "/tmp/rustcRtl9jf/symbols.o" "<1 object files omitted>" "-Wl,-z,ignore" "-Wl,-Bdynamic" "<sysroot>-rustc/x86_64-pc-solaris/release/deps/librustc_driver-54c872bdc3792f02.so" "-Wl,-Bstatic" "<sysroot>/lib/rustlib/x86_64-pc-solaris/lib/{libcompiler_builtins-*}.rlib" "-Wl,-Bdynamic" "-lz" "-lstdc++" "-lsendfile" "-llgrp" "-lsocket" "-lposix4" "-lpthread" "-lresolv" "-lgcc_s" "-lc" "-lm" "-lrt" "-lpthread" "-lsendfile" "-llgrp" "-L" "<sysroot>-rustc/x86_64-pc-solaris/release/build/psm-8317c88d2b230546/out" "-L" "<sysroot>-rustc/x86_64-pc-solaris/release/build/blake3-e747bce60b8d0a51/out" "-L" "<sysroot>-rustc/x86_64-pc-solaris/release/build/blake3-e747bce60b8d0a51/out" "-L" "<sysroot>-rustc/x86_64-pc-solaris/release/build/rustc_llvm-66a04046ce5e9ef9/out" "-L" "/checkout/obj/build/x86_64-pc-solaris/llvm/lib" "-o" "<sysroot>-rustc/x86_64-pc-solaris/release/deps/rustc_main-c68d47c0d0e4f5be" "-nodefaultlibs" "-Wl,-z,origin" "-Wl,-rpath,$ORIGIN/../lib"
  = note: some arguments are omitted. use `--verbose` to show all linker arguments
  = note: /opt/solaris/x86_64/lib/gcc/x86_64-pc-solaris2.11/8.4.0/../../../../x86_64-pc-solaris2.11/bin/ld: warning: -z ignore ignored
          /opt/solaris/x86_64/lib/gcc/x86_64-pc-solaris2.11/8.4.0/../../../../x86_64-pc-solaris2.11/bin/ld: /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-pc-solaris/release/deps/librustc_driver-54c872bdc3792f02.so: logb: invalid version 2 (max 0)
          /opt/solaris/x86_64/lib/gcc/x86_64-pc-solaris2.11/8.4.0/../../../../x86_64-pc-solaris2.11/bin/ld: /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-pc-solaris/release/deps/librustc_driver-54c872bdc3792f02.so: error adding symbols: bad value
          collect2: error: ld returned 1 exit status


[RUSTC-TIMING] rustc_main test:false 0.103
error: could not compile `rustc-main` (bin "rustc-main") due to 1 previous error
Building bootstrap
Build completed unsuccessfully in 2:57:26
  local time: Tue Mar  4 12:09:24 UTC 2025
  network time: Tue, 04 Mar 2025 12:09:25 GMT
Error: Job failed

This is probably something Solaris libc specific. I have already seen logb: invalid version 3 (max 0) with newer libc version.

But it's kind of regression since I was able to crosscompile it before llvm was recently updated from version 19 to 20.

I'm still able to overcome the error by copying into src/llvm-tools LLVM version 19 (from my previous chceckout).

Unfortuanetelly I'm not really able to git bisect it since there are some other issues on the way...

So I'm filing this to get eventually some help here. Thank you!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with src/ci/citool/Cargo.toml and reproduce the reported cargo run --manifest-path src/ci/citool/Cargo.toml run-local dist-x86_64-solaris command. Compare the current LLVM 20 setup with the working LLVM 19 copy in src/llvm-tools, focusing on the Solaris linker error and the linked build-script modification. Done means identifying the LLVM 19-to-20 regression and confirming a successful Solaris cross-compilation with the corrected setup.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
build-system, ci-cd, compilers, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.