package/libfm: fix build with gcc >= 14
PATCH 1/2 package/libfm: fix build with gcc >= 14
The build fails with gcc 14, first with:
action.c: In function ‘fm_load_all_actions’:
action.c:2050:25: error: assignment to ‘gchar **’ {aka ‘char **’} from incompatible pointer type ‘const gchar * const*’ {aka ‘const char * const*’} [-Wincompatible-pointer-types]
2050 | _tmp2_ = _tmp1_ = g_get_system_data_dirs ();
| ^
This is an issue in the pre-generated C code, generated from Vala so we cannot easily fix it. Since it's apparently used for some "old actions" code, we simply disable it.
Then the build fails with:
gtk/fm-dnd-dest.c:461:13: error: assignment to ‘GtkMenu *’ {aka ‘struct _GtkMenu *’} from incompatible pointer type ‘GtkWidget *’ {aka ‘struct _GtkWidget *’} [-Wincompatible-pointer-types]
| ^
and:
base/fm-dummy-monitor.c:48:22: error: assignment to ‘gboolean (*)(GFileMonitor *)’ {aka ‘int (*)(struct _GFileMonitor *)’} from incompatible pointer type ‘gboolean (*)(void)’ {aka ‘int (*)(void)’} [-Wincompatible-pointer-types]
| ^
Both of which are fixed by backporting upstream patches.
There are no autobuilder failures, but the build failure can be reproduced using:
BR2_aarch64=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y BR2_TOOLCHAIN_EXTERNAL_URL="http://toolchains.bootlin.com/downloads/releases/toolchains/aarch64/tarballs/aarch64--glibc--stable-2025.08-1.tar.xz" BR2_TOOLCHAIN_EXTERNAL_GCC_14=y
BR2_TOOLCHAIN_EXTERNAL_HEADERS_5_4=y
BR2_TOOLCHAIN_EXTERNAL_CUSTOM_GLIBC=y
# BR2_TOOLCHAIN_EXTERNAL_INET_RPC is not set
BR2_TOOLCHAIN_EXTERNAL_CXX=y
BR2_TOOLCHAIN_EXTERNAL_OPENMP=y
BR2_PACKAGE_MESA3D=y
BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_SOFTPIPE=y
BR2_PACKAGE_MESA3D_OPENGL_GLX=y
BR2_PACKAGE_XORG7=y
BR2_PACKAGE_PCMANFM=y
With this fix, libfm builds fine up to and including gcc 16.
--- ...14-Werror-incompatible-pointer-types.patch | 61 +++++++++++++++++++ ...ion-argument-fix-for-C23-conformance.patch | 35 +++++++++++ package/libfm/libfm.mk | 2 +- 3 files changed, 97 insertions(+), 1 deletion(-) create mode 100644 package/libfm/0002-FIX-support-gcc14-Werror-incompatible-pointer-types.patch create mode 100644 package/libfm/0003-FIX-function-argument-fix-for-C23-conformance.patch
package/libfm/0002-FIX-support-gcc14-Werror-incompatible-pointer-types.patch new file +61 -0
@@ -0,0 +1,61 @@ +From 212de3e1f0072931a7862dfefe2ad818f622373b Mon Sep 17 00:00:00 2001 +From: Mamoru TASAKA <[email protected]> +Date: Fri, 1 Mar 2024 14:19:46 +0900 +Subject: [PATCH] FIX: support gcc14 -Werror=incompatible-pointer-types + +gcc14 now defaults to -Werror=incompatible-pointer-types . +To support this, cast GTK related objects for assignment +properly. + +Fixes #100 . + +Upstream: https://github.com/lxde/libfm/commit/fbcd183335729fa3e8dd6a837c13a23ff3271000 +Signed-off-by: Thomas Petazzoni <[email protected]> +--- + src/gtk/exo/exo-icon-view.c | 2 +- + src/gtk/fm-dnd-dest.c | 2 +- + src/gtk/fm-standard-view.c | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/gtk/exo/exo-icon-view.c b/src/gtk/exo/exo-icon-view.c +index 3ce98099..79e1c7ab 100644 +--- a/src/gtk/exo/exo-icon-view.c ++++ b/src/gtk/exo/exo-icon-view.c +@@ -2819,7 +2819,7 @@ exo_icon_view_key_press_event (GtkWidget *widget, + /* allocate a new event to forward */ + new_event = gdk_event_copy ((GdkEvent *) event); + g_object_unref (G_OBJECT (new_event->key.window)); +- new_event->key.window = g_object_ref (G_OBJECT (gtk_widget_get_window (icon_view->priv->search_entry))); ++ new_event->key.window = GDK_WINDOW(g_object_ref (G_OBJECT (gtk_widget_get_window (icon_view->priv->search_entry)))); + + /* send the event to the search entry. If the "preedit-changed" signal is + * emitted during this event, priv->search_imcontext_changed will be set. +diff --git a/src/gtk/fm-dnd-dest.c b/src/gtk/fm-dnd-dest.c +index 95d310d3..ce752758 100644 +--- a/src/gtk/fm-dnd-dest.c ++++ b/src/gtk/fm-dnd-dest.c +@@ -458,7 +458,7 @@ static GdkDragAction _ask_action_on_drop(GtkWidget *widget, + gtk_action_set_sensitive(act, FALSE); + } + } +- ri.menu = g_object_ref(gtk_ui_manager_get_widget(ui, "/popup")); ++ ri.menu = GTK_MENU(g_object_ref(gtk_ui_manager_get_widget(ui, "/popup"))); + g_signal_connect(ri.menu, "selection-done", G_CALLBACK(gtk_widget_destroy), NULL); + unmap_handler = g_signal_connect(ri.menu, "unmap", + G_CALLBACK(run_unmap_handler), &ri); +diff --git a/src/gtk/fm-standard-view.c b/src/gtk/fm-standard-view.c +index e0ff5a06..df920254 100644 +--- a/src/gtk/fm-standard-view.c ++++ b/src/gtk/fm-standard-view.c +@@ -637,7 +637,7 @@ static inline void create_icon_view(FmStandardView* fv, GList* sels) + "text", FM_FOLDER_MODEL_COL_NAME ); + if(fv->renderer_text) + g_object_unref(fv->renderer_text); +- fv->renderer_text = g_object_ref_sink(render); ++ fv->renderer_text = FM_CELL_RENDERER_TEXT(g_object_ref_sink(render)); + exo_icon_view_set_search_column((ExoIconView*)fv->view, FM_FOLDER_MODEL_COL_NAME); + g_signal_connect(fv->view, "item-activated", G_CALLBACK(on_icon_view_item_activated), fv); + g_signal_connect(fv->view, "selection-changed", G_CALLBACK(on_sel_changed), fv); +-- +2.56.0 +
package/libfm/0003-FIX-function-argument-fix-for-C23-conformance.patch new file +35 -0
@@ -0,0 +1,35 @@ +From 9e9ea4c131fcd611ae5a91c7f6a4d9cf63043442 Mon Sep 17 00:00:00 2001 +From: Mamoru TASAKA <[email protected]> +Date: Tue, 14 Jan 2025 18:00:03 +0900 +Subject: [PATCH] FIX: function argument fix for C23 conformance + +C23 now regards function declaration without a parameter list +as that with no parameter (i.e. having `(void)`). + +Specify parameter list explicitly to make code C23 +conformant. + +Closes #106 . + +Upstream: https://github.com/lxde/libfm/commit/dff442bd58b61c8afdf8cbd17f918bcaed40ddc2 +Signed-off-by: Thomas Petazzoni <[email protected]> +--- + src/base/fm-dummy-monitor.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/base/fm-dummy-monitor.c b/src/base/fm-dummy-monitor.c +index 6ece1fcc..cf1bcf89 100644 +--- a/src/base/fm-dummy-monitor.c ++++ b/src/base/fm-dummy-monitor.c +@@ -37,7 +37,7 @@ + + G_DEFINE_TYPE(FmDummyMonitor, fm_dummy_monitor, G_TYPE_FILE_MONITOR); + +-static gboolean cancel() ++static gboolean cancel(GFileMonitor *) + { + return TRUE; + } +-- +2.56.0 +
package/libfm/libfm.mk +1 -1
@@ -13,7 +13,7 @@ LIBFM_LICENSE_FILES = COPYING src/extra/fm-xml-file.c LIBFM_INSTALL_STAGING = YES # We're patching src/modules/Makefile.am LIBFM_AUTORECONF = YES -LIBFM_CONF_OPTS = --with-gtk=3 +LIBFM_CONF_OPTS = --with-gtk=3 --disable-old-actions ifeq ($(BR2_PACKAGE_LIBEXIF),y) LIBFM_CONF_OPTS += --enable-exif
Signature · 6 lines
2.56.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH 2/2 package/pcmanfm: fix build with gcc >= 14
Once the libfm build issues with gcc >= 14 are fixed, pcmanfm then fails to build with:
/home/thomas/buildroot/vala/output-gcc14/host/bin/../aarch64-buildroot-linux-gnu/sysroot/usr/include/glib-2.0/gobject/gobject.h:533:28: error: returning ‘FmDesktopItemAccessible *’ {aka ‘struct _FmDesktopItemAccessible *’} from a function with incompatible return type ‘AtkObject *’ {aka ‘struct _AtkObject *’} [-Wincompatible-pointer-types] desktop.c:1457:12: note: in expansion of macro ‘g_object_ref’
1457 | return g_object_ref(item);
| ^~~~~~~~~~~~This is fixed by backporting one upstream commit. The second is just a cleanup on top of the fix, also upstream.
There are no autobuilder failures, but the build failure can be reproduced using:
BR2_aarch64=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y BR2_TOOLCHAIN_EXTERNAL_URL="http://toolchains.bootlin.com/downloads/releases/toolchains/aarch64/tarballs/aarch64--glibc--stable-2025.08-1.tar.xz" BR2_TOOLCHAIN_EXTERNAL_GCC_14=y
BR2_TOOLCHAIN_EXTERNAL_HEADERS_5_4=y
BR2_TOOLCHAIN_EXTERNAL_CUSTOM_GLIBC=y
# BR2_TOOLCHAIN_EXTERNAL_INET_RPC is not set
BR2_TOOLCHAIN_EXTERNAL_CXX=y
BR2_TOOLCHAIN_EXTERNAL_OPENMP=y
BR2_PACKAGE_MESA3D=y
BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_SOFTPIPE=y
BR2_PACKAGE_MESA3D_OPENGL_GLX=y
BR2_PACKAGE_XORG7=y
BR2_PACKAGE_PCMANFM=y
With this fix, pcman builds fine up to and including gcc 16.
--- ...cc14-Werror-incompatible-pointer-typ.patch | 40 +++++++++++++++++++ ...-ATK_OBJECT-rather-than-a-plain-cast.patch | 36 +++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 package/pcmanfm/0002-Fix-build-with-gcc14-Werror-incompatible-pointer-typ.patch create mode 100644 package/pcmanfm/0003-Use-ATK_OBJECT-rather-than-a-plain-cast.patch
package/pcmanfm/0002-Fix-build-with-gcc14-Werror-incompatible-pointer-typ.patch new file +40 -0
@@ -0,0 +1,40 @@ +From b97c630af9794c0f87bf3b8a0b77531b034d31a7 Mon Sep 17 00:00:00 2001 +From: Mamoru TASAKA <[email protected]> +Date: Fri, 26 Jul 2024 12:13:32 +0900 +Subject: [PATCH] Fix build with gcc14 -Werror=incompatible-pointer-types + +gcc14 now defaults to -Werror=incompatible-pointer-types. + +Add required casts to the returned pointers. + +Upstream: https://github.com/lxde/pcmanfm/commit/12abd7e179adb9e31d999824048a5f40f90218fd +Signed-off-by: Thomas Petazzoni <[email protected]> +--- + src/desktop.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/desktop.c b/src/desktop.c +index 0686a59..b358f50 100644 +--- a/src/desktop.c ++++ b/src/desktop.c +@@ -1267,7 +1267,7 @@ static AtkObject *fm_desktop_accessible_ref_selection(AtkSelection *selection, + item = items->data; + if (item->item->is_selected) + if (i-- == 0) +- return g_object_ref(item); ++ return (AtkObject *)g_object_ref(item); + } + return NULL; + } +@@ -1454,7 +1454,7 @@ static AtkObject *fm_desktop_accessible_ref_child(AtkObject *accessible, + item = g_list_nth_data(priv->items, index); + if (!item) + return NULL; +- return g_object_ref(item); ++ return (AtkObject *)g_object_ref(item); + } + + static void fm_desktop_accessible_initialize(AtkObject *accessible, gpointer data) +-- +2.56.0 +
package/pcmanfm/0003-Use-ATK_OBJECT-rather-than-a-plain-cast.patch new file +36 -0
@@ -0,0 +1,36 @@ +From 3ae0e8d2e26e6ee5836df76b4db3378b7b61c8e8 Mon Sep 17 00:00:00 2001 +From: Adam Sampson <[email protected]> +Date: Fri, 11 Jul 2025 13:59:56 +0100 +Subject: [PATCH] Use ATK_OBJECT rather than a plain cast + +Upstream: https://github.com/lxde/pcmanfm/commit/cb2e81e4e545ff26dd6a410ccc52366cc98ba858 +Signed-off-by: Thomas Petazzoni <[email protected]> +--- + src/desktop.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/desktop.c b/src/desktop.c +index b358f50..28b19ca 100644 +--- a/src/desktop.c ++++ b/src/desktop.c +@@ -1267,7 +1267,7 @@ static AtkObject *fm_desktop_accessible_ref_selection(AtkSelection *selection, + item = items->data; + if (item->item->is_selected) + if (i-- == 0) +- return (AtkObject *)g_object_ref(item); ++ return ATK_OBJECT(g_object_ref(item)); + } + return NULL; + } +@@ -1454,7 +1454,7 @@ static AtkObject *fm_desktop_accessible_ref_child(AtkObject *accessible, + item = g_list_nth_data(priv->items, index); + if (!item) + return NULL; +- return (AtkObject *)g_object_ref(item); ++ return ATK_OBJECT(g_object_ref(item)); + } + + static void fm_desktop_accessible_initialize(AtkObject *accessible, gpointer data) +-- +2.56.0 +
Signature · 6 lines
2.56.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Raphaël Mélotte via buildroot
AppliedRe: [Buildroot] [PATCH 2/2] package/pcmanfm: fix build with gcc >= 14
In reply of:
Quoted 31 lines
Once the libfm build issues with gcc >= 14 are fixed, pcmanfm then fails to build with:
/home/thomas/buildroot/vala/output-gcc14/host/bin/../aarch64-buildroot-linux-gnu/sysroot/usr/include/glib-2.0/gobject/gobject.h:533:28: error: returning ‘FmDesktopItemAccessible *’ {aka ‘struct_FmDesktopItemAccessible*’} from a function with incompatible return type ‘AtkObject *’ {aka ‘struct_AtkObject*’} [-Wincompatible-pointer-types] desktop.c:1457:12: note: in expansion of macro ‘g_object_ref’1457 | return g_object_ref(item); | ^~~~~~~~~~~~This is fixed by backporting one upstream commit. The second is just a cleanup on top of the fix, also upstream.
There are no autobuilder failures, but the build failure can be reproduced using:
BR2_aarch64=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y BR2_TOOLCHAIN_EXTERNAL_URL="http://toolchains.bootlin.com/downloads/releases/toolchains/aarch64/tarballs/aarch64--glibc--stable-2025.08-1.tar.xz" BR2_TOOLCHAIN_EXTERNAL_GCC_14=y
BR2_TOOLCHAIN_EXTERNAL_HEADERS_5_4=y
BR2_TOOLCHAIN_EXTERNAL_CUSTOM_GLIBC=y
#BR2_TOOLCHAIN_EXTERNAL_INET_RPCis not set
BR2_TOOLCHAIN_EXTERNAL_CXX=y
BR2_TOOLCHAIN_EXTERNAL_OPENMP=y
BR2_PACKAGE_MESA3D=y
BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_SOFTPIPE=y
BR2_PACKAGE_MESA3D_OPENGL_GLX=y
BR2_PACKAGE_XORG7=y
BR2_PACKAGE_PCMANFM=y
Quoted 3 lines
With this fix, pcman builds fine up to and including gcc 16.
Signed-off-by Thomas Petazzoni <[email protected]>
Applied to 2025.02.x, 2026.08.x. Thanks
Quoted 85 lines
--- ...cc14-Werror-incompatible-pointer-typ.patch | 40 +++++++++++++++++++ ...-ATK_OBJECT-rather-than-a-plain-cast.patch | 36 +++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 package/pcmanfm/0002-Fix-build-with-gcc14-Werror-incompatible-pointer-typ.patch create mode 100644 package/pcmanfm/0003-Use-ATK_OBJECT-rather-than-a-plain-cast.patchpackage/pcmanfm/0002-Fix-build-with-gcc14-Werror-incompatible-pointer-typ.patch new file +40
-0@@ -0,0 +1,40 @@ +From b97c630af9794c0f87bf3b8a0b77531b034d31a7 Mon Sep 17 00:00:00 2001 +From: Mamoru TASAKA <[email protected]> +Date: Fri, 26 Jul 2024 12:13:32 +0900 +Subject: [PATCH] Fix build with gcc14 -Werror=incompatible-pointer-types + +gcc14 now defaults to -Werror=incompatible-pointer-types. + +Add required casts to the returned pointers. + +Upstream: https://github.com/lxde/pcmanfm/commit/12abd7e179adb9e31d999824048a5f40f90218fd +Signed-off-by: Thomas Petazzoni <[email protected]> +--- + src/desktop.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/desktop.c b/src/desktop.c +index 0686a59..b358f50 100644 +--- a/src/desktop.c ++++ b/src/desktop.c +@@ -1267,7 +1267,7 @@ static AtkObject *fm_desktop_accessible_ref_selection(AtkSelection *selection, + item = items->data; + if (item->item->is_selected) + if (i-- == 0) +- return g_object_ref(item); ++ return (AtkObject *)g_object_ref(item); + } + return NULL; + } +@@ -1454,7 +1454,7 @@ static AtkObject *fm_desktop_accessible_ref_child(AtkObject *accessible, + item = g_list_nth_data(priv->items, index); + if (!item) + return NULL; +- return g_object_ref(item); ++ return (AtkObject *)g_object_ref(item); + } + + static void fm_desktop_accessible_initialize(AtkObject *accessible, gpointer data) +-- +2.56.0 +package/pcmanfm/0003-Use-ATK_OBJECT-rather-than-a-plain-cast.patch new file +26
-0@@ -0,0 +1,36 @@ +From 3ae0e8d2e26e6ee5836df76b4db3378b7b61c8e8 Mon Sep 17 00:00:00 2001 +From: Adam Sampson <[email protected]> +Date: Fri, 11 Jul 2025 13:59:56 +0100 +Subject: [PATCH] Use ATK_OBJECT rather than a plain cast + +Upstream: https://github.com/lxde/pcmanfm/commit/cb2e81e4e545ff26dd6a410ccc52366cc98ba858 +Signed-off-by: Thomas Petazzoni <[email protected]> +--- + src/desktop.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/desktop.c b/src/desktop.c +index b358f50..28b19ca 100644 +--- a/src/desktop.c ++++ b/src/desktop.c +@@ -1267,7 +1267,7 @@ static AtkObject *fm_desktop_accessible_ref_selection(AtkSelection *selection, + item = items->data; + if (item->item->is_selected) + if (i-- == 0) +- return (AtkObject *)g_object_ref(item); ++ return ATK_OBJECT(g_object_ref(item)); + } + return NULL; + } +@@ -1454,7 +1454,7 @@ static AtkObject *fm_desktop_accessible_ref_child(AtkObject *accessible, + item = g_list_nth_data(priv->items, index);
package/pcmanfm/0003-Use-ATK_OBJECT-rather-than-a-plain-cast.patch line 36
Quoted 10 lines
package/pcmanfm/0003-Use-ATK_OBJECT-rather-than-a-plain-cast.patch new file +10
-0+ if (!item) + return NULL; +- return (AtkObject *)g_object_ref(item); ++ return ATK_OBJECT(g_object_ref(item)); + } + + static void fm_desktop_accessible_initialize(AtkObject *accessible, gpointer data) +-- +2.56.0 +
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Quoted 45 lines · Thomas Petazzoni via buildroot
The build fails with gcc 14, first with:
action.c: In function ‘fm_load_all_actions’:
action.c:2050:25: error: assignment to ‘gchar **’ {aka ‘char **’} from incompatible pointer type ‘const gchar * const*’ {aka ‘const char * const*’} [-Wincompatible-pointer-types]
2050 | _tmp2_ = _tmp1_ =g_get_system_data_dirs();
| ^This is an issue in the pre-generated C code, generated from Vala so we cannot easily fix it. Since it's apparently used for some "old actions" code, we simply disable it.
Then the build fails with:
gtk/fm-dnd-dest.c:461:13: error: assignment to ‘GtkMenu *’ {aka ‘struct_GtkMenu*’} from incompatible pointer type ‘GtkWidget *’ {aka ‘struct_GtkWidget*’} [-Wincompatible-pointer-types]
| ^and:
base/fm-dummy-monitor.c:48:22: error: assignment to ‘gboolean (*)(GFileMonitor *)’ {aka ‘int (*)(struct_GFileMonitor*)’} from incompatible pointer type ‘gboolean (*)(void)’ {aka ‘int (*)(void)’} [-Wincompatible-pointer-types]
| ^Both of which are fixed by backporting upstream patches.
There are no autobuilder failures, but the build failure can be reproduced using:
BR2_aarch64=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=yBR2_TOOLCHAIN_EXTERNAL_URL="http://toolchains.bootlin.com/downloads/releases/toolchains/aarch64/tarballs/aarch64--glibc--stable-2025.08-1.tar.xz"
BR2_TOOLCHAIN_EXTERNAL_GCC_14=y
BR2_TOOLCHAIN_EXTERNAL_HEADERS_5_4=y
BR2_TOOLCHAIN_EXTERNAL_CUSTOM_GLIBC=y
#BR2_TOOLCHAIN_EXTERNAL_INET_RPCis not set
BR2_TOOLCHAIN_EXTERNAL_CXX=y
BR2_TOOLCHAIN_EXTERNAL_OPENMP=y
BR2_PACKAGE_MESA3D=y
BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_SOFTPIPE=y
BR2_PACKAGE_MESA3D_OPENGL_GLX=y
BR2_PACKAGE_XORG7=y
BR2_PACKAGE_PCMANFM=y
Quoted 3 lines
With this fix, libfm builds fine up to and including gcc 16.
Signed-off-by Thomas Petazzoni <[email protected]>
Series applied to master, thanks.
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Raphaël Mélotte via buildroot
AppliedIn reply of:
Quoted 44 lines
The build fails with gcc 14, first with:
action.c: In function ‘fm_load_all_actions’:
action.c:2050:25: error: assignment to ‘gchar **’ {aka ‘char **’} from incompatible pointer type ‘const gchar * const*’ {aka ‘const char * const*’} [-Wincompatible-pointer-types]
2050 | _tmp2_ = _tmp1_ =g_get_system_data_dirs();
| ^This is an issue in the pre-generated C code, generated from Vala so we cannot easily fix it. Since it's apparently used for some "old actions" code, we simply disable it.
Then the build fails with:
gtk/fm-dnd-dest.c:461:13: error: assignment to ‘GtkMenu *’ {aka ‘struct_GtkMenu*’} from incompatible pointer type ‘GtkWidget *’ {aka ‘struct_GtkWidget*’} [-Wincompatible-pointer-types]
| ^and:
base/fm-dummy-monitor.c:48:22: error: assignment to ‘gboolean (*)(GFileMonitor *)’ {aka ‘int (*)(struct_GFileMonitor*)’} from incompatible pointer type ‘gboolean (*)(void)’ {aka ‘int (*)(void)’} [-Wincompatible-pointer-types]
| ^Both of which are fixed by backporting upstream patches.
There are no autobuilder failures, but the build failure can be reproduced using:
BR2_aarch64=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y BR2_TOOLCHAIN_EXTERNAL_URL="http://toolchains.bootlin.com/downloads/releases/toolchains/aarch64/tarballs/aarch64--glibc--stable-2025.08-1.tar.xz" BR2_TOOLCHAIN_EXTERNAL_GCC_14=y
BR2_TOOLCHAIN_EXTERNAL_HEADERS_5_4=y
BR2_TOOLCHAIN_EXTERNAL_CUSTOM_GLIBC=y
#BR2_TOOLCHAIN_EXTERNAL_INET_RPCis not set
BR2_TOOLCHAIN_EXTERNAL_CXX=y
BR2_TOOLCHAIN_EXTERNAL_OPENMP=y
BR2_PACKAGE_MESA3D=y
BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_SOFTPIPE=y
BR2_PACKAGE_MESA3D_OPENGL_GLX=y
BR2_PACKAGE_XORG7=y
BR2_PACKAGE_PCMANFM=y
Quoted 3 lines
With this fix, libfm builds fine up to and including gcc 16.
Signed-off-by Thomas Petazzoni <[email protected]>
Applied to 2025.02.x, 2026.08.x. Thanks
Quoted 121 lines
--- ...14-Werror-incompatible-pointer-types.patch | 61 +++++++++++++++++++ ...ion-argument-fix-for-C23-conformance.patch | 35 +++++++++++ package/libfm/libfm.mk | 2 +- 3 files changed, 97 insertions(+), 1 deletion(-) create mode 100644 package/libfm/0002-FIX-support-gcc14-Werror-incompatible-pointer-types.patch create mode 100644 package/libfm/0003-FIX-function-argument-fix-for-C23-conformance.patchpackage/libfm/0002-FIX-support-gcc14-Werror-incompatible-pointer-types.patch new file +61
-0@@ -0,0 +1,61 @@ +From 212de3e1f0072931a7862dfefe2ad818f622373b Mon Sep 17 00:00:00 2001 +From: Mamoru TASAKA <[email protected]> +Date: Fri, 1 Mar 2024 14:19:46 +0900 +Subject: [PATCH] FIX: support gcc14 -Werror=incompatible-pointer-types + +gcc14 now defaults to -Werror=incompatible-pointer-types . +To support this, cast GTK related objects for assignment +properly. + +Fixes #100 . + +Upstream: https://github.com/lxde/libfm/commit/fbcd183335729fa3e8dd6a837c13a23ff3271000 +Signed-off-by: Thomas Petazzoni <[email protected]> +--- + src/gtk/exo/exo-icon-view.c | 2 +- + src/gtk/fm-dnd-dest.c | 2 +- + src/gtk/fm-standard-view.c | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/gtk/exo/exo-icon-view.c b/src/gtk/exo/exo-icon-view.c +index 3ce98099..79e1c7ab 100644 +--- a/src/gtk/exo/exo-icon-view.c ++++ b/src/gtk/exo/exo-icon-view.c +@@ -2819,7 +2819,7 @@ exo_icon_view_key_press_event (GtkWidget *widget, + /* allocate a new event to forward */ + new_event = gdk_event_copy ((GdkEvent *) event); + g_object_unref (G_OBJECT (new_event->key.window)); +- new_event->key.window = g_object_ref (G_OBJECT (gtk_widget_get_window (icon_view->priv->search_entry))); ++ new_event->key.window = GDK_WINDOW(g_object_ref (G_OBJECT (gtk_widget_get_window (icon_view->priv->search_entry)))); + + /* send the event to the search entry. If the "preedit-changed" signal is + * emitted during this event, priv->search_imcontext_changed will be set. +diff --git a/src/gtk/fm-dnd-dest.c b/src/gtk/fm-dnd-dest.c +index 95d310d3..ce752758 100644 +--- a/src/gtk/fm-dnd-dest.c ++++ b/src/gtk/fm-dnd-dest.c +@@ -458,7 +458,7 @@ static GdkDragAction _ask_action_on_drop(GtkWidget *widget, + gtk_action_set_sensitive(act, FALSE); + } + } +- ri.menu = g_object_ref(gtk_ui_manager_get_widget(ui, "/popup")); ++ ri.menu = GTK_MENU(g_object_ref(gtk_ui_manager_get_widget(ui, "/popup"))); + g_signal_connect(ri.menu, "selection-done", G_CALLBACK(gtk_widget_destroy), NULL); + unmap_handler = g_signal_connect(ri.menu, "unmap", + G_CALLBACK(run_unmap_handler), &ri); +diff --git a/src/gtk/fm-standard-view.c b/src/gtk/fm-standard-view.c +index e0ff5a06..df920254 100644 +--- a/src/gtk/fm-standard-view.c ++++ b/src/gtk/fm-standard-view.c +@@ -637,7 +637,7 @@ static inline void create_icon_view(FmStandardView* fv, GList* sels) + "text", FM_FOLDER_MODEL_COL_NAME ); + if(fv->renderer_text) + g_object_unref(fv->renderer_text); +- fv->renderer_text = g_object_ref_sink(render); ++ fv->renderer_text = FM_CELL_RENDERER_TEXT(g_object_ref_sink(render)); + exo_icon_view_set_search_column((ExoIconView*)fv->view, FM_FOLDER_MODEL_COL_NAME); + g_signal_connect(fv->view, "item-activated", G_CALLBACK(on_icon_view_item_activated), fv); + g_signal_connect(fv->view, "selection-changed", G_CALLBACK(on_sel_changed), fv); +-- +2.56.0 +package/libfm/0003-FIX-function-argument-fix-for-C23-conformance.patch new file +35
-0@@ -0,0 +1,35 @@ +From 9e9ea4c131fcd611ae5a91c7f6a4d9cf63043442 Mon Sep 17 00:00:00 2001 +From: Mamoru TASAKA <[email protected]> +Date: Tue, 14 Jan 2025 18:00:03 +0900 +Subject: [PATCH] FIX: function argument fix for C23 conformance + +C23 now regards function declaration without a parameter list +as that with no parameter (i.e. having `(void)`). + +Specify parameter list explicitly to make code C23 +conformant. + +Closes #106 . + +Upstream: https://github.com/lxde/libfm/commit/dff442bd58b61c8afdf8cbd17f918bcaed40ddc2 +Signed-off-by: Thomas Petazzoni <[email protected]> +--- + src/base/fm-dummy-monitor.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/base/fm-dummy-monitor.c b/src/base/fm-dummy-monitor.c +index 6ece1fcc..cf1bcf89 100644 +--- a/src/base/fm-dummy-monitor.c ++++ b/src/base/fm-dummy-monitor.c +@@ -37,7 +37,7 @@ + + G_DEFINE_TYPE(FmDummyMonitor, fm_dummy_monitor, G_TYPE_FILE_MONITOR); + +-static gboolean cancel() ++static gboolean cancel(GFileMonitor *) + { + return TRUE; + } +-- +2.56.0 +package/libfm/libfm.mk +0
-0
package/libfm/libfm.mk LIBFM_LICENSE_FILES = COPYING src/extra/fm-xml-file.c · line 19
Quoted 8 lines
package/libfm/libfm.mk +1
-1@@ -13,7 +13,7 @@ LIBFM_LICENSE_FILES = COPYING src/extra/fm-xml-file.c LIBFM_INSTALL_STAGING = YES # We're patching src/modules/Makefile.am LIBFM_AUTORECONF = YES -LIBFM_CONF_OPTS = --with-gtk=3 +LIBFM_CONF_OPTS = --with-gtk=3 --disable-old-actions ifeq ($(BR2_PACKAGE_LIBEXIF),y) LIBFM_CONF_OPTS += --enable-exif
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot