puppylinux-woof-CE / woof-CE

woof - the Puppy builder
GNU General Public License v2.0
382 stars 273 forks source link

Petbuild failures with GCC-14 #4289

Closed peabee closed 1 month ago

peabee commented 1 month ago

Slackware-Current has just moved to GCC-14 As a result, the following petbuilds fail: gtkdialog & mtpaint

Kernel build of kernel 6.9.0 aufs also fails

The following petbuilds build OK: busybox aaa_pup_c jwm gtk_theme_flat_grey_rounded gtk_theme_gradient_grey gtk_theme_polished_blue xdg-puppy-jwm firewallstatus powerapplet_tray xlockmore

fail-gtkdialog.txt fail-mtpaint.txt k690-gcc14-build.log

peabee commented 1 month ago

Ooops.... fail-mtpaint.txt /usr/bin/iconv is present so why this error?

/usr/bin/ccache gcc -Wall  -Wno-pointer-sign -Wno-int-to-pointer-cast -Wno-pointer-to-int-cast -Wno-misleading-indentation -Wno-stringop-truncation -Wformat-truncation=0 -Wformat-overflow=0 -Wno-deprecated-declarations -DU_WEBP -DU_JPEG -DU_FREETYPE -DU_NLS -DMT_LANG_DEST='"/usr/share/locale"' -DU_THREADS -DU_FPICK_GTKFILESEL -DU_CPICK_GTK -DMT_VERSION='"mtPaint 3.50.09"'  -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -pthread -I/usr/include/gtk-2.0 -I/usr/lib64/gtk-2.0/include -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/webp -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/libxml2 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include  -march=x86-64 -mtune=generic -O2 -fomit-frame-pointer -ffunction-sections -fdata-sections -fmerge-all-constants -fcommon -frandom-seed=vcode -c -o vcode.o vcode.c
/usr/bin/ccache gcc -Wall  -Wno-pointer-sign -Wno-int-to-pointer-cast -Wno-pointer-to-int-cast -Wno-misleading-indentation -Wno-stringop-truncation -Wformat-truncation=0 -Wformat-overflow=0 -Wno-deprecated-declarations main.o mainwindow.o inifile.o png.o memory.o canvas.o otherwindow.o mygtk.o viewer.o polygon.o layer.o info.o wu.o prefs.o ani.o mtlib.o toolbar.o channels.o csel.o shifter.o spawn.o font.o fpick.o icons.o cpick.o thread.o vcode.o -o mtpaint -lwebp -ljpeg -lfreetype -liconv -lpng -lz -lm -lintl -lgtk-x11-2.0 -lgdk-x11-2.0 -lpangocairo-1.0 -latk-1.0 -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lharfbuzz -lfontconfig -lfreetype -lgthread-2.0 -pthread -lglib-2.0 -lX11 -s  -Wl,--gc-sections -Wl,--sort-common -Wl,-s
/usr/bin/ld: cannot find -liconv: No such file or directory
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:15: mtpaint] Error 1
make[1]: Leaving directory '/tmp/mtPaint-199472ad6a4ecee6c8583fb5a504a2e99712b4fc/src'
make: *** [Makefile:8: src] Error 2
ERROR: failed to build mtpaint
dimkr commented 1 month ago

/usr/bin/iconv is present so why this error?

It's looking for libiconv.so*, not /usr/bin/iconv

peabee commented 1 month ago

I can't find libiconv.so for Slackware Current....... and am wondering why it has become an issue with GCC-14??

dimkr commented 1 month ago

Your problem is probably here, as far as I remember GCC 14 is more strict about undefined symbols so #include <iconv.h> is needed

https://github.com/wjaguar/mtPaint/blob/199472ad6a4ecee6c8583fb5a504a2e99712b4fc/configure#L372

peabee commented 1 month ago

By commenting out (with temp bodge): https://github.com/wjaguar/mtPaint/blob/199472ad6a4ecee6c8583fb5a504a2e99712b4fc/configure#L622 and https://github.com/wjaguar/mtPaint/blob/199472ad6a4ecee6c8583fb5a504a2e99712b4fc/configure#L645

both GTK2 and GTK3 versions of MtPaint petbuild with GCC-14 and the binaries produced run (no greater testing done).

Should these changes be made permanent for all builds? Or conditional on GCC>13? by sed in the petbuild?

p.s. I think both libiconv and libintl no longer exist - subsumed into glibc as mentioned: https://github.com/wjaguar/mtPaint/blob/199472ad6a4ecee6c8583fb5a504a2e99712b4fc/configure#L621

peabee commented 1 month ago

OK - going to follow the advice at: https://gcc.gnu.org/gcc-14/porting_to.html

and create a gcc wrapper script /usr/bin/gcc:

#!/bin/sh
exec /usr/bin/gcc-14.1.0 -fpermissive "$@"

This "reverts" GCC-14 to GCC-13 behaviour so fixes the problem for now..... but allows gtkdialog & mtpaint to build with GCC-14

dimkr commented 1 month ago

and create a gcc wrapper script /usr/bin/gcc:

A wrapper script is dirty hack, it will make the build pass and allow issues at runtime (for example, the build will pass if %d is given a size_t argument, causing truncation or overflow), in all petbuilds.

Instead, you can just change this line in woof-code/rootfs-petbuilds/mtpaint/petbuild

 ./configure ...

to

CC="$CC -fpermissive"`  ./configure ...