forked from NetBSD/pkgsrc
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rust: add some kludges to better support NetBSD HEAD-llvm
1) bootstrap rustc adds -lgcc_s when linking -> Dropped with a BUILDLINK_TRANSFORM 2) bootstrap rustc has shared linkage to libgcc_s.so.1 -> Until upstream changes this to static linkage, we look for libgcc_s.so.1 in ${FILESDIR} where the user must place it manually. 3) newly built rustc adds -lstdc++ instead of -lc++ when linking llvm -> fixed with patch-src_librustc__llvm_build.rs 4) newly built rustc adds -lgcc_s when linking -> fixed with patch-src_libunwind_build.rs
- Loading branch information
Showing
4 changed files
with
56 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
$NetBSD: patch-src_librustc__llvm_build.rs,v 1.1 2019/01/05 23:29:40 tnn Exp $ | ||
|
||
fix build on NetBSD HEAD-llvm. XXX there is probably a better way to do this. | ||
|
||
--- src/librustc_llvm/build.rs.orig 2018-12-18 23:11:17.000000000 +0000 | ||
+++ src/librustc_llvm/build.rs | ||
@@ -250,9 +250,17 @@ fn main() { | ||
"c++" | ||
} else if target.contains("netbsd") && llvm_static_stdcpp.is_some() { | ||
// NetBSD uses a separate library when relocation is required | ||
- "stdc++_pic" | ||
+ if env::var_os("PKGSRC_HAVE_LIBCPP").is_some() { | ||
+ "c++_pic" | ||
+ } else { | ||
+ "stdc++_pic" | ||
+ } | ||
} else { | ||
- "stdc++" | ||
+ if env::var_os("PKGSRC_HAVE_LIBCPP").is_some() { | ||
+ "c++" | ||
+ } else { | ||
+ "stdc++" | ||
+ } | ||
}; | ||
|
||
// C++ runtime library |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
$NetBSD: patch-src_libunwind_build.rs,v 1.1 2019/01/05 23:29:40 tnn Exp $ | ||
|
||
fix build on NetBSD HEAD-llvm. XXX there is probably a better way to do this. | ||
|
||
--- src/libunwind/build.rs.orig 2018-12-18 23:11:17.000000000 +0000 | ||
+++ src/libunwind/build.rs | ||
@@ -25,7 +25,9 @@ fn main() { | ||
} else if target.contains("rumprun") { | ||
println!("cargo:rustc-link-lib=unwind"); | ||
} else if target.contains("netbsd") { | ||
- println!("cargo:rustc-link-lib=gcc_s"); | ||
+ if !env::var_os("PKGSRC_HAVE_LIBCPP").is_some() { | ||
+ println!("cargo:rustc-link-lib=gcc_s"); | ||
+ } | ||
} else if target.contains("openbsd") { | ||
println!("cargo:rustc-link-lib=c++abi"); | ||
} else if target.contains("solaris") { |