GNOME Bugzilla – Bug 775909
fails to build on armel, armhf, mipsel with alignment issues
Last modified: 2017-11-26 01:38:23 UTC
sysprof has been failing to build on those architectures. An old build log is available e.g. for armel at [1]. In order to fix those build failures, Andreas Henriksson applied a patch [2] which made the package build successfully on those architecture. The latest upstream release 3.22.3 saw some changes in that regard, which were supposed to fix those issues [3]. The Debian patch no longer applies to 3.22.3 after those changes. Unfortunately, the upstream fix is not sufficient. I still get build failures with a pristine 3.22.3 tarball: /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. -Wdate-time -D_FORTIFY_SOURCE=2 -I./util -pthread -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/arm-linux-gnueabi/glib-2.0/include -pthread -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/arm-linux-gnueabi/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/glib-2.0 -I/usr/lib/arm-linux-gnueabi/glib-2.0/include -pthread -I/usr/include/polkit-1 -I/usr/include/glib-2.0 -I/usr/lib/arm-linux-gnueabi/glib-2.0/include -fno-strict-aliasing -Wall -Wextra -Wundef -Wnested-externs -Wwrite-strings -Wpointer-arith -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wno-unused-parameter -Wno-missing-field-initializers -Wdeclaration-after-statement -Wformat=2 -Wold-style-definition -Wcast-align -Wformat-nonliteral -Wformat-security -Wsign-compare -Wstrict-aliasing -Wshadow -Winline -Wpacked -Wmissing-format-attribute -Wmissing-noreturn -Winit-self -Wmissing-include-dirs -Wunused-but-set-variable -Warray-bounds -Wimplicit-function-declaration -Wreturn-type -Wswitch-enum -Wswitch-default -Werror -Wno-suggest-attribute=format -Wno-error=unused-parameter -Wno-error=missing-field-initializers -g -O2 -fdebug-prefix-map=/home/biebl/build/sysprof-3.22.3=. -fstack-protector-strong -Wformat -Werror=format-security -std=gnu11 -c -o libsysprof_ui_2_la-sp-cpu-visualizer-row.lo `test -f 'sp-cpu-visualizer-row.c' || echo './'`sp-cpu-visualizer-row.c libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -Wdate-time -D_FORTIFY_SOURCE=2 -I./util -pthread -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/arm-linux-gnueabi/glib-2.0/include -pthread -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/arm-linux-gnueabi/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/glib-2.0 -I/usr/lib/arm-linux-gnueabi/glib-2.0/include -pthread -I/usr/include/polkit-1 -I/usr/include/glib-2.0 -I/usr/lib/arm-linux-gnueabi/glib-2.0/include -fno-strict-aliasing -Wall -Wextra -Wundef -Wnested-externs -Wwrite-strings -Wpointer-arith -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wno-unused-parameter -Wno-missing-field-initializers -Wdeclaration-after-statement -Wformat=2 -Wold-style-definition -Wcast-align -Wformat-nonliteral -Wformat-security -Wsign-compare -Wstrict-aliasing -Wshadow -Winline -Wpacked -Wmissing-format-attribute -Wmissing-noreturn -Winit-self -Wmissing-include-dirs -Wunused-but-set-variable -Warray-bounds -Wimplicit-function-declaration -Wreturn-type -Wswitch-enum -Wswitch-default -Werror -Wno-suggest-attribute=format -Wno-error=unused-parameter -Wno-error=missing-field-initializers -g -O2 -fdebug-prefix-map=/home/biebl/build/sysprof-3.22.3=. -fstack-protector-strong -Wformat -Werror=format-security -std=gnu11 -c sp-cpu-visualizer-row.c -fPIC -DPIC -o .libs/libsysprof_ui_2_la-sp-cpu-visualizer-row.o In file included from /usr/include/glib-2.0/gobject/gobject.h:24:0, from /usr/include/glib-2.0/gobject/gbinding.h:29, from /usr/include/glib-2.0/glib-object.h:23, from sp-capture-types.h:25, from sp-capture-condition.h:22, from sp-cpu-visualizer-row.c:21: sp-zoom-manager.h: In function 'SP_ZOOM_MANAGER': /usr/include/glib-2.0/gobject/gtype.h:2207:6: error: cast increases required alignment of target type [-Werror=cast-align] ((ct*) g_type_check_instance_cast ((GTypeInstance*) ip, gt)) ^ /usr/include/glib-2.0/gobject/gtype.h:479:66: note: in expansion of macro '_G_TYPE_CIC' #define G_TYPE_CHECK_INSTANCE_CAST(instance, g_type, c_type) (_G_TYPE_CIC ((instance), (g_type), c_type)) ^~~~~~~~~~~ /usr/include/glib-2.0/gobject/gtype.h:1399:12: note: in expansion of macro 'G_TYPE_CHECK_INSTANCE_CAST' return G_TYPE_CHECK_INSTANCE_CAST (ptr, module_obj_name##_get_type (), ModuleObjName); } \ ^~~~~~~~~~~~~~~~~~~~~~~~~~ sp-zoom-manager.h:30:1: note: in expansion of macro 'G_DECLARE_FINAL_TYPE' G_DECLARE_FINAL_TYPE (SpZoomManager, sp_zoom_manager, SP, ZOOM_MANAGER, GObject) ^~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors Makefile:1171: recipe for target 'libsysprof_ui_2_la-sp-cpu-visualizer-row.lo' failed I do have access to various porter boxes. So if you want me to try some patches, please let me know. [1] https://buildd.debian.org/status/fetch.php?pkg=sysprof&arch=armel&ver=3.22.1-1&stamp=1476529667 [2] http://sources.debian.net/src/sysprof/3.22.2-1/debian/patches/fix-arm-mipsel-alignment.patch/ [3] https://git.gnome.org/browse/sysprof/commit/?id=63579451b5073b9ce3e7167bea5db2872d9c353d
This looks to be a warning caused by the compilers inability to determine that GLib is returning an object that is guaranteed to be 2-pointer aligned. The code works fine, just the -Wcast-align is over-zealous in this case. I've filed bug 776028 in the GLib product to track the issue.
Michael, is this fixed by https://git.gnome.org/browse/sysprof/commit/?id=63579451 Debian stretch uses a variant of that patch named fix-arm-mipsel-alignment.patch.
Pretty sure we fixed these a while back.