mirror of
https://git.proxmox.com/git/rustc
synced 2026-01-23 15:13:17 +00:00
Update build-preview-dsc for more nightly changes
This commit is contained in:
parent
7135a866b1
commit
372c3f8f04
3
debian/build-preview-dsc.sh
vendored
3
debian/build-preview-dsc.sh
vendored
@ -33,8 +33,9 @@ case "$1" in
|
||||
dquilt delete backport-test-fixes-arm-03.patch
|
||||
case "$1" in
|
||||
"1.12.0-nightly")
|
||||
mv debian/patches/dynamic-link-llvm_1.12.patch debian/patches/dynamic-link-llvm.patch
|
||||
dquilt delete avoid-redundant-dls.diff
|
||||
mv debian/patches/ignore-failing-armhf-tests_04_1.12.patch debian/patches/ignore-failing-armhf-tests_04.patch
|
||||
dquilt delete ignore-failing-armhf-tests_04.patch
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
|
||||
113
debian/patches/dynamic-link-llvm_1.12.patch
vendored
Normal file
113
debian/patches/dynamic-link-llvm_1.12.patch
vendored
Normal file
@ -0,0 +1,113 @@
|
||||
Description: Dynamically link with Debian's LLVM
|
||||
Hard-code -lLLVM, instead of using llvm-config to figure out which components
|
||||
to link in. The latter doesn't work properly anyway for dynamic linking - see
|
||||
LLVM bug #3201. If/when this is fixed, then Rust upstream will probably fix
|
||||
their code to allow for this, and after that happens we can rm this patch.
|
||||
.
|
||||
TODO: not sure if we need extra tweaks for cross-compiling
|
||||
Author: Ximin Luo <infinity0@debian.org>
|
||||
Forwarded: not-needed
|
||||
---
|
||||
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
|
||||
--- a/src/librustc_llvm/build.rs
|
||||
+++ b/src/librustc_llvm/build.rs
|
||||
@@ -120,50 +120,10 @@
|
||||
.cpp_link_stdlib(None) // we handle this below
|
||||
.compile("librustllvm.a");
|
||||
|
||||
- // Link in all LLVM libraries, if we're uwring the "wrong" llvm-config then
|
||||
- // we don't pick up system libs because unfortunately they're for the host
|
||||
- // of llvm-config, not the target that we're attempting to link.
|
||||
- let mut cmd = Command::new(&llvm_config);
|
||||
- cmd.arg("--libs");
|
||||
- if !is_crossed {
|
||||
- cmd.arg("--system-libs");
|
||||
- }
|
||||
- cmd.args(&components[..]);
|
||||
-
|
||||
- for lib in output(&mut cmd).split_whitespace() {
|
||||
- let name = if lib.starts_with("-l") {
|
||||
- &lib[2..]
|
||||
- } else if lib.starts_with("-") {
|
||||
- &lib[1..]
|
||||
- } else if Path::new(lib).exists() {
|
||||
- // On MSVC llvm-config will print the full name to libraries, but
|
||||
- // we're only interested in the name part
|
||||
- let name = Path::new(lib).file_name().unwrap().to_str().unwrap();
|
||||
- name.trim_right_matches(".lib")
|
||||
- } else if lib.ends_with(".lib") {
|
||||
- // Some MSVC libraries just come up with `.lib` tacked on, so chop
|
||||
- // that off
|
||||
- lib.trim_right_matches(".lib")
|
||||
- } else {
|
||||
- continue
|
||||
- };
|
||||
-
|
||||
- // Don't need or want this library, but LLVM's CMake build system
|
||||
- // doesn't provide a way to disable it, so filter it here even though we
|
||||
- // may or may not have built it. We don't reference anything from this
|
||||
- // library and it otherwise may just pull in extra dependencies on
|
||||
- // libedit which we don't want
|
||||
- if name == "LLVMLineEditor" {
|
||||
- continue
|
||||
- }
|
||||
-
|
||||
- let kind = if name.starts_with("LLVM") {
|
||||
- "static"
|
||||
- } else {
|
||||
- "dylib"
|
||||
- };
|
||||
- println!("cargo:rustc-link-lib={}={}", kind, name);
|
||||
- }
|
||||
+ // Link in all LLVM libraries
|
||||
+ // Link in Debian full LLVM shared library.
|
||||
+ // TODO: not sure what to do in the cross-compiling case.
|
||||
+ println!("cargo:rustc-link-lib={}={}", "dylib", "LLVM-3.8");
|
||||
|
||||
// LLVM ldflags
|
||||
//
|
||||
--- a/src/etc/mklldeps.py
|
||||
+++ b/src/etc/mklldeps.py
|
||||
@@ -56,38 +56,12 @@
|
||||
|
||||
f.write("\n")
|
||||
|
||||
-args = [llvm_config, '--shared-mode']
|
||||
-args.extend(components)
|
||||
-llvm_shared, out = runErr(args)
|
||||
-if llvm_shared:
|
||||
- llvm_shared = 'shared' in out
|
||||
+llvm_shared = True
|
||||
|
||||
# LLVM libs
|
||||
-args = [llvm_config, '--libs', '--system-libs']
|
||||
-args.extend(components)
|
||||
-out = run(args)
|
||||
-for lib in out.strip().replace("\n", ' ').split(' '):
|
||||
- if len(lib) == 0:
|
||||
- continue
|
||||
- # in some cases we get extra spaces in between libs so ignore those
|
||||
- if len(lib) == 1 and lib == ' ':
|
||||
- continue
|
||||
- # not all libs strictly follow -lfoo, on Bitrig, there is -pthread
|
||||
- if lib[0:2] == '-l':
|
||||
- lib = lib.strip()[2:]
|
||||
- elif lib[0] == '-':
|
||||
- lib = lib.strip()[1:]
|
||||
- # If this actually points at a literal file then we're on MSVC which now
|
||||
- # prints full paths, so get just the name of the library and strip off the
|
||||
- # trailing ".lib"
|
||||
- elif os.path.exists(lib):
|
||||
- lib = os.path.basename(lib)[:-4]
|
||||
- elif lib[-4:] == '.lib':
|
||||
- lib = lib[:-4]
|
||||
- f.write("#[link(name = \"" + lib + "\"")
|
||||
- if not llvm_shared and 'LLVM' in lib:
|
||||
- f.write(", kind = \"static\"")
|
||||
- f.write(")]\n")
|
||||
+# Link in Debian full LLVM shared library.
|
||||
+# TODO: not sure what to do in the cross-compiling case.
|
||||
+f.write("#[link(name = \"LLVM-3.8\")]\n")
|
||||
|
||||
# LLVM ldflags
|
||||
out = run([llvm_config, '--ldflags'])
|
||||
Loading…
Reference in New Issue
Block a user