Skip to content

build-pass tests in tests/ui-fulldeps fail when cross-compiling and download-rustc is enabled #110226

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
jyn514 opened this issue Apr 12, 2023 · 1 comment · Fixed by #110263
Closed
Labels
A-download-rustc Area: The `rust.download-rustc` build option. C-bug Category: This is a bug. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@jyn514
Copy link
Member

jyn514 commented Apr 12, 2023

I tried this code: ./configure --set profile=compiler --set rust.download-rustc=true && x t tests/ui-fulldeps/ --target i686-unknown-linux-gnu --run never (--run never is to avoid #110225).
I expected to see this happen: All tests pass.

Instead, this happened: Some tests fail (the same ones as in #110225):

failures:
    [ui] tests/ui-fulldeps/deriving-encodable-decodable-box.rs
    [ui] tests/ui-fulldeps/deriving-encodable-decodable-cell-refcell.rs
    [ui] tests/ui-fulldeps/issue-14021.rs
    [ui] tests/ui-fulldeps/compiler-calls.rs
    [ui] tests/ui-fulldeps/stable-mir/crate-info.rs
    [ui] tests/ui-fulldeps/mod_dir_path_canonicalized.rs
    [ui] tests/ui-fulldeps/pprust-expr-roundtrip.rs

test result: FAILED. 63 passed; 7 failed; 1 ignored; 0 measured; 0 filtered out; finished in 3.86s

The failures look like

---- [ui] tests/ui-fulldeps/pprust-expr-roundtrip.rs stdout ----

error: test compilation failed although it shouldn't!
status: exit status: 1
command: "/home/jyn/src/rust2/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/home/jyn/src/rust2/tests/ui-fulldeps/pprust-expr-roundtrip.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "-O" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "-C" "prefer-dynamic" "--out-dir" "/home/jyn/src/rust2/build/x86_64-unknown-linux-gnu/test/ui-fulldeps/pprust-expr-roundtrip" "-Crpath" "-Cdebuginfo=0" "-Lnative=/home/jyn/src/rust2/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/home/jyn/src/rust2/build/x86_64-unknown-linux-gnu/test/ui-fulldeps/pprust-expr-roundtrip/auxiliary"
stdout: none
--- stderr -------------------------------
error: linking with `cc` failed: exit status: 1
   |
   = note: LC_ALL="C" PATH="/home/jyn/src/rust2/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/bin:/home/jyn/.local/bin:/home/jyn/.local/lib/cargo/bin:/home/jyn/src/dotfiles/bin:/home/jyn/.local/bin:/home/jyn/.local/bin:/home/jyn/.local/lib/cargo/bin:/home/jyn/src/dotfiles/bin:/home/jyn/.local/bin:/home/jyn/.local/bin:/home/jyn/.local/lib/cargo/bin:/home/jyn/src/dotfiles/bin:/home/jyn/.local/bin:/home/jyn/.local/bin:/home/jyn/.local/lib/cargo/bin:/home/jyn/src/dotfiles/bin:/home/jyn/.local/bin:/home/jyn/.local/bin:/home/jyn/.local/lib/cargo/bin:/home/jyn/src/dotfiles/bin:/home/jyn/.local/bin:/home/jyn/.local/bin:/home/jyn/.local/lib/cargo/bin:/home/jyn/src/dotfiles/bin:/home/jyn/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin" VSLANG="1033" "cc" "-m64" "/tmp/rustcdeJQFz/symbols.o" "/home/jyn/src/rust2/build/x86_64-unknown-linux-gnu/test/ui-fulldeps/pprust-expr-roundtrip/pprust-expr-roundtrip.pprust_expr_roundtrip.f72f72b5-cgu.0.rcgu.o" "-Wl,--as-needed" "-L" "/home/jyn/src/rust2/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/home/jyn/src/rust2/build/x86_64-unknown-linux-gnu/test/ui-fulldeps/pprust-expr-roundtrip/auxiliary" "-L" "/home/jyn/src/rust2/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-L" "/home/jyn/src/rust2/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-lrustc_driver-678dead588f20b29" "-L" "/home/jyn/src/rust2/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-lstd-b5096806ff948049" "-Wl,-Bstatic" "/home/jyn/src/rust2/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-35b8a4bd2de4e62e.rlib" "-Wl,-Bdynamic" "-lLLVM-16-rust-1.70.0-nightly" "-ldl" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "/home/jyn/src/rust2/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "/home/jyn/src/rust2/build/x86_64-unknown-linux-gnu/test/ui-fulldeps/pprust-expr-roundtrip/pprust-expr-roundtrip" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-Wl,-O1" "-Wl,--strip-debug" "-nodefaultlibs" "-Wl,-rpath,$ORIGIN/../../../stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,--enable-new-dtags" "-Wl,-z,origin"
   = note: /usr/bin/ld: /home/jyn/src/rust2/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_driver-678dead588f20b29.so: undefined reference to `LLVMInitializeLoongArchAsmPrinter@LLVM_16'
           /usr/bin/ld: /home/jyn/src/rust2/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_driver-678dead588f20b29.so: undefined reference to `LLVMInitializeLoongArchAsmParser@LLVM_16'
           /usr/bin/ld: /home/jyn/src/rust2/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_driver-678dead588f20b29.so: undefined reference to `LLVMInitializeLoongArchTargetInfo@LLVM_16'
           /usr/bin/ld: /home/jyn/src/rust2/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_driver-678dead588f20b29.so: undefined reference to `LLVMInitializeLoongArchTarget@LLVM_16'
           /usr/bin/ld: /home/jyn/src/rust2/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_driver-678dead588f20b29.so: undefined reference to `LLVMInitializeLoongArchTargetMC@LLVM_16'
           collect2: error: ld returned 1 exit status
           
   = note: some `extern` functions couldn't be found; some native libraries may need to be installed or have their path specified
   = note: use the `-l` flag to specify native libraries to link
   = note: use the `cargo:rustc-link-lib` directive to specify the native libraries to link with Cargo (see https://doc.rust-lang.org/cargo/reference/build-scripts.html#cargorustc-link-libkindname)

error: aborting due to previous error
------------------------------------------

I think we need to rebuild LLVM from source when cross-compiling, we can't use the downloaded version.

I'm unsure if this is related specifically to download-rustc or whether download-ci-llvm affects it too; I had both enabled.

Meta

HEAD is branched from 9be9b5e.

@jyn514 jyn514 added T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) C-bug Category: This is a bug. A-download-rustc Area: The `rust.download-rustc` build option. labels Apr 12, 2023
@jyn514 jyn514 changed the title build-pass tests in tests/ui-fulldeps fail when cross-compiling and download-ci-llvm is enabled build-pass tests in tests/ui-fulldeps fail when cross-compiling and download-rustc is enabled Apr 12, 2023
@jyn514
Copy link
Member Author

jyn514 commented Apr 13, 2023

Apparently the LLVM in rustc-dev.tar.xz is different than the one in rust-dev.tar.xz??? I have no idea why, but that's probably why only some of the symbols are missing rather than all of them.

@bors bors closed this as completed in 276fa29 Apr 14, 2023
oli-obk pushed a commit to oli-obk/miri that referenced this issue Apr 17, 2023
Add `libLLVM.so` to the target libdir when download-rustc is enabled

Previously, we would only add it to the host libdir, which meant it couldn't be loaded by `ui-fulldeps` tests that used rustc_private.

Fixes rust-lang/rust#110225, fixes rust-lang/rust#110226.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-download-rustc Area: The `rust.download-rustc` build option. C-bug Category: This is a bug. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant