summaryrefslogtreecommitdiffstats
path: root/debian/patches/behaviour
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches/behaviour')
-rw-r--r--debian/patches/behaviour/d-rust-gdb-paths.patch25
-rw-r--r--debian/patches/behaviour/d-rust-lldb-paths.patch29
-rw-r--r--debian/patches/behaviour/d-rustc-add-soname.patch44
-rw-r--r--debian/patches/behaviour/d-rustc-i686-baseline.patch56
-rw-r--r--debian/patches/behaviour/d-rustc-windows-ssp.patch22
-rw-r--r--debian/patches/behaviour/d-rustdoc-disable-embedded-fonts.patch43
6 files changed, 219 insertions, 0 deletions
diff --git a/debian/patches/behaviour/d-rust-gdb-paths.patch b/debian/patches/behaviour/d-rust-gdb-paths.patch
new file mode 100644
index 000000000..86d9c2d4d
--- /dev/null
+++ b/debian/patches/behaviour/d-rust-gdb-paths.patch
@@ -0,0 +1,25 @@
+From: Angus Lees <gus@debian.org>
+Date: Thu, 14 Jul 2022 13:17:39 +0200
+Subject: Hardcode GDB python module directory
+
+Debian package installs python modules into a fixed directory, so
+just hardcode path in wrapper script.
+
+Forwarded: not-needed
+---
+ src/etc/rust-gdbgui | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/etc/rust-gdbgui b/src/etc/rust-gdbgui
+index 471810c..be62b44 100755
+--- a/src/etc/rust-gdbgui
++++ b/src/etc/rust-gdbgui
+@@ -40,7 +40,7 @@ else
+ fi
+
+ # Find out where the pretty printer Python module is
+-RUSTC_SYSROOT="$("$RUSTC" --print=sysroot)"
++RUSTC_SYSROOT="$(if type "$RUSTC" >/dev/null 2>&1; then "$RUSTC" --print=sysroot; else echo /usr; fi)"
+ GDB_PYTHON_MODULE_DIRECTORY="$RUSTC_SYSROOT/lib/rustlib/etc"
+ # Get the commit hash for path remapping
+ RUSTC_COMMIT_HASH="$("$RUSTC" -vV | sed -n 's/commit-hash: \([a-zA-Z0-9_]*\)/\1/p')"
diff --git a/debian/patches/behaviour/d-rust-lldb-paths.patch b/debian/patches/behaviour/d-rust-lldb-paths.patch
new file mode 100644
index 000000000..6afe0cc19
--- /dev/null
+++ b/debian/patches/behaviour/d-rust-lldb-paths.patch
@@ -0,0 +1,29 @@
+From: Angus Lees <gus@debian.org>
+Date: Thu, 14 Jul 2022 13:17:39 +0200
+Subject: Hardcode LLDB python module directory
+
+Debian package installs python modules into a fixed directory, so
+just hardcode path in wrapper script.
+
+Forwarded: not-needed
+---
+ src/etc/rust-lldb | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/etc/rust-lldb b/src/etc/rust-lldb
+index bce72f1..38e76c2 100755
+--- a/src/etc/rust-lldb
++++ b/src/etc/rust-lldb
+@@ -7,10 +7,10 @@ set -e
+ host=$(rustc -vV | sed -n -e 's/^host: //p')
+
+ # Find out where to look for the pretty printer Python module
+-RUSTC_SYSROOT=$(rustc --print sysroot)
++RUSTC_SYSROOT="$(if type "$RUSTC" >/dev/null 2>&1; then "$RUSTC" --print=sysroot; else echo /usr; fi)"
+ RUST_LLDB="$RUSTC_SYSROOT/lib/rustlib/$host/bin/lldb"
+
+-lldb=lldb
++lldb=lldb-17
+ if [ -f "$RUST_LLDB" ]; then
+ lldb="$RUST_LLDB"
+ else
diff --git a/debian/patches/behaviour/d-rustc-add-soname.patch b/debian/patches/behaviour/d-rustc-add-soname.patch
new file mode 100644
index 000000000..91959bdc0
--- /dev/null
+++ b/debian/patches/behaviour/d-rustc-add-soname.patch
@@ -0,0 +1,44 @@
+From: Angus Lees <gus@debian.org>
+Date: Thu, 14 Jul 2022 13:17:39 +0200
+Subject: Set DT_SONAME when building dylibs
+
+In Rust, library filenames include a version-specific hash to help
+the run-time linker find the correct version. Unlike in C/C++, the
+compiler looks for all libraries matching a glob that ignores the
+hash and reads embedded metadata to work out versions, etc.
+
+The upshot is that there is no need for the usual "libfoo.so ->
+libfoo-1.2.3.so" symlink common with C/C++ when building with Rust,
+and no need to communicate an alternate filename to use at run-time
+vs compile time. If linking to a Rust dylib from C/C++ however, a
+"libfoo.so -> libfoo-$hash.so" symlink may well be useful and in
+this case DT_SONAME=libfoo-$hash.so would be required. More
+mundanely, various tools (eg: dpkg-shlibdeps) complain if they don't
+find DT_SONAME on shared libraries in public directories.
+
+This patch passes -Wl,-soname=$outfile when building dylibs (and
+using a GNU linker).
+
+Forwarded: no
+---
+ compiler/rustc_codegen_ssa/src/back/link.rs | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs
+index b0d22ad..9f824f4 100644
+--- a/compiler/rustc_codegen_ssa/src/back/link.rs
++++ b/compiler/rustc_codegen_ssa/src/back/link.rs
+@@ -2384,6 +2384,13 @@ fn add_order_independent_options(
+ }
+
+ add_rpath_args(cmd, sess, codegen_results, out_filename);
++
++ if (crate_type == config::CrateType::Dylib || crate_type == config::CrateType::Cdylib)
++ && sess.target.linker_flavor.is_gnu() {
++ let filename = String::from(out_filename.file_name().unwrap().to_str().unwrap());
++ let soname = [String::from("-Wl,-soname=") + &filename];
++ cmd.args(&soname);
++ }
+ }
+
+ // Write the NatVis debugger visualizer files for each crate to the temp directory and gather the file paths.
diff --git a/debian/patches/behaviour/d-rustc-i686-baseline.patch b/debian/patches/behaviour/d-rustc-i686-baseline.patch
new file mode 100644
index 000000000..0e40ad70b
--- /dev/null
+++ b/debian/patches/behaviour/d-rustc-i686-baseline.patch
@@ -0,0 +1,56 @@
+From: Debian Rust Maintainers <pkg-rust-maintainers@alioth-lists.debian.net>
+Date: Thu, 14 Jul 2022 13:17:39 +0200
+Subject: Change i686 to match Debian i386 baseline
+
+see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=973414 , might need to be
+adapted to reduce the baseline again
+
+Forwarded: not-needed
+
+===================================================================
+---
+ compiler/rustc_target/src/spec/targets/i686_unknown_linux_gnu.rs | 2 +-
+ tests/ui/abi/homogenous-floats-target-feature-mixup.rs | 3 ++-
+ tests/ui/sse2.rs | 2 +-
+ 3 files changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/compiler/rustc_target/src/spec/targets/i686_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/targets/i686_unknown_linux_gnu.rs
+index 3b7be48..4f01366 100644
+--- a/compiler/rustc_target/src/spec/targets/i686_unknown_linux_gnu.rs
++++ b/compiler/rustc_target/src/spec/targets/i686_unknown_linux_gnu.rs
+@@ -2,7 +2,7 @@ use crate::spec::{base, Cc, LinkerFlavor, Lld, SanitizerSet, StackProbeType, Tar
+
+ pub fn target() -> Target {
+ let mut base = base::linux_gnu::opts();
+- base.cpu = "pentium4".into();
++ base.cpu = "pentiumpro".into();
+ base.max_atomic_width = Some(64);
+ base.supported_sanitizers = SanitizerSet::ADDRESS;
+ base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-m32"]);
+diff --git a/tests/ui/abi/homogenous-floats-target-feature-mixup.rs b/tests/ui/abi/homogenous-floats-target-feature-mixup.rs
+index 4600bd0..e178964 100644
+--- a/tests/ui/abi/homogenous-floats-target-feature-mixup.rs
++++ b/tests/ui/abi/homogenous-floats-target-feature-mixup.rs
+@@ -24,7 +24,8 @@ fn main() {
+ match std::env::var("TARGET") {
+ Ok(s) => {
+ // Skip this tests on i586-unknown-linux-gnu where sse2 is disabled
+- if s.contains("i586") {
++ // Debian: our i686 doesn't have SSE 2..
++ if s.contains("i586") || s.contains("i686") {
+ return
+ }
+ }
+diff --git a/tests/ui/sse2.rs b/tests/ui/sse2.rs
+index 172f407..bf39939 100644
+--- a/tests/ui/sse2.rs
++++ b/tests/ui/sse2.rs
+@@ -15,7 +15,7 @@ fn main() {
+ }
+ Err(_) => return,
+ }
+- if cfg!(any(target_arch = "x86", target_arch = "x86_64")) {
++ if cfg!(any(target_arch = "x86_64")) {
+ assert!(cfg!(target_feature = "sse2"),
+ "SSE2 was not detected as available on an x86 platform");
+ }
diff --git a/debian/patches/behaviour/d-rustc-windows-ssp.patch b/debian/patches/behaviour/d-rustc-windows-ssp.patch
new file mode 100644
index 000000000..6cacf0ef1
--- /dev/null
+++ b/debian/patches/behaviour/d-rustc-windows-ssp.patch
@@ -0,0 +1,22 @@
+From: Debian Rust Maintainers <pkg-rust-maintainers@alioth-lists.debian.net>
+Date: Thu, 14 Jul 2022 13:17:39 +0200
+Subject: d-rustc-windows-ssp
+
+Bug: https://github.com/rust-lang/rust/issues/68973
+---
+ compiler/rustc_target/src/spec/base/windows_gnu.rs | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/compiler/rustc_target/src/spec/base/windows_gnu.rs b/compiler/rustc_target/src/spec/base/windows_gnu.rs
+index 25f02dc..402bb29 100644
+--- a/compiler/rustc_target/src/spec/base/windows_gnu.rs
++++ b/compiler/rustc_target/src/spec/base/windows_gnu.rs
+@@ -42,6 +42,8 @@ pub fn opts() -> TargetOptions {
+ "-lmsvcrt",
+ "-luser32",
+ "-lkernel32",
++ "-lssp_nonshared",
++ "-lssp",
+ ];
+ let mut late_link_args =
+ TargetOptions::link_args(LinkerFlavor::Gnu(Cc::No, Lld::No), mingw_libs);
diff --git a/debian/patches/behaviour/d-rustdoc-disable-embedded-fonts.patch b/debian/patches/behaviour/d-rustdoc-disable-embedded-fonts.patch
new file mode 100644
index 000000000..7f9a13289
--- /dev/null
+++ b/debian/patches/behaviour/d-rustdoc-disable-embedded-fonts.patch
@@ -0,0 +1,43 @@
+From: Debian Rust Maintainers <pkg-rust-maintainers@alioth-lists.debian.net>
+Date: Thu, 14 Jul 2022 13:17:39 +0200
+Subject: removed some embedded fonts
+
+Forwarded: not-needed
+===================================================================
+---
+ src/librustdoc/html/static/css/rustdoc.css | 8 --------
+ src/librustdoc/html/static_files.rs | 2 --
+ 2 files changed, 10 deletions(-)
+
+diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css
+index c4e97de..e9ea715 100644
+--- a/src/librustdoc/html/static/css/rustdoc.css
++++ b/src/librustdoc/html/static/css/rustdoc.css
+@@ -86,14 +86,6 @@
+ font-display: swap;
+ }
+
+-/* Avoid using legacy CJK serif fonts in Windows like Batang. */
+-@font-face {
+- font-family: 'NanumBarunGothic';
+- src: url("NanumBarunGothic-0f09457c7a19b7c6.ttf.woff2") format("woff2");
+- font-display: swap;
+- unicode-range: U+AC00-D7AF, U+1100-11FF, U+3130-318F, U+A960-A97F, U+D7B0-D7FF;
+-}
+-
+ * {
+ box-sizing: border-box;
+ }
+diff --git a/src/librustdoc/html/static_files.rs b/src/librustdoc/html/static_files.rs
+index ca9a78f..2fd45fb 100644
+--- a/src/librustdoc/html/static_files.rs
++++ b/src/librustdoc/html/static_files.rs
+@@ -119,8 +119,6 @@ static_files! {
+ source_code_pro_semibold => "static/fonts/SourceCodePro-Semibold.ttf.woff2",
+ source_code_pro_italic => "static/fonts/SourceCodePro-It.ttf.woff2",
+ source_code_pro_license => "static/fonts/SourceCodePro-LICENSE.txt",
+- nanum_barun_gothic_regular => "static/fonts/NanumBarunGothic.ttf.woff2",
+- nanum_barun_gothic_license => "static/fonts/NanumBarunGothic-LICENSE.txt",
+ }
+
+ pub(crate) static SCRAPE_EXAMPLES_HELP_MD: &str = include_str!("static/scrape-examples-help.md");