Skip to content

Commit 4f41bae

Browse files
committed
Print rustc-link-search for the in-tree static openblas before everything else
Fixes #60. The gnu linker searches libraries in the order of -L options and stops the search when the first matching library is found. This means if libopenblas.a is either in deliv.make_conf.c_extra_libs.search_path or in deliv.make_conf.f_extra_libs.search_path, the in-tree libopenblas.a won't be used. This patch fixes the issue by printing the rustc-link-search instruction for the in-tree openblas before everything else.
1 parent 87c6477 commit 4f41bae

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

openblas-src/build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ fn build() {
149149
let source = PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("source");
150150
let deliv = cfg.build(&source, &output).unwrap();
151151

152+
println!("cargo:rustc-link-search={}", output.display());
152153
for search_path in &deliv.make_conf.c_extra_libs.search_paths {
153154
println!("cargo:rustc-link-search={}", search_path.display());
154155
}
@@ -161,7 +162,6 @@ fn build() {
161162
for lib in &deliv.make_conf.f_extra_libs.libs {
162163
println!("cargo:rustc-link-lib={}", lib);
163164
}
164-
println!("cargo:rustc-link-search={}", output.display());
165165
}
166166

167167
/// openblas-src 0.9.0 compatible `make` runner

0 commit comments

Comments
 (0)