[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Add m4 for debhelper



Samuel Thibault, le jeu. 10 juil. 2025 22:58:25 +0200, a ecrit:
> Nowadays, debhelper pulls autotools, and thus m4, so we'd want to
> crossbuild it.
> Here is a fix, also available in my tree
> 
> git@salsa.debian.org:sthibault/rebootstrap.git
> 
> as 184ce049bc8f13330bbe40f18133da4060ea5ba6

Ah, sorry, I missed a piece of it: libsigsegv was not already in the
automatic set.

I have pushed the attached patch as
ce4ae6f26c95c8e2245e08a6e37f638e0cb8139e on my repository.

Samuel
commit ce4ae6f26c95c8e2245e08a6e37f638e0cb8139e
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date:   Thu Jul 10 22:55:58 2025 +0200

    Add m4 for debhelper
    
    Nowadays debhelper pulls autotools and thus m4.

diff --git a/bootstrap.sh b/bootstrap.sh
index 9913ca0..a44f21d 100755
--- a/bootstrap.sh
+++ b/bootstrap.sh
@@ -2832,6 +2832,7 @@ EOF
 }
 
 add_automatic libsepol
+add_automatic libsigsegv
 add_automatic libsm
 add_automatic libsodium
 add_automatic libssh
@@ -3049,6 +3050,34 @@ patch_lz4() {
 EOF
 }
 
+add_automatic m4
+patch_m4() {
+	test "$HOST_ARCH" = hurd-amd64 || return 0
+	echo "Fix ucontext https://debbugs.gnu.org/cgi/bugreport.cgi?bug=63334 https://lists.gnu.org/archive/html/bug-gnulib/2023-05/msg00048.html";
+	drop_privs patch -p1 <<'EOF'
+--- ./lib/sigsegv.c.original	2023-05-05 10:45:54.673751100 +0000
++++ ./lib/sigsegv.c	2023-05-05 10:48:47.903577554 +0000
+@@ -351,6 +351,17 @@
+    "old esp, if trapped from user".  */
+ #  define SIGSEGV_FAULT_STACKPOINTER  scp->sc_uesp
+ 
++# elif defined __x86_64__
++
++/* scp points to a 'struct sigcontext' (defined in
++   glibc/sysdeps/mach/hurd/x86_64/bits/sigcontext.h).
++   The registers of this struct get pushed on the stack through
++   gnumach/x86_64/i386/locore.S:trapall.  */
++/* Both sc_rsp and sc_ursp appear to have the same value.
++   It appears more reliable to use sc_ursp because it is labelled as
++   "old rsp, if trapped from user".  */
++#  define SIGSEGV_FAULT_STACKPOINTER  scp->sc_ursp
++
+ # endif
+ 
+ #endif
+EOF
+}
+
 add_automatic man-db
 add_automatic mawk
 add_automatic mpclib3
@@ -4049,6 +4078,7 @@ add_need libxcrypt # by cyrus-sasl2, pam, shadow, systemd, util-linux
 add_need libxrender # by cairo
 add_need libzstd # by systemd
 add_need lz4 # by elfutils, systemd
+add_need m4 # for debhelper
 add_need man-db # for debhelper
 add_need mawk # for base-files (alternatively: gawk)
 add_need mpclib3 # by gcc-VER

Reply to: