]> git.proxmox.com Git - debcargo-conf.git/commitdiff
rustix - fix build on i386
authorPeter Michael Green <plugwash@debian.org>
Sat, 29 Oct 2022 08:22:09 +0000 (08:22 +0000)
committerPeter Michael Green <plugwash@debian.org>
Sat, 29 Oct 2022 10:53:09 +0000 (10:53 +0000)
src/rustix/debian/changelog
src/rustix/debian/patches/always-enable-cc.diff [new file with mode: 0644]
src/rustix/debian/patches/built-using.diff [new file with mode: 0644]
src/rustix/debian/patches/series

index 91d5d0bf0832a472edd4a554bf49f91fb840e1d3..f8d881e8ccdf6fff84c928b840205584bc8283b3 100644 (file)
@@ -2,8 +2,12 @@ rust-rustix (0.35.12-1) UNRELEASED-FIXME-AUTOGENERATED-DEBCARGO; urgency=medium
 
   * Team upload.
   * Package rustix 0.35.12 from crates.io using debcargo 2.5.0
+  * Enable cc unconditionally, some Debian architectures requires "outline"
+    assembler and the Debian package does not ship pre-assembled outline
+    assembler
+  * Add built-using metadata for outline assembler.
 
- -- Peter Michael Green <plugwash@debian.org>  Sat, 29 Oct 2022 07:06:58 +0000
+ -- Peter Michael Green <plugwash@debian.org>  Sat, 29 Oct 2022 07:23:47 +0000
 
 rust-rustix (0.35.6-3) unstable; urgency=medium
 
diff --git a/src/rustix/debian/patches/always-enable-cc.diff b/src/rustix/debian/patches/always-enable-cc.diff
new file mode 100644 (file)
index 0000000..cfb3437
--- /dev/null
@@ -0,0 +1,60 @@
+Always enable cc even if the feature is not enabled.
+
+Some Debian architectures need outline asm, and Debian does not ship pre-built
+outline asm.
+
+Index: rust-rustix-0.35.12/Cargo.toml
+===================================================================
+--- rust-rustix-0.35.12.orig/Cargo.toml
++++ rust-rustix-0.35.12/Cargo.toml
+@@ -106,9 +106,9 @@ version = "0.6"
+ [dev-dependencies.tempfile]
+ version = "3.2.0"
+-[build-dependencies.cc]
++[build-dependencies.cc_dep]
+ version = "1.0.68"
+-optional = true
++package = "cc"
+ [features]
+ all-apis = [
+@@ -169,6 +169,7 @@ use-libc = [
+     "libc",
+ ]
+ use-libc-auxv = ["libc"]
++cc = []
+ [target."cfg(all(any(target_os = \"android\", target_os = \"linux\"), any(rustix_use_libc, miri, not(all(target_os = \"linux\", any(target_arch = \"x86\", all(target_arch = \"x86_64\", target_pointer_width = \"64\"), all(target_endian = \"little\", any(target_arch = \"arm\", all(target_arch = \"aarch64\", target_pointer_width = \"64\"), target_arch = \"powerpc64\", target_arch = \"riscv64\", target_arch = \"mips\", target_arch = \"mips64\"))))))))".dependencies.linux-raw-sys]
+ version = "0.0.46"
+Index: rust-rustix-0.35.12/build.rs
+===================================================================
+--- rust-rustix-0.35.12.orig/build.rs
++++ rust-rustix-0.35.12/build.rs
+@@ -1,5 +1,4 @@
+-#[cfg(feature = "cc")]
+-use cc::Build;
++use cc_dep::Build;
+ use std::env::var;
+ use std::io::Write;
+@@ -118,16 +117,16 @@ fn link_in_librustix_outline(arch: &str,
+     println!("cargo:rerun-if-changed={}", to);
+     // If "cc" is not enabled, use a pre-built library.
+-    #[cfg(not(feature = "cc"))]
++    /*#[cfg(not(feature = "cc"))]
+     {
+         let _ = asm_name;
+         println!("cargo:rustc-link-search={}/{}", OUTLINE_PATH, profile);
+         println!("cargo:rustc-link-lib=static={}", name);
+-    }
++    }*/
+     // If "cc" is enabled, build the library from source, update the pre-built
+     // version, and assert that the pre-built version is checked in.
+-    #[cfg(feature = "cc")]
++    //#[cfg(feature = "cc")]
+     {
+         let out_dir = var("OUT_DIR").unwrap();
+         Build::new().file(&asm_name).compile(&name);
diff --git a/src/rustix/debian/patches/built-using.diff b/src/rustix/debian/patches/built-using.diff
new file mode 100644 (file)
index 0000000..6c2ef77
--- /dev/null
@@ -0,0 +1,12 @@
+Index: rust-rustix-0.35.12/build.rs
+===================================================================
+--- rust-rustix-0.35.12.orig/build.rs
++++ rust-rustix-0.35.12/build.rs
+@@ -153,6 +153,7 @@ fn link_in_librustix_outline(arch: &str,
+             );
+         }
+     }
++    println!("dh-cargo:deb-built-using={}=0={}", name, var("CARGO_MANIFEST_DIR").unwrap());
+ }
+ fn use_thumb_mode() -> bool {
index 096275b3d33e122d91a0ab549e2ee952499e5fb9..957b5e6345cd7c90294bd5579d76c2911557859d 100644 (file)
@@ -1,3 +1,5 @@
 no-windows.diff
 drop-deps.diff
 drop-alloc.diff
+always-enable-cc.diff
+built-using.diff