@@ -33,7 +33,7 @@ use crate::utils::exec::command;
33
33
use crate :: utils:: helpers:: {
34
34
exe, get_clang_cl_resource_dir, is_debug_info, is_dylib, symlink_dir, t, up_to_date,
35
35
} ;
36
- use crate :: { CLang , Compiler , DependencyType , GitRepo , LLVM_TOOLS , Mode , debug, trace} ;
36
+ use crate :: { CLang , Compiler , DependencyType , FileType , GitRepo , LLVM_TOOLS , Mode , debug, trace} ;
37
37
38
38
#[ derive( Debug , Clone , PartialEq , Eq , PartialOrd , Ord , Hash ) ]
39
39
pub struct Std {
@@ -321,7 +321,7 @@ fn copy_and_stamp(
321
321
dependency_type : DependencyType ,
322
322
) {
323
323
let target = libdir. join ( name) ;
324
- builder. copy_link ( & sourcedir. join ( name) , & target) ;
324
+ builder. copy_link ( & sourcedir. join ( name) , & target, FileType :: Regular ) ;
325
325
326
326
target_deps. push ( ( target, dependency_type) ) ;
327
327
}
@@ -330,7 +330,7 @@ fn copy_llvm_libunwind(builder: &Builder<'_>, target: TargetSelection, libdir: &
330
330
let libunwind_path = builder. ensure ( llvm:: Libunwind { target } ) ;
331
331
let libunwind_source = libunwind_path. join ( "libunwind.a" ) ;
332
332
let libunwind_target = libdir. join ( "libunwind.a" ) ;
333
- builder. copy_link ( & libunwind_source, & libunwind_target) ;
333
+ builder. copy_link ( & libunwind_source, & libunwind_target, FileType :: NativeLibrary ) ;
334
334
libunwind_target
335
335
}
336
336
@@ -401,7 +401,7 @@ fn copy_self_contained_objects(
401
401
for & obj in & [ "crtbegin.o" , "crtbeginS.o" , "crtend.o" , "crtendS.o" ] {
402
402
let src = crt_path. join ( obj) ;
403
403
let target = libdir_self_contained. join ( obj) ;
404
- builder. copy_link ( & src, & target) ;
404
+ builder. copy_link ( & src, & target, FileType :: NativeLibrary ) ;
405
405
target_deps. push ( ( target, DependencyType :: TargetSelfContained ) ) ;
406
406
}
407
407
} else {
@@ -443,9 +443,9 @@ fn copy_self_contained_objects(
443
443
} else if target. is_windows_gnu ( ) {
444
444
for obj in [ "crt2.o" , "dllcrt2.o" ] . iter ( ) {
445
445
let src = compiler_file ( builder, & builder. cc ( target) , target, CLang :: C , obj) ;
446
- let target = libdir_self_contained. join ( obj) ;
447
- builder. copy_link ( & src, & target ) ;
448
- target_deps. push ( ( target , DependencyType :: TargetSelfContained ) ) ;
446
+ let dst = libdir_self_contained. join ( obj) ;
447
+ builder. copy_link ( & src, & dst , FileType :: NativeLibrary ) ;
448
+ target_deps. push ( ( dst , DependencyType :: TargetSelfContained ) ) ;
449
449
}
450
450
}
451
451
@@ -790,8 +790,11 @@ impl Step for StdLink {
790
790
let file = t ! ( file) ;
791
791
let path = file. path ( ) ;
792
792
if path. is_file ( ) {
793
- builder
794
- . copy_link ( & path, & sysroot. join ( "lib" ) . join ( path. file_name ( ) . unwrap ( ) ) ) ;
793
+ builder. copy_link (
794
+ & path,
795
+ & sysroot. join ( "lib" ) . join ( path. file_name ( ) . unwrap ( ) ) ,
796
+ FileType :: Regular ,
797
+ ) ;
795
798
}
796
799
}
797
800
}
@@ -829,7 +832,7 @@ fn copy_sanitizers(
829
832
830
833
for runtime in & runtimes {
831
834
let dst = libdir. join ( & runtime. name ) ;
832
- builder. copy_link ( & runtime. path , & dst) ;
835
+ builder. copy_link ( & runtime. path , & dst, FileType :: NativeLibrary ) ;
833
836
834
837
// The `aarch64-apple-ios-macabi` and `x86_64-apple-ios-macabi` are also supported for
835
838
// sanitizers, but they share a sanitizer runtime with `${arch}-apple-darwin`, so we do
@@ -934,9 +937,9 @@ impl Step for StartupObjects {
934
937
. run ( builder) ;
935
938
}
936
939
937
- let target = sysroot_dir. join ( ( * file) . to_string ( ) + ".o" ) ;
938
- builder. copy_link ( dst_file, & target ) ;
939
- target_deps. push ( ( target , DependencyType :: Target ) ) ;
940
+ let obj = sysroot_dir. join ( ( * file) . to_string ( ) + ".o" ) ;
941
+ builder. copy_link ( dst_file, & obj , FileType :: NativeLibrary ) ;
942
+ target_deps. push ( ( obj , DependencyType :: Target ) ) ;
940
943
}
941
944
942
945
target_deps
@@ -952,7 +955,7 @@ fn cp_rustc_component_to_ci_sysroot(builder: &Builder<'_>, sysroot: &Path, conte
952
955
if src. is_dir ( ) {
953
956
t ! ( fs:: create_dir_all( dst) ) ;
954
957
} else {
955
- builder. copy_link ( & src, & dst) ;
958
+ builder. copy_link ( & src, & dst, FileType :: Regular ) ;
956
959
}
957
960
}
958
961
}
@@ -1707,7 +1710,7 @@ fn copy_codegen_backends_to_sysroot(
1707
1710
let dot = filename. find ( '.' ) . unwrap ( ) ;
1708
1711
format ! ( "{}-{}{}" , & filename[ ..dash] , builder. rust_release( ) , & filename[ dot..] )
1709
1712
} ;
1710
- builder. copy_link ( file, & dst. join ( target_filename) ) ;
1713
+ builder. copy_link ( file, & dst. join ( target_filename) , FileType :: NativeLibrary ) ;
1711
1714
}
1712
1715
}
1713
1716
@@ -2011,7 +2014,11 @@ impl Step for Assemble {
2011
2014
extra_features : vec ! [ ] ,
2012
2015
} ) ;
2013
2016
let tool_exe = exe ( "llvm-bitcode-linker" , target_compiler. host ) ;
2014
- builder. copy_link ( & llvm_bitcode_linker. tool_path , & libdir_bin. join ( tool_exe) ) ;
2017
+ builder. copy_link (
2018
+ & llvm_bitcode_linker. tool_path ,
2019
+ & libdir_bin. join ( tool_exe) ,
2020
+ FileType :: Executable ,
2021
+ ) ;
2015
2022
}
2016
2023
} ;
2017
2024
@@ -2072,8 +2079,8 @@ impl Step for Assemble {
2072
2079
builder. sysroot_target_libdir ( target_compiler, target_compiler. host ) ;
2073
2080
let dst_lib = libdir. join ( & libenzyme) . with_extension ( lib_ext) ;
2074
2081
let target_dst_lib = target_libdir. join ( & libenzyme) . with_extension ( lib_ext) ;
2075
- builder. copy_link ( & src_lib, & dst_lib) ;
2076
- builder. copy_link ( & src_lib, & target_dst_lib) ;
2082
+ builder. copy_link ( & src_lib, & dst_lib, FileType :: NativeLibrary ) ;
2083
+ builder. copy_link ( & src_lib, & target_dst_lib, FileType :: NativeLibrary ) ;
2077
2084
}
2078
2085
2079
2086
// Build the libraries for this compiler to link to (i.e., the libraries
@@ -2168,7 +2175,7 @@ impl Step for Assemble {
2168
2175
} ;
2169
2176
2170
2177
if is_dylib_or_debug && can_be_rustc_dynamic_dep && !is_proc_macro {
2171
- builder. copy_link ( & f. path ( ) , & rustc_libdir. join ( & filename) ) ;
2178
+ builder. copy_link ( & f. path ( ) , & rustc_libdir. join ( & filename) , FileType :: Regular ) ;
2172
2179
}
2173
2180
}
2174
2181
@@ -2196,7 +2203,11 @@ impl Step for Assemble {
2196
2203
// See <https://github.com/rust-lang/rust/issues/132719>.
2197
2204
let src_exe = exe ( "llvm-objcopy" , target_compiler. host ) ;
2198
2205
let dst_exe = exe ( "rust-objcopy" , target_compiler. host ) ;
2199
- builder. copy_link ( & libdir_bin. join ( src_exe) , & libdir_bin. join ( dst_exe) ) ;
2206
+ builder. copy_link (
2207
+ & libdir_bin. join ( src_exe) ,
2208
+ & libdir_bin. join ( dst_exe) ,
2209
+ FileType :: Executable ,
2210
+ ) ;
2200
2211
}
2201
2212
2202
2213
// In addition to `rust-lld` also install `wasm-component-ld` when
@@ -2212,6 +2223,7 @@ impl Step for Assemble {
2212
2223
builder. copy_link (
2213
2224
& wasm_component. tool_path ,
2214
2225
& libdir_bin. join ( wasm_component. tool_path . file_name ( ) . unwrap ( ) ) ,
2226
+ FileType :: Executable ,
2215
2227
) ;
2216
2228
}
2217
2229
@@ -2234,7 +2246,7 @@ impl Step for Assemble {
2234
2246
t ! ( fs:: create_dir_all( bindir) ) ;
2235
2247
let compiler = builder. rustc ( target_compiler) ;
2236
2248
debug ! ( src = ?rustc, dst = ?compiler, "linking compiler binary itself" ) ;
2237
- builder. copy_link ( & rustc, & compiler) ;
2249
+ builder. copy_link ( & rustc, & compiler, FileType :: Executable ) ;
2238
2250
2239
2251
target_compiler
2240
2252
}
@@ -2260,7 +2272,7 @@ pub fn add_to_sysroot(
2260
2272
DependencyType :: Target => sysroot_dst,
2261
2273
DependencyType :: TargetSelfContained => self_contained_dst,
2262
2274
} ;
2263
- builder. copy_link ( & path, & dst. join ( path. file_name ( ) . unwrap ( ) ) ) ;
2275
+ builder. copy_link ( & path, & dst. join ( path. file_name ( ) . unwrap ( ) ) , FileType :: Regular ) ;
2264
2276
}
2265
2277
}
2266
2278
0 commit comments