Recently a rc bug was filed on netsurf in the Debian bug tracking system
due to a build failure.
netsurf FTBFS if built against libgdk-píxbuf2.0-dev 2.31.4-1 which is currently
in unstable:
| COMPILE: gtk/window.c
| gtk/window.c:55:14: error: unknown type name 'GdkPixdata'
| extern const GdkPixdata menu_cursor_pixdata;
| ^
| gtk/window.c: In function 'nsgtk_create_menu_cursor':
| gtk/window.c:1057:2: warning: implicit declaration of function
'gdk_pixbuf_from_pixdata' [-Wimplicit-function-declaration]
| pixbuf = gdk_pixbuf_from_pixdata(&menu_cursor_pixdata, FALSE, NULL);
| ^
| gtk/window.c:1057:2: warning: nested extern declaration of
'gdk_pixbuf_from_pixdata' [-Wnested-externs]
| gtk/window.c:1057:9: warning: assignment makes pointer from integer without a
cast
| pixbuf = gdk_pixbuf_from_pixdata(&menu_cursor_pixdata, FALSE, NULL);
| ^
Sebastian Ramacher who filed the original patch proposed a debdiff to
fix this issue.
This issue is almost fixed upstream in [1]. In addition to this change, the
generated file also needs another include. A debdiff fixing this bug is
attached.
Cheers
[1]http://source.netsurf-browser.org/netsurf.git/commit/?id=a29e9589f6bd54e258805bef367528a18d7b0c2b
The debdiff he proposed can be found at
https://bugs.debian.org/cgi-bin/bugreport.cgi?msg=10;bug=786819;filename=netsurf.debdiff;att=1
Following a lack of maintainer response I uploaded Sebastian's debdiff
as a NMU. The debdiff for my first NMU can be found at
https://bugs.debian.org/cgi-bin/bugreport.cgi?att=1;bug=786819;msg=22;filename=netsurf.debdiff
, the only difference to Sebastian's proposed debdiff was indicating
myself as the uploader (and Sebastian as the change author)
Unfortunately the package then failed to build on arm64 with the
following error.
build-Linux-gtk/gtk_window.o: In function `nsgtk_create_menu_cursor':
/«BUILDDIR»/netsurf-3.2+dfsg/netsurf/gtk/window.c:1057:(.text+0x2cc):
relocation truncated to fit: R_AARCH64_LDST64_ABS_LO12_NC against symbol
`menu_cursor_pixdata' defined in .rodata section in
build-Linux-gtk/build-Linux-gtk_menu_cursor.o
collect2: error: ld returned 1 exit status
make[3]: *** [nsgtk] Error 1
I first tried -ffunction-sections which often fixes relocation errors
but made no differnce in this case so I removed it again. On closer
inspection I noticed an implicit declaration warning on
gdk_pixbuf_new_from_inline, further investigation showed that this was
deprecated.
Removing -DGDK_PIXBUF_DISABLE_DEPRECATED from Makefile.target fixed the
implicit declaration (which is a good thing, implicit declarations are
bad). Unfortunately it did not fix the link failure on arm64.
Even closer inspection revealed that the importextern declaration of
menu_cursor_pixdata in netsurf/gtk/window.c differed from the
declaration in the generated file netsurf/build-Linux-gtk/menu_cursor.c
. I changed the two to match and got a successful build on arm64.
While I was at it I also ran into incomplete cleanup in the clean target
causing an unrepresentable changes to source error and fixed that.
I then did a build and basic functionality test (run netsurf-gtk and
load slashdot) on amd64 and uploaded as a second NMU. I have attatched
two debdiffs to this mail, one covering the second NMU only and one
covering both NMUs
diff -Nru netsurf-3.2+dfsg/debian/changelog netsurf-3.2+dfsg/debian/changelog
--- netsurf-3.2+dfsg/debian/changelog 2014-08-29 22:59:03.000000000 +0100
+++ netsurf-3.2+dfsg/debian/changelog 2015-06-02 22:30:03.000000000 +0100
@@ -1,3 +1,24 @@
+netsurf (3.2+dfsg-2.2) unstable; urgency=medium
+
+ * Non-maintainer upload.
+ * Remove -DGDK_PIXBUF_DISABLE_DEPRECATED to avoid an implicit function
+ declaration issue that was thought to be the cause of an arm64 build
failure.
+ * Make declarations match between generated file and importing file for
+ menu_cursor_pixdata to fix arm64 build failure.
+ * Remove nsgenbind/build* in clean target to avoid "unrepresentable changes
+ to source" error.
+
+ -- Peter Michael Green <plugw...@debian.org> Tue, 02 Jun 2015 10:16:59 +0000
+
+netsurf (3.2+dfsg-2.1) unstable; urgency=medium
+
+ * Non-maintainer upload.
+ [Sebastian Ramacher]
+ * debian/patches/change-how-gdk-image.patch: Fix build against
+ libgdk-pixbuf2.0-dev 2.31.4. (Closes: #786819)
+
+ -- Peter Michael Green <plugw...@debian.org> Tue, 02 Jun 2015 01:00:37 +0000
+
netsurf (3.2+dfsg-2) unstable; urgency=medium
* Do not build with javascript support on s390x
diff -Nru netsurf-3.2+dfsg/debian/patches/change-how-gdk-image.patch
netsurf-3.2+dfsg/debian/patches/change-how-gdk-image.patch
--- netsurf-3.2+dfsg/debian/patches/change-how-gdk-image.patch 1970-01-01
01:00:00.000000000 +0100
+++ netsurf-3.2+dfsg/debian/patches/change-how-gdk-image.patch 2015-06-02
22:29:46.000000000 +0100
@@ -0,0 +1,78 @@
+Description: Change how GDK image resources are compiled in
+ The compiled in image resources were being created as a structure in a
+ generated c source file. The generation of this file caused constness
+ warning as a guint8 * was initialised from a const char array.
+ .
+ This changes the generation and use of these compiled in resources to
+ use the raw inline form as suggested by the documentation removing the
+ const warning.
+ .
+ In addition to the changes from a29e9589f6bd54e258805bef367528a18d7b0c2b, the
+ include in the generated file is changed to glib.h.
+ .
+ In addition to the above changes -DGDK_PIXBUF_DISABLE_DEPRECATED is removed
+ to avoid an implicit function declaration issue that was thought to be a
+ possible cause of a build failure on arm64 and is generally a bad thing.
+ .
+ In addition to the above changes make declarations match between generated
+ file and importing file for menu_cursor_pixdata to fix arm64 build
+ failure.
+Origin: upstream,
+
http://source.netsurf-browser.org/netsurf.git/commit/?id=a29e9589f6bd54e258805bef367528a18d7b0c2b
+Bug-Debian: https://bugs.debian.org/786819
+Last-Update: 2015-05-25
+
+Index: netsurf-3.2+dfsg/netsurf/gtk/Makefile.target
+===================================================================
+--- netsurf-3.2+dfsg.orig/netsurf/gtk/Makefile.target
++++ netsurf-3.2+dfsg/netsurf/gtk/Makefile.target
+@@ -38,8 +38,10 @@ GTKDEPFLAGS := -DG_DISABLE_SINGLE_INCLUD
+ -DGTK_DISABLE_SINGLE_INCLUDES \
+ -DGTK_DISABLE_DEPRECATED \
+ -DGTK_MULTIHEAD_SAFE \
+- -DPANGO_DISABLE_DEPRECATED \
+- -DGDK_PIXBUF_DISABLE_DEPRECATED
++ -DPANGO_DISABLE_DEPRECATED
++
++# change-how-gdk-image.patch uses gdk_pixbuf_new_from_inline which is
deprecated
++# -DGDK_PIXBUF_DISABLE_DEPRECATED
+
+ # libsexy currently means we cannot enable this
+ # -DGDK_DISABLE_DEPRECATED
+@@ -90,8 +92,8 @@ define convert_image
+ S_PIXBUF += $(2)
+
+ $(2): $(1)
+- $(Q)echo "#include <gdk-pixbuf/gdk-pixdata.h>" > $(2)
+- $(Q)gdk-pixbuf-csource --extern --struct --name=$(3) $(1) >> $(2) || \
++ $(Q)echo "#include <glib.h>" > $(2)
++ $(Q)gdk-pixbuf-csource --extern --raw --name=$(3) $(1) >> $(2) || \
+ ( rm -f $(2) && false )
+
+ endef
+Index: netsurf-3.2+dfsg/netsurf/gtk/window.c
+===================================================================
+--- netsurf-3.2+dfsg.orig/netsurf/gtk/window.c
++++ netsurf-3.2+dfsg/netsurf/gtk/window.c
+@@ -52,7 +52,11 @@
+ #define CONNECT(obj, sig, callback, ptr) \
+ g_signal_connect(G_OBJECT(obj), (sig), G_CALLBACK(callback), (ptr))
+
+-extern const GdkPixdata menu_cursor_pixdata;
++#ifdef __GNUC__
++extern const guint8 menu_cursor_pixdata[] __attribute__ ((__aligned__ (4)));
++#else
++extern const guint8 menu_cursor_pixdata[];
++#endif
+
+ struct gui_window {
+ /** The gtk scaffold object containing menu, buttons, url bar, [tabs],
+@@ -1054,7 +1058,7 @@ static GdkCursor *nsgtk_create_menu_curs
+ {
+ GdkCursor *cursor = NULL;
+ GdkPixbuf *pixbuf;
+- pixbuf = gdk_pixbuf_from_pixdata(&menu_cursor_pixdata, FALSE, NULL);
++ pixbuf = gdk_pixbuf_new_from_inline(-1, menu_cursor_pixdata, FALSE,
NULL);
+ cursor = gdk_cursor_new_from_pixbuf(gdk_display_get_default(), pixbuf,
0, 3);
+ g_object_unref (pixbuf);
+
diff -Nru netsurf-3.2+dfsg/debian/patches/series
netsurf-3.2+dfsg/debian/patches/series
--- netsurf-3.2+dfsg/debian/patches/series 2014-08-20 09:59:40.000000000
+0100
+++ netsurf-3.2+dfsg/debian/patches/series 2015-06-02 01:59:55.000000000
+0100
@@ -1,2 +1,3 @@
set-netsurf-config.patch
change-install-binary-targets
+change-how-gdk-image.patch
diff -Nru netsurf-3.2+dfsg/debian/rules netsurf-3.2+dfsg/debian/rules
--- netsurf-3.2+dfsg/debian/rules 2014-08-28 22:20:53.000000000 +0100
+++ netsurf-3.2+dfsg/debian/rules 2015-06-02 11:54:54.000000000 +0100
@@ -27,4 +27,4 @@
override_dh_auto_clean:
dh_auto_clean -- PREFIX=/usr TARGET=gtk
dh_auto_clean -- PREFIX=/usr TARGET=framebuffer
-
+ rm -rf nsgenbind/build*
diff -Nru netsurf-3.2+dfsg/debian/changelog netsurf-3.2+dfsg/debian/changelog
--- netsurf-3.2+dfsg/debian/changelog 2015-06-02 02:20:41.000000000 +0100
+++ netsurf-3.2+dfsg/debian/changelog 2015-06-02 22:30:03.000000000 +0100
@@ -1,3 +1,15 @@
+netsurf (3.2+dfsg-2.2) unstable; urgency=medium
+
+ * Non-maintainer upload.
+ * Remove -DGDK_PIXBUF_DISABLE_DEPRECATED to avoid an implicit function
+ declaration issue that was thought to be the cause of an arm64 build
failure.
+ * Make declarations match between generated file and importing file for
+ menu_cursor_pixdata to fix arm64 build failure.
+ * Remove nsgenbind/build* in clean target to avoid "unrepresentable changes
+ to source" error.
+
+ -- Peter Michael Green <plugw...@debian.org> Tue, 02 Jun 2015 10:16:59 +0000
+
netsurf (3.2+dfsg-2.1) unstable; urgency=medium
* Non-maintainer upload.
diff -Nru netsurf-3.2+dfsg/debian/patches/change-how-gdk-image.patch
netsurf-3.2+dfsg/debian/patches/change-how-gdk-image.patch
--- netsurf-3.2+dfsg/debian/patches/change-how-gdk-image.patch 2015-06-02
01:59:55.000000000 +0100
+++ netsurf-3.2+dfsg/debian/patches/change-how-gdk-image.patch 2015-06-02
22:29:46.000000000 +0100
@@ -9,14 +9,37 @@
.
In addition to the changes from a29e9589f6bd54e258805bef367528a18d7b0c2b, the
include in the generated file is changed to glib.h.
+ .
+ In addition to the above changes -DGDK_PIXBUF_DISABLE_DEPRECATED is removed
+ to avoid an implicit function declaration issue that was thought to be a
+ possible cause of a build failure on arm64 and is generally a bad thing.
+ .
+ In addition to the above changes make declarations match between generated
+ file and importing file for menu_cursor_pixdata to fix arm64 build
+ failure.
Origin: upstream,
http://source.netsurf-browser.org/netsurf.git/commit/?id=a29e9589f6bd54e258805bef367528a18d7b0c2b
Bug-Debian: https://bugs.debian.org/786819
Last-Update: 2015-05-25
---- a/netsurf/gtk/Makefile.target
-+++ b/netsurf/gtk/Makefile.target
-@@ -90,8 +90,8 @@
+Index: netsurf-3.2+dfsg/netsurf/gtk/Makefile.target
+===================================================================
+--- netsurf-3.2+dfsg.orig/netsurf/gtk/Makefile.target
++++ netsurf-3.2+dfsg/netsurf/gtk/Makefile.target
+@@ -38,8 +38,10 @@ GTKDEPFLAGS := -DG_DISABLE_SINGLE_INCLUD
+ -DGTK_DISABLE_SINGLE_INCLUDES \
+ -DGTK_DISABLE_DEPRECATED \
+ -DGTK_MULTIHEAD_SAFE \
+- -DPANGO_DISABLE_DEPRECATED \
+- -DGDK_PIXBUF_DISABLE_DEPRECATED
++ -DPANGO_DISABLE_DEPRECATED
++
++# change-how-gdk-image.patch uses gdk_pixbuf_new_from_inline which is
deprecated
++# -DGDK_PIXBUF_DISABLE_DEPRECATED
+
+ # libsexy currently means we cannot enable this
+ # -DGDK_DISABLE_DEPRECATED
+@@ -90,8 +92,8 @@ define convert_image
S_PIXBUF += $(2)
$(2): $(1)
@@ -27,18 +50,24 @@
( rm -f $(2) && false )
endef
---- a/netsurf/gtk/window.c
-+++ b/netsurf/gtk/window.c
-@@ -52,7 +52,7 @@
+Index: netsurf-3.2+dfsg/netsurf/gtk/window.c
+===================================================================
+--- netsurf-3.2+dfsg.orig/netsurf/gtk/window.c
++++ netsurf-3.2+dfsg/netsurf/gtk/window.c
+@@ -52,7 +52,11 @@
#define CONNECT(obj, sig, callback, ptr) \
g_signal_connect(G_OBJECT(obj), (sig), G_CALLBACK(callback), (ptr))
-extern const GdkPixdata menu_cursor_pixdata;
-+extern const guint8 *menu_cursor_pixdata;
++#ifdef __GNUC__
++extern const guint8 menu_cursor_pixdata[] __attribute__ ((__aligned__ (4)));
++#else
++extern const guint8 menu_cursor_pixdata[];
++#endif
struct gui_window {
/** The gtk scaffold object containing menu, buttons, url bar, [tabs],
-@@ -1054,7 +1054,7 @@
+@@ -1054,7 +1058,7 @@ static GdkCursor *nsgtk_create_menu_curs
{
GdkCursor *cursor = NULL;
GdkPixbuf *pixbuf;
diff -Nru netsurf-3.2+dfsg/debian/rules netsurf-3.2+dfsg/debian/rules
--- netsurf-3.2+dfsg/debian/rules 2014-08-28 22:20:53.000000000 +0100
+++ netsurf-3.2+dfsg/debian/rules 2015-06-02 11:54:54.000000000 +0100
@@ -27,4 +27,4 @@
override_dh_auto_clean:
dh_auto_clean -- PREFIX=/usr TARGET=gtk
dh_auto_clean -- PREFIX=/usr TARGET=framebuffer
-
+ rm -rf nsgenbind/build*