Bug#604603: gobject-introspection: invalid alignment assumptions

Thorsten Glaser tg at mirbsd.de
Sat Oct 15 13:57:23 UTC 2011


tags 604603 + patch
thanks

Hi,

here’s the promised patch; also submitted upstream.
It’s really just counting the octets right and being
explicit about any padding.

bye,
//mirabilos
-- 
In traditional syntax ' is ignored, but in c99 everything between two ' is
handled as character constant.  Therefore you cannot use ' in a preproces-
sing file in c99 mode.	-- Ragge
No faith left in ISO C99, undefined behaviour, etc.
-------------- next part --------------
diff -Nru gobject-introspection-0.10.8/debian/changelog gobject-introspection-0.10.8/debian/changelog
--- gobject-introspection-0.10.8/debian/changelog	2011-06-25 00:47:00.000000000 +0000
+++ gobject-introspection-0.10.8/debian/changelog	2011-10-15 11:45:34.000000000 +0000
@@ -1,3 +1,9 @@
+gobject-introspection (0.10.8-2+m68k.1) unreleased; urgency=low
+
+  * Fix invalid alignment assumptions. (Closes: #604603)
+
+ -- Thorsten Glaser <tg at mirbsd.de>  Sat, 15 Oct 2011 11:44:25 +0000
+
 gobject-introspection (0.10.8-2) unstable; urgency=low
 
   * debian/watch: Switch to .bz2 tarballs.
diff -Nru gobject-introspection-0.10.8/debian/patches/fix-alignment gobject-introspection-0.10.8/debian/patches/fix-alignment
--- gobject-introspection-0.10.8/debian/patches/fix-alignment	1970-01-01 00:00:00.000000000 +0000
+++ gobject-introspection-0.10.8/debian/patches/fix-alignment	2011-10-15 11:57:31.000000000 +0000
@@ -0,0 +1,41 @@
+Description: Fix invalid alignment assumptions
+ The current source has invalid assumptions about structure alignment
+ that break on m68k because 32-bit quantities require only 16-bit
+ alignment there. Fix this by introducing explicit structure padding
+ to make the binary representation generated by the compiler match
+ the text of the specification exactly.
+Author: Thorsten Glaser <tg at mirbsd.de>
+Bug-Debian: http://bugs.debian.org/604603
+Origin: Andreas Schwab <schwab at linux-m68k.org>
+Bug: https://bugzilla.gnome.org/show_bug.cgi?id=661839
+
+--- gobject-introspection-0.10.8.orig/girepository/gitypelib-internal.h
++++ gobject-introspection-0.10.8/girepository/gitypelib-internal.h
+@@ -282,7 +282,7 @@ typedef struct {
+   guint32 sections;
+ 
+   /* <private> */
+-  guint16 padding[5];
++  guint16 padding[6];
+ } Header;
+ 
+ typedef enum {
+@@ -431,6 +431,9 @@ typedef struct {
+   /* <public> */
+   gint8        closure;
+   gint8        destroy;
++  /* <private> */
++  guint16      padding;
++  /* <public> */
+ 
+   SimpleTypeBlob arg_type;
+ } ArgBlob;
+@@ -1061,6 +1064,8 @@ typedef struct {
+   guint16 n_vfuncs;
+   guint16 n_constants;
+ 
++  guint16 padding;
++
+   guint32 reserved2;
+   guint32 reserved3;
+ 
diff -Nru gobject-introspection-0.10.8/debian/patches/series gobject-introspection-0.10.8/debian/patches/series
--- gobject-introspection-0.10.8/debian/patches/series	1970-01-01 00:00:00.000000000 +0000
+++ gobject-introspection-0.10.8/debian/patches/series	2011-10-15 11:50:01.000000000 +0000
@@ -0,0 +1 @@
+fix-alignment
diff -Nru gobject-introspection-0.10.8/debian/rules gobject-introspection-0.10.8/debian/rules
--- gobject-introspection-0.10.8/debian/rules	2011-06-24 23:10:53.000000000 +0000
+++ gobject-introspection-0.10.8/debian/rules	2011-10-15 11:51:26.000000000 +0000
@@ -31,3 +31,5 @@
 	rm -rf $(CURDIR)/.cache
 	rm -f debian/dh_girepository.1
 	find . -name '*.pyc' -delete
+	# generated file not removed by make clean
+	rm -f giscanner/scannerlexer.c


More information about the pkg-gnome-maintainers mailing list