fix build archive/raspbian/128.11.0esr-1+rpi1 raspbian/128.11.0esr-1+rpi1
authorPeter Michael Green <plugwash@raspbian.org>
Thu, 26 Jun 2025 16:45:55 +0000 (16:45 +0000)
committerPeter Michael Green <plugwash@raspbian.org>
Thu, 26 Jun 2025 16:55:22 +0000 (16:55 +0000)
build/moz.configure/rust.configure
debian/changelog
debian/patches/disable-jit.patch
debian/patches/raspbian-rust-triplet-hack.patch
debian/patches/series
debian/patches/workaround-bx-inline-asm-bug.patch [new file with mode: 0644]
js/src/jit/shared/AtomicOperations-shared-jit.cpp
third_party/rust/crash-context/.cargo-checksum.json
third_party/rust/crash-context/src/linux/getcontext/arm.rs

index 349c8045e99940d0f5a48831d51a5298138c8c75..93a2157db518811f8a2096eab8841806bfc55095 100644 (file)
@@ -262,10 +262,10 @@ def rust_compiler(rustc_info, cargo_info, target):
 @imports(_from="__builtin__", _import='repr')
 @imports(_from="__builtin__", _import="ValueError")
 def rust_supported_targets(rustc):
-    #HACK: if there are multiple matches the algorithm uses the last one
+    #OLD HACK, NOW DISABLED: if there are multiple matches the algorithm uses the last one
     #put arm-unknown-linux-gnuebihf on the end of the list so it gets preffered
     out = check_cmd_output(rustc, "--print", "target-list").splitlines()
-    out.append("arm-unknown-linux-gnueabihf")
+    #out.append("arm-unknown-linux-gnueabihf")
     data = {}
     for t in out:
         try:
@@ -302,6 +302,9 @@ def detect_rustc_target(
     )
 
     def find_candidate(candidates):
+        #for candidate in candidates:
+        #    log.info(candidate.rust_target)
+        #die("fuck")
         if len(candidates) == 1:
             return candidates[0].rust_target
         elif not candidates:
@@ -364,6 +367,7 @@ def detect_rustc_target(
                     prefixes.append("arm")
             if arm_target.arm_arch >= 4:
                 prefixes.append("armv4t")
+            prefixes = ["arm"] # force use of arm- target type for raspbian.
             # rust freebsd targets are the only ones that don't have a 'hf' suffix
             # for hard-float. Technically, that means if the float abi ever is not
             # hard-float, this will pick a wrong target, but since rust only
index 16f168348196b389fd8d1346d2d5ca4a7b9e5568..a111682f0672910b9c7e5ae1ba06f9ffcfed3a2d 100644 (file)
@@ -31,6 +31,10 @@ firefox-esr (128.11.0esr-1+rpi1) trixie-staging; urgency=medium
   [changes introduced in 115.3.0esr-1+rpi1 by Peter Michael Green]
   * Disable conflicting include in js/src/jit/shared/AtomicOperations-shared-jit.cpp
 
+  [changes introduced in 128.11.0esr-1+rpi1 by Peter Michael Green]
+  * Update rust target hack to accomodate changes in upstream target selection.
+  * Workaround asm bug with bx lr (see: https://github.com/EmbarkStudios/crash-handling/issues/5)
+
  -- Peter Michael Green <plugwash@raspbian.org>  Thu, 19 Jun 2025 10:13:44 +0000
 
 firefox-esr (128.11.0esr-1) unstable; urgency=medium
index 32cb818e473d2f41e44f48f2448d91753179f871..0591aefafd93352855df37d14d480c6921ec2366 100644 (file)
@@ -4,10 +4,10 @@ Subject: Disable jit.
 
 ---
 
-diff --git a/js/moz.configure b/js/moz.configure
-index 593b93aceee..16f97c78b24 100644
---- a/js/moz.configure
-+++ b/js/moz.configure
+Index: firefox-esr-128.11.0esr/js/moz.configure
+===================================================================
+--- firefox-esr-128.11.0esr.orig/js/moz.configure
++++ firefox-esr-128.11.0esr/js/moz.configure
 @@ -251,22 +251,22 @@ def jit_default(
      enable_portable_baseline_interp,
      enable_explicit_resource_management,
@@ -47,3 +47,17 @@ index 593b93aceee..16f97c78b24 100644
      return False
  
  
+Index: firefox-esr-128.11.0esr/js/src/jit/shared/AtomicOperations-shared-jit.cpp
+===================================================================
+--- firefox-esr-128.11.0esr.orig/js/src/jit/shared/AtomicOperations-shared-jit.cpp
++++ firefox-esr-128.11.0esr/js/src/jit/shared/AtomicOperations-shared-jit.cpp
+@@ -55,7 +55,8 @@ static bool UnalignedAccessesAreOK() {
+ #  if defined(__x86_64__) || defined(__i386__)
+   return true;
+ #  elif defined(__arm__)
+-  return !HasAlignmentFault();
++  //return !HasAlignmentFault();
++  return false;
+ #  elif defined(__aarch64__)
+   // This is not necessarily true but it's the best guess right now.
+   return true;
index 83a2fe99facfe185d36b5f9e58c95f8aef8dc3ff..3265a42ba0a616886720cedb35c322974ca9a1ea 100644 (file)
@@ -1,10 +1,10 @@
 Description:  Hack broken rust target selection so it produces the right target on raspbian.
 Author: Peter Michael Green <plugwash@raspbian.org>
-diff --git a/build/moz.configure/rust.configure b/build/moz.configure/rust.configure
-index 40f017da67..07308cb6cd 100644
---- a/build/moz.configure/rust.configure
-+++ b/build/moz.configure/rust.configure
-@@ -236,9 +236,14 @@ def rust_compiler(rustc_info, cargo_info):
+Index: firefox-esr-128.11.0esr/build/moz.configure/rust.configure
+===================================================================
+--- firefox-esr-128.11.0esr.orig/build/moz.configure/rust.configure
++++ firefox-esr-128.11.0esr/build/moz.configure/rust.configure
+@@ -258,9 +258,14 @@ def rust_compiler(rustc_info, cargo_info
  
  
  @depends(rustc, when=rust_compiler)
@@ -12,10 +12,28 @@ index 40f017da67..07308cb6cd 100644
 +@imports(_from="__builtin__", _import='repr')
  @imports(_from="__builtin__", _import="ValueError")
  def rust_supported_targets(rustc):
-+    #HACK: if there are multiple matches the algorithm uses the last one
++    #OLD HACK, NOW DISABLED: if there are multiple matches the algorithm uses the last one
 +    #put arm-unknown-linux-gnuebihf on the end of the list so it gets preffered
      out = check_cmd_output(rustc, "--print", "target-list").splitlines()
-+    out.append("arm-unknown-linux-gnueabihf")
++    #out.append("arm-unknown-linux-gnueabihf")
      data = {}
      for t in out:
          try:
+@@ -297,6 +302,9 @@ def detect_rustc_target(
+     )
+     def find_candidate(candidates):
++        #for candidate in candidates:
++        #    log.info(candidate.rust_target)
++        #die("fuck")
+         if len(candidates) == 1:
+             return candidates[0].rust_target
+         elif not candidates:
+@@ -359,6 +367,7 @@ def detect_rustc_target(
+                     prefixes.append("arm")
+             if arm_target.arm_arch >= 4:
+                 prefixes.append("armv4t")
++            prefixes = ["arm"] # force use of arm- target type for raspbian.
+             # rust freebsd targets are the only ones that don't have a 'hf' suffix
+             # for hard-float. Technically, that means if the float abi ever is not
+             # hard-float, this will pick a wrong target, but since rust only
index 4c4f000ba7153ce5747814a2145a34fd37de6f73..e9e3bae1f053330d91ccf3228194464e1f17465f 100644 (file)
@@ -26,3 +26,4 @@ use-a-define-instead-of-a-typedef-for-do.patch
 disable-more-armv7neon-stuff.patch
 disable-jit.patch
 disable-conflicting-include.patch
+workaround-bx-inline-asm-bug.patch
diff --git a/debian/patches/workaround-bx-inline-asm-bug.patch b/debian/patches/workaround-bx-inline-asm-bug.patch
new file mode 100644 (file)
index 0000000..f663d45
--- /dev/null
@@ -0,0 +1,28 @@
+commit 7859a226719f80161ac69d40ad99d30c81c18ba2
+Author: Jake Shadle <jake.shadle@embark-studios.com>
+Date:   Thu Jul 25 10:10:33 2024 +0200
+
+    Fix arm, again
+
+Index: firefox-esr-128.11.0esr/third_party/rust/crash-context/src/linux/getcontext/arm.rs
+===================================================================
+--- firefox-esr-128.11.0esr.orig/third_party/rust/crash-context/src/linux/getcontext/arm.rs
++++ firefox-esr-128.11.0esr/third_party/rust/crash-context/src/linux/getcontext/arm.rs
+@@ -46,7 +46,7 @@ std::arch::global_asm! {
+     // Return 0
+     "mov   r0, #0",
+-    "bx    lr",
++    "mov   pc, lr",
+     ".fnend",
+     ".size crash_context_getcontext, . - crash_context_getcontext",
+Index: firefox-esr-128.11.0esr/third_party/rust/crash-context/.cargo-checksum.json
+===================================================================
+--- firefox-esr-128.11.0esr.orig/third_party/rust/crash-context/.cargo-checksum.json
++++ firefox-esr-128.11.0esr/third_party/rust/crash-context/.cargo-checksum.json
+@@ -1 +1 @@
+-{"files":{"CHANGELOG.md":"843168dabb93f6bc42076d4924040cd8c8a268f03cb02856b55691b5e9a873e1","Cargo.toml":"94c36b790e888c511e093c2b20ade75157daa86fad994d508d071bd4c049223a","LICENSE-APACHE":"8173d5c29b4f956d532781d2b86e4e30f83e6b7878dce18c919451d6ba707c90","LICENSE-MIT":"090a294a492ab2f41388252312a65cf2f0e423330b721a68c6665ac64766753b","README.md":"f91ee04dfaa356214af7ac68e4cfa1d6c8674f7fea08d65275f3fafde28301df","release.toml":"287ba3b6c89e3b289eae59827d36d6eb6e27b88cc2ada2c0d9a663c8b487117e","src/lib.rs":"26957a6a2555ab82aa9b6d3d1f24efaf20753d6c5eb1510395789283890ac1d1","src/linux.rs":"cf05c1217709a60adeea08e8623438f68a18dea66758b194de0e07ff398b090d","src/linux/getcontext.rs":"4164236732556d71cbb9e04bf4f2b41fd6f51f9bb94dfb974158cc5f49c3c789","src/linux/getcontext/aarch64.rs":"1193e68f06f7f2f4d3e64d80a196804e6cdfd03643ac50332c7af10928a5eccb","src/linux/getcontext/arm.rs":"682f163f4a96c21930e37427a6d687efc68199cbd8a9125b34d99a81280dd31b","src/linux/getcontext/x86.rs":"7c585ec44835910f99801cbb3ac34153e8d687b5dcbc682f9b7768873655c4a0","src/linux/getcontext/x86_64.rs":"db63a1c05e2c7c5b998f3c57b399972fc4e756eb36bcd119a99419c94470444a","src/mac.rs":"13d25443466d387eabf28adae361708f4b6297949c7eeb5bf1b38cb0ca13a418","src/mac/guard.rs":"115d1e8d5ac7bd9ecc666b11a0c584ed1e997160aacb0a1cc0f215ff5a1e9803","src/mac/ipc.rs":"2fc139ee5b70964bd726a30853d7fe9f74f7a6e0f8cf3d150e72a2ac802c1fba","src/mac/resource.rs":"8289db9294a45d6148329d537530512913c456a182783059a832767e39c67295","src/windows.rs":"c6c043cf56cf0840cc1373edc4bd39cf829566d181e50589174745629ab2ad37","tests/capture_context.rs":"899e94c522cd015fd1f45230aff5c8970346ba20623da46cd34da892bbd07f7e"},"package":"b85cef661eeca0c6675116310936972c520ebb0a33ddef16fd7efc957f4c1288"}
+\ No newline at end of file
++{"files":{"CHANGELOG.md":"843168dabb93f6bc42076d4924040cd8c8a268f03cb02856b55691b5e9a873e1","Cargo.toml":"94c36b790e888c511e093c2b20ade75157daa86fad994d508d071bd4c049223a","LICENSE-APACHE":"8173d5c29b4f956d532781d2b86e4e30f83e6b7878dce18c919451d6ba707c90","LICENSE-MIT":"090a294a492ab2f41388252312a65cf2f0e423330b721a68c6665ac64766753b","README.md":"f91ee04dfaa356214af7ac68e4cfa1d6c8674f7fea08d65275f3fafde28301df","release.toml":"287ba3b6c89e3b289eae59827d36d6eb6e27b88cc2ada2c0d9a663c8b487117e","src/lib.rs":"26957a6a2555ab82aa9b6d3d1f24efaf20753d6c5eb1510395789283890ac1d1","src/linux.rs":"cf05c1217709a60adeea08e8623438f68a18dea66758b194de0e07ff398b090d","src/linux/getcontext.rs":"4164236732556d71cbb9e04bf4f2b41fd6f51f9bb94dfb974158cc5f49c3c789","src/linux/getcontext/aarch64.rs":"1193e68f06f7f2f4d3e64d80a196804e6cdfd03643ac50332c7af10928a5eccb","src/linux/getcontext/arm.rs":"d7f4b94acabfbbd332d3d56975d4bbd4302abfc8f5da1ca15d8d954bdc9fc785","src/linux/getcontext/x86.rs":"7c585ec44835910f99801cbb3ac34153e8d687b5dcbc682f9b7768873655c4a0","src/linux/getcontext/x86_64.rs":"db63a1c05e2c7c5b998f3c57b399972fc4e756eb36bcd119a99419c94470444a","src/mac.rs":"13d25443466d387eabf28adae361708f4b6297949c7eeb5bf1b38cb0ca13a418","src/mac/guard.rs":"115d1e8d5ac7bd9ecc666b11a0c584ed1e997160aacb0a1cc0f215ff5a1e9803","src/mac/ipc.rs":"2fc139ee5b70964bd726a30853d7fe9f74f7a6e0f8cf3d150e72a2ac802c1fba","src/mac/resource.rs":"8289db9294a45d6148329d537530512913c456a182783059a832767e39c67295","src/windows.rs":"c6c043cf56cf0840cc1373edc4bd39cf829566d181e50589174745629ab2ad37","tests/capture_context.rs":"899e94c522cd015fd1f45230aff5c8970346ba20623da46cd34da892bbd07f7e"},"package":"b85cef661eeca0c6675116310936972c520ebb0a33ddef16fd7efc957f4c1288"}
+\ No newline at end of file
index d580387efdc011003215bf0447fdf6764bdfbd6b..02a5d3f003e497a7dfaa534633c5b3df7e587745 100644 (file)
@@ -55,7 +55,8 @@ static bool UnalignedAccessesAreOK() {
 #  if defined(__x86_64__) || defined(__i386__)
   return true;
 #  elif defined(__arm__)
-  return !HasAlignmentFault();
+  //return !HasAlignmentFault();
+  return false;
 #  elif defined(__aarch64__)
   // This is not necessarily true but it's the best guess right now.
   return true;
index 6c15e8c3c061860495f0e9c5cd0c0dd7a735d7a2..86dc375bdb44110c6a430eda72ff1840d9d9294e 100644 (file)
@@ -1 +1 @@
-{"files":{"CHANGELOG.md":"843168dabb93f6bc42076d4924040cd8c8a268f03cb02856b55691b5e9a873e1","Cargo.toml":"94c36b790e888c511e093c2b20ade75157daa86fad994d508d071bd4c049223a","LICENSE-APACHE":"8173d5c29b4f956d532781d2b86e4e30f83e6b7878dce18c919451d6ba707c90","LICENSE-MIT":"090a294a492ab2f41388252312a65cf2f0e423330b721a68c6665ac64766753b","README.md":"f91ee04dfaa356214af7ac68e4cfa1d6c8674f7fea08d65275f3fafde28301df","release.toml":"287ba3b6c89e3b289eae59827d36d6eb6e27b88cc2ada2c0d9a663c8b487117e","src/lib.rs":"26957a6a2555ab82aa9b6d3d1f24efaf20753d6c5eb1510395789283890ac1d1","src/linux.rs":"cf05c1217709a60adeea08e8623438f68a18dea66758b194de0e07ff398b090d","src/linux/getcontext.rs":"4164236732556d71cbb9e04bf4f2b41fd6f51f9bb94dfb974158cc5f49c3c789","src/linux/getcontext/aarch64.rs":"1193e68f06f7f2f4d3e64d80a196804e6cdfd03643ac50332c7af10928a5eccb","src/linux/getcontext/arm.rs":"682f163f4a96c21930e37427a6d687efc68199cbd8a9125b34d99a81280dd31b","src/linux/getcontext/x86.rs":"7c585ec44835910f99801cbb3ac34153e8d687b5dcbc682f9b7768873655c4a0","src/linux/getcontext/x86_64.rs":"db63a1c05e2c7c5b998f3c57b399972fc4e756eb36bcd119a99419c94470444a","src/mac.rs":"13d25443466d387eabf28adae361708f4b6297949c7eeb5bf1b38cb0ca13a418","src/mac/guard.rs":"115d1e8d5ac7bd9ecc666b11a0c584ed1e997160aacb0a1cc0f215ff5a1e9803","src/mac/ipc.rs":"2fc139ee5b70964bd726a30853d7fe9f74f7a6e0f8cf3d150e72a2ac802c1fba","src/mac/resource.rs":"8289db9294a45d6148329d537530512913c456a182783059a832767e39c67295","src/windows.rs":"c6c043cf56cf0840cc1373edc4bd39cf829566d181e50589174745629ab2ad37","tests/capture_context.rs":"899e94c522cd015fd1f45230aff5c8970346ba20623da46cd34da892bbd07f7e"},"package":"b85cef661eeca0c6675116310936972c520ebb0a33ddef16fd7efc957f4c1288"}
\ No newline at end of file
+{"files":{"CHANGELOG.md":"843168dabb93f6bc42076d4924040cd8c8a268f03cb02856b55691b5e9a873e1","Cargo.toml":"94c36b790e888c511e093c2b20ade75157daa86fad994d508d071bd4c049223a","LICENSE-APACHE":"8173d5c29b4f956d532781d2b86e4e30f83e6b7878dce18c919451d6ba707c90","LICENSE-MIT":"090a294a492ab2f41388252312a65cf2f0e423330b721a68c6665ac64766753b","README.md":"f91ee04dfaa356214af7ac68e4cfa1d6c8674f7fea08d65275f3fafde28301df","release.toml":"287ba3b6c89e3b289eae59827d36d6eb6e27b88cc2ada2c0d9a663c8b487117e","src/lib.rs":"26957a6a2555ab82aa9b6d3d1f24efaf20753d6c5eb1510395789283890ac1d1","src/linux.rs":"cf05c1217709a60adeea08e8623438f68a18dea66758b194de0e07ff398b090d","src/linux/getcontext.rs":"4164236732556d71cbb9e04bf4f2b41fd6f51f9bb94dfb974158cc5f49c3c789","src/linux/getcontext/aarch64.rs":"1193e68f06f7f2f4d3e64d80a196804e6cdfd03643ac50332c7af10928a5eccb","src/linux/getcontext/arm.rs":"d7f4b94acabfbbd332d3d56975d4bbd4302abfc8f5da1ca15d8d954bdc9fc785","src/linux/getcontext/x86.rs":"7c585ec44835910f99801cbb3ac34153e8d687b5dcbc682f9b7768873655c4a0","src/linux/getcontext/x86_64.rs":"db63a1c05e2c7c5b998f3c57b399972fc4e756eb36bcd119a99419c94470444a","src/mac.rs":"13d25443466d387eabf28adae361708f4b6297949c7eeb5bf1b38cb0ca13a418","src/mac/guard.rs":"115d1e8d5ac7bd9ecc666b11a0c584ed1e997160aacb0a1cc0f215ff5a1e9803","src/mac/ipc.rs":"2fc139ee5b70964bd726a30853d7fe9f74f7a6e0f8cf3d150e72a2ac802c1fba","src/mac/resource.rs":"8289db9294a45d6148329d537530512913c456a182783059a832767e39c67295","src/windows.rs":"c6c043cf56cf0840cc1373edc4bd39cf829566d181e50589174745629ab2ad37","tests/capture_context.rs":"899e94c522cd015fd1f45230aff5c8970346ba20623da46cd34da892bbd07f7e"},"package":"b85cef661eeca0c6675116310936972c520ebb0a33ddef16fd7efc957f4c1288"}
\ No newline at end of file
index 0734634a3e521defc153211d31eaa51dab5d59be..83b4b75f1f63dcebe428719e5055e73fafe3fd00 100644 (file)
@@ -46,7 +46,7 @@ std::arch::global_asm! {
 
     // Return 0
     "mov   r0, #0",
-    "bx    lr",
+    "mov   pc, lr",
 
     ".fnend",
     ".size crash_context_getcontext, . - crash_context_getcontext",