Subject: xemacs21: ftbfs with GCC-14

From: Matthias Klose <[email-masked]>
Date: Wed, 03 Jul 2024 12:48:39 +0000

Package: src:xemacs21
Version: 21.4.24-12
Severity: important
Tags: sid trixie
User: [email-masked]
Usertags: ftbfs-gcc-14

[This bug is targeted to the upcoming trixie release]

Please keep this issue open in the bug tracker for the package it
was filed for.  If a fix in another package is required, please
file a bug for the other package (or clone), and add a block in this
package. Please keep the issue open until the package can be built in
a follow-up test rebuild.

The package fails to build in a test rebuild on at least amd64 with
gcc-14/g++-14, but succeeds to build with gcc-13/g++-13. The
severity of this report will be raised before the trixie release.

The full build log can be found at:
http://qa-logs.debian.net/2024/07/01/xemacs21_21.4.24-12_unstable_gccexp.log
The last lines of the build log are at the end of this report.

To build with GCC 14, either set CC=gcc-14 CXX=g++-14 explicitly,
or install the gcc, g++, gfortran, ... packages from experimental.

  apt-get -t=experimental install g++ 

Common build failures are new warnings resulting in build failures with
-Werror turned on, or new/dropped symbols in Debian symbols files.
For other C/C++ related build failures see the porting guide at
http://gcc.gnu.org/gcc-14/porting_to.html

[...]
Converting from xemacs@MAJVERSION@@[email-masked] to xemacs21-bin.dirs
Converting from xemacs@MAJVERSION@@[email-masked] to xemacs21-bin.files
Converting from xemacs@MAJVERSION@@[email-masked] to xemacs21-bin.menu
Converting from xemacs@MAJVERSION@@[email-masked] to xemacs21-bin.postinst
Converting from xemacs@MAJVERSION@@[email-masked] to xemacs21-bin.prerm
Converting from xemacs@MAJVERSION@@[email-masked] to xemacs21-mule-canna-wnn.menu
Converting from xemacs@MAJVERSION@@[email-masked] to xemacs21-mule-canna-wnn.postinst
Converting from xemacs@MAJVERSION@@[email-masked] to xemacs21-mule-canna-wnn.preinst
Converting from xemacs@MAJVERSION@@[email-masked] to xemacs21-mule-canna-wnn.prerm
Converting from xemacs@MAJVERSION@@[email-masked] to xemacs21-mule.menu
Converting from xemacs@MAJVERSION@@[email-masked] to xemacs21-mule.postinst
Converting from xemacs@MAJVERSION@@[email-masked] to xemacs21-mule.preinst
Converting from xemacs@MAJVERSION@@[email-masked] to xemacs21-mule.prerm
Converting from xemacs@MAJVERSION@@[email-masked] to xemacs21-nomule.menu
Converting from xemacs@MAJVERSION@@[email-masked] to xemacs21-nomule.postinst
Converting from xemacs@MAJVERSION@@[email-masked] to xemacs21-nomule.preinst
Converting from xemacs@MAJVERSION@@[email-masked] to xemacs21-nomule.prerm
Converting from xemacs@MAJVERSION@@[email-masked] to xemacs21-support.dirs
Converting from xemacs@MAJVERSION@@[email-masked] to xemacs21-support.docs
Converting from xemacs@MAJVERSION@@[email-masked] to xemacs21-support.files
Converting from xemacs@MAJVERSION@@[email-masked] to xemacs21-support.postinst
Converting from xemacs@MAJVERSION@@[email-masked] to xemacs21-support.postrm
Converting from xemacs@MAJVERSION@@[email-masked] to xemacs21-support.prerm
Converting from xemacs@MAJVERSION@@[email-masked] to xemacs21-supportel.postinst
Converting from xemacs@MAJVERSION@@[email-masked] to xemacs21-supportel.prerm
Converting from xemacs@MAJVERSION@@SUBNAME@.postinst.in to xemacs21.postinst
touch convert_files.stamp
make[1]: Leaving directory '/<<PKGBUILDDIR>>/debian'
touch pre-build-stamp
cp lisp/auto-autoloads.el lisp/auto-autoloads.el.orig
dh_testdir
/usr/bin/make -f debian/PackagesMakefile build
make[1]: Entering directory '/<<PKGBUILDDIR>>'
ln -sf /usr/share/misc/config.sub /usr/share/misc/config.guess .
autoconf2.13
echo

./configure  --cflags="-fgnu89-inline -no-pie -O2 -g" --with-sound=none,native --with-x11 --extra-verbose --with-site-lisp --with-database=berkdb --statedir="/var/lib" --infodir="/usr/share/info/xemacs21" --infopath="/usr/share/info/xemacs21" --prefix="/usr" --dynamic --error-checking=none --debug=no --with-pop --with-file-coding --pdump --with-system-malloc --with_menubars=lucid --with_scrollbars=lucid --with_dialogs=athena \
  --docdir="/usr/lib/xemacs-21.4.24/x86_64-linux-gnu/mule-canna-wnn/" \
  --with-mule --with-canna --with-wnn6 --with-xim=xlib --with-xfs \
  --package-path="~/.xemacs:~/.xemacs/packages:~/.xemacs/xemacs-packages::/usr/share/xemacs21/site-packages:/usr/share/xemacs21/mule-packages:/usr/share/xemacs21/xemacs-packages" \
  x86_64-linux-gnu
    Defining INFODIR_USER_DEFINED
    Defining INFOPATH_USER_DEFINED
    Defining DOCDIR_USER_DEFINED
    Defining PACKAGE_PATH_USER_DEFINED
checking whether ln -s works... yes
/<<PKGBUILDDIR>>: 1: cd: can't cd to /sbuild-nonexistent
./configure: 901: test: !=: argument expected
    Defining EMACS_MAJOR_VERSION = 21
    Defining EMACS_MINOR_VERSION = 4
    Defining EMACS_PATCH_LEVEL = 24
    Defining XEMACS_CODENAME = "Standard C"
    Defining EMACS_VERSION = "21.4.24"
    Defining EMACS_PROGNAME = "xemacs"
    Defining USE_ASSERTIONS
checking host system type... x86_64-linux-gnu
XEmacs has no builtin knowledge of `x86_64' machines.
Using configure-time autodetection only.
    Defining config_opsysfile = "s/linux.h"
    Defining STACK_TRACE_EYE_CATCHER = xemacs_21_4_24_x86_64_pc_linux
    Defining CLASH_DETECTION
    xemacs will be linked with "filelock.o"
checking for gcc... gcc
checking whether the C compiler (gcc -fgnu89-inline -no-pie -O2 -g ) works... no
configure: error: installation or configuration problem: C compiler cannot create executables.
make[1]: *** [debian/PackagesMakefile:384: canna-wnn-build-stamp] Error 1
make[1]: Leaving directory '/<<PKGBUILDDIR>>'
make: *** [debian/rules:48: build-stamp] Error 2
dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2

---

From: Petter Reinholdtsen <[email-masked]>
Date: Sun, 8 Dec 2024 00:14:17 +0100

I suspect something like this will fix the GCC 14 build problem with configure.  A
proper fix is probably to move to a newer version of autoconf and run autoreconf during
build.

diff --git a/configure b/configure
index 536e5f2..39de50b 100755
--- a/configure
+++ b/configure
@@ -1777,7 +1777,7 @@ cat > conftest.$ac_ext << EOF
 #line 1778 "configure"
 #include "confdefs.h"
 
-main(){return(0);}
+int main(){return(0);}
 EOF
 if { (eval echo configure:1783: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
@@ -1990,7 +1990,7 @@ cat > conftest.$ac_ext << EOF
 #line 1991 "configure"
 #include "confdefs.h"
 
-main(){return(0);}
+int main(){return(0);}
 EOF
 if { (eval echo configure:1996: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
@@ -2203,7 +2203,7 @@ cat > conftest.$ac_ext << EOF
 #line 2204 "configure"
 #include "confdefs.h"
 
-main(){return(0);}
+int main(){return(0);}
 EOF
 if { (eval echo configure:2209: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
diff --git a/configure.in b/configure.in
index 8f20af2..19ff2f6 100644
--- a/configure.in
+++ b/configure.in
@@ -4103,7 +4103,7 @@ unset_TZ ()
 }
 char TZ_GMT0[] = "TZ=GMT0";
 char TZ_PST8[] = "TZ=PST8";
-main()
+int main()
 {
   time_t now = time ((time_t *) 0);
   int hour_GMT0, hour_unset;

-- 
Happy hacking
Petter Reinholdtsen