This has already been reported and it is known that the m4-1.4.19 will
no longer build out of the box on a recent Linux machine. Certainly not
with any recent GCC and perfectly sane configuration options.

Perhaps this mail list and the bug-m4 maillist are dead? This has been
reported before :

    https://lists.gnu.org/archive/html/m4-discuss/2025-02/msg00000.html

The issue that I see is trivial but annoying :

/opt/bw/gcc12/bin/gcc -I../lib -I../lib -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -I/opt/bw/include -m64 -O2 -march=haswell -mtune=haswell -mieee-fp -mhard-float -malign-double -m128bit-long-double -mpreferred-stack-boundary=8 -Wl,-rpath=/opt/bw/lib,--enable-new-dtags -MT symtab.o -MD -MP -MF $depbase.Tpo -c -o symtab.o symtab.c &&\
mv -f $depbase.Tpo $depbase.Po
/opt/bw/gcc12/bin/gcc -m64 -O2 -march=haswell -mtune=haswell -mieee-fp -mhard-float -malign-double -m128bit-long-double -mpreferred-stack-boundary=8 -Wl,-rpath=/opt/bw/lib,--enable-new-dtags -o m4 m4.o builtin.o debug.o eval.o format.o freeze.o input.o macro.o output.o path.o symtab.o ../lib/libm4.a
/opt/bw/bin/ld: ../lib/libm4.a(c-stack.o): in function `c_stack_action':
c-stack.c:(.text+0x1d1): undefined reference to `stackoverflow_install_handler' /opt/bw/bin/ld: c-stack.c:(.text+0x1e3): undefined reference to `sigsegv_install_handler'
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:2015: m4] Error 1
make[2]: Leaving directory '/opt/bw/build/m4-1.4.19_linux_xeon.001/src'
make[1]: *** [Makefile:2018: all-recursive] Error 1
make[1]: Leaving directory '/opt/bw/build/m4-1.4.19_linux_xeon.001'
make: *** [Makefile:1974: all] Error 2

A failure in the link stage where the libsigsegv linkage is missing as
well as the correct directory to look for the library. Manually one may
do something :

triton$ cd /opt/bw/build/m4-1.4.19_linux_xeon.001/src
triton$ /opt/bw/gcc12/bin/gcc -m64 -O2 -march=haswell -mtune=haswell \
> -mieee-fp -mhard-float \
> -malign-double -m128bit-long-double -mpreferred-stack-boundary=8 \
> -Wl,-rpath=/opt/bw/lib,--enable-new-dtags -L/opt/bw/lib \
> -o m4 m4.o builtin.o debug.o eval.o \
> format.o freeze.o input.o macro.o output.o path.o symtab.o \
> ../lib/libm4.a -lsigsegv
triton$
triton$ ldd m4
        linux-vdso.so.1 (0x00007ffe55d28000)
        libsigsegv.so.2 => /opt/bw/lib/libsigsegv.so.2 (0x00007f03ec9c5000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f03ec7dc000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f03eca28000)
triton$
triton$ ./m4 --version
m4 (GNU M4) 1.4.19
Copyright (C) 2021 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by René Seindal.
triton$

However the Makefile.am needs a tweak :

triton$ cat m4-1.4.19_linux_xeon.patch
diff -durp m4-1.4.19.orig/src/Makefile.am m4-1.4.19/src/Makefile.am
--- m4-1.4.19.orig/src/Makefile.am   2021-05-07 23:42:02.000000000 +0200
+++ m4-1.4.19/src/Makefile.am 2025-03-31 13:15:02.603155410 +0200
@@ -31,5 +31,5 @@ macro.c output.c path.c symtab.c
 LDADD = ../lib/libm4.a $(LIBM4_LIBDEPS) \
   $(LIB_CLOCK_GETTIME) $(LIB_GETRANDOM) $(LIB_HARD_LOCALE) \
$(LIB_MBRTOWC) $(LIB_POSIX_SPAWN) $(LIB_SETLOCALE) $(LIB_SETLOCALE_NULL) \
-  $(LIBCSTACK) $(LIBICONV) $(LIBINTL) $(LIBTHREAD) $(LIBUNISTRING) \
+ $(LIBCSTACK) $(LIBICONV) $(LIBINTL) $(LIBSIGSEGV) $(LIBTHREAD) $(LIBUNISTRING) \
   $(INTL_MACOSX_LIBS)
diff -durp m4-1.4.19.orig/src/Makefile.in m4-1.4.19/src/Makefile.in
--- m4-1.4.19.orig/src/Makefile.in   2021-05-28 20:48:49.000000000 +0200
+++ m4-1.4.19/src/Makefile.in 2025-03-31 13:16:06.392825361 +0200
@@ -1931,7 +1931,7 @@ macro.c output.c path.c symtab.c
 LDADD = ../lib/libm4.a $(LIBM4_LIBDEPS) \
   $(LIB_CLOCK_GETTIME) $(LIB_GETRANDOM) $(LIB_HARD_LOCALE) \
$(LIB_MBRTOWC) $(LIB_POSIX_SPAWN) $(LIB_SETLOCALE) $(LIB_SETLOCALE_NULL) \
-  $(LIBCSTACK) $(LIBICONV) $(LIBINTL) $(LIBTHREAD) $(LIBUNISTRING) \
+ $(LIBCSTACK) $(LIBICONV) $(LIBINTL) $(LIBSIGSEGV) $(LIBTHREAD) $(LIBUNISTRING) \
   $(INTL_MACOSX_LIBS)

 all: all-amtriton$

At the very least a beta for 1.6 could be tested.

triton$ git remote show origin
* remote origin
  Fetch URL: http://git.savannah.gnu.org/r/m4.git
  Push  URL: http://git.savannah.gnu.org/r/m4.git
  HEAD branch: master
  Remote branches:
    argv_ref    tracked
    branch-1.4  tracked
    branch-1.6  tracked
    branch-2.0  tracked
    include-dso tracked
    master      tracked
    stackovf    tracked
  Local branch configured for 'git pull':
    master merges with remote master
  Local ref configured for 'git push':
    master pushes to master (up to date)
triton$

There are plenty of things changing but I do not see where the linkage
problem is fixed in the git repo.

It is 2025 ... anyone care to kick out a beta release ?

--
--
Dennis Clarke
RISC-V/SPARC/PPC/ARM/CISC
UNIX and Linux spoken


Reply via email to