Skip to content

Commit 907dd07

Browse files
committed
Auto merge of #152609 - mati865:gnullvm-llvm-dll, r=<try>
Install LLVM DLL in the right place on Windows try-job: x86_64-msvc-1
2 parents d1a11b6 + 1d1280a commit 907dd07

3 files changed

Lines changed: 8 additions & 1 deletion

File tree

compiler/rustc_metadata/src/native_libs.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ pub fn walk_native_lib_search_dirs<R>(
6161
// library directory instead of the self-contained directories.
6262
// Sanitizer libraries have the same issue and are also linked by name on Apple targets.
6363
// The targets here should be in sync with `copy_third_party_objects` in bootstrap.
64+
// Finally there is shared LLVM library, which unlike compiler libraries, is linked by the name,
65+
// therefore requiring the search path for the linker.
6466
// FIXME: implement `-Clink-self-contained=+/-unwind,+/-sanitizers`, move the shipped libunwind
6567
// and sanitizers to self-contained directory, and stop adding this search path.
6668
// FIXME: On AIX this also has the side-effect of making the list of library search paths
@@ -71,6 +73,9 @@ pub fn walk_native_lib_search_dirs<R>(
7173
|| sess.target.os == Os::Fuchsia
7274
|| sess.target.is_like_aix
7375
|| sess.target.is_like_darwin && !sess.sanitizers().is_empty()
76+
|| sess.target.os == Os::Windows
77+
&& sess.target.env == Env::Gnu
78+
&& sess.target.abi == Abi::Llvm
7479
{
7580
f(&sess.target_tlib_path.dir, false)?;
7681
}

src/bootstrap/src/core/build_steps/dist.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2557,7 +2557,7 @@ pub fn maybe_install_llvm_target(builder: &Builder<'_>, target: TargetSelection,
25572557
),
25582558
)]
25592559
pub fn maybe_install_llvm_runtime(builder: &Builder<'_>, target: TargetSelection, sysroot: &Path) {
2560-
let dst_libdir = sysroot.join(builder.sysroot_libdir_relative(Compiler::new(1, target)));
2560+
let dst_libdir = sysroot.join(builder.libdir_relative(Compiler::new(1, target)));
25612561
// We do not need to copy LLVM files into the sysroot if it is not
25622562
// dynamically linked; it is already included into librustc_llvm
25632563
// statically.

src/ci/github-actions/jobs.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -712,6 +712,7 @@ auto:
712712
--target=aarch64-pc-windows-gnullvm,i686-pc-windows-gnullvm
713713
--enable-full-tools
714714
--enable-profiler
715+
--enable-llvm-link-shared
715716
DIST_REQUIRE_ALL_TOOLS: 1
716717
CODEGEN_BACKENDS: llvm,cranelift
717718
CC_i686_pc_windows_gnullvm: i686-w64-mingw32-clang
@@ -724,6 +725,7 @@ auto:
724725
--build=x86_64-pc-windows-gnullvm
725726
--enable-full-tools
726727
--enable-profiler
728+
--enable-llvm-link-shared
727729
DIST_REQUIRE_ALL_TOOLS: 1
728730
CODEGEN_BACKENDS: llvm,cranelift
729731
<<: *job-windows

0 commit comments

Comments
 (0)