Bug#696236: webkit: please add patch to make it build on m68k
Thorsten Glaser
tg at mirbsd.de
Tue Dec 18 14:22:40 UTC 2012
Source: webkit
Version: 1.8.1-3.3
Tags: patch
Hi,
please include the applied patch to make webkit build on Debian/m68k.
A short explanation:
• Source/JavaScriptCore/wtf/dtoa/utils.h needs a patch, in contrast
to qtwebkit which built unmodified, because it apparently was copied
from Google v8 which has a positive-list of known architectures,
and m68k was not among it. I’ve added a check for the FPU used on
the m68k architecture (which is the usual thing to do in this case,
instead of checking for the CPU, as the FPU macros are less in number
and more well-known) and the correct value (the 68881 uses an 80-bit
stack like the 80387).
• Bitfields: The webkit source contains a few cases where a .cpp file
contains a structure that’s supposed to be “of the same size” as a
public class, to put a higher barrier in front of people who would
let the classes grow in memory size. The “mock structures” use a
single “unsigned (int)” member for up to 32 bit of bitfields used
in the actual class, assuming that bitfields are padded to multiples
of 32 bit, which is not true on all architectures. For example, on
m68k, the padding is only to 16 bit, so that the class is actually
*smaller* than the “should be of same size” mock structure.
The (easier to maintain) fix here is to make the padding in the
classes explicit. I counted the number of bits used by the bitfields
and subtracted that from the next multiple of 32, then added a new
member “unused_bitfield” making them explicit. Similar changes have
already been applied to gobject-introspection.
• debian/rules: m68k is a low-memory architecture, so disabling -g is
almost needed (I could get qtwebkit to link with a total of 5G RAM
plus swap, but since RAM maxes out at 768 MiB, you can imagine the
pain involved).
Thanks for your consideration,
//mirabilos
--
"Using Lynx is like wearing a really good pair of shades: cuts out
the glare and harmful UV (ultra-vanity), and you feel so-o-o COOL."
-- Henry Nelson, March 1999
-------------- next part --------------
diff -Nru webkit-1.8.1/debian/changelog webkit-1.8.1/debian/changelog
--- webkit-1.8.1/debian/changelog 2012-09-13 23:39:57.000000000 +0200
+++ webkit-1.8.1/debian/changelog 2012-12-09 01:53:26.000000000 +0100
@@ -1,3 +1,10 @@
+webkit (1.8.1-3.3+m68k.1) unreleased; urgency=low
+
+ * debian/patches/m68k.patch: New, add support for m68k to dtoa.
+ * debian/rules: Disable debug symbols also for m68k.
+
+ -- Thorsten Glaser <tg at mirbsd.de> Sun, 09 Dec 2012 01:52:45 +0100
+
webkit (1.8.1-3.3) unstable; urgency=low
* Non-maintainer upload.
diff -Nru webkit-1.8.1/debian/patches/m68k.patch webkit-1.8.1/debian/patches/m68k.patch
--- webkit-1.8.1/debian/patches/m68k.patch 1970-01-01 01:00:00.000000000 +0100
+++ webkit-1.8.1/debian/patches/m68k.patch 2012-12-12 19:14:58.000000000 +0100
@@ -0,0 +1,47 @@
+# DP: port webkit-gtk to m68k
+# DP: - part 1 -
+# DP: port dtoa code to m68k
+# DP: while there are instructions to force a 64bit wide stack,
+# DP: we have refrained from using them in e.g. Python already,
+# DP: because they are not reliable on all supported subtargets
+# DP: - part 2 -
+# DP: make invalid alignment assumptions explicit by providing
+# DP: explicit padding to get the bitfield the same size as an
+# DP: "unsigned" as used in class SameSizeAsStylePropertySet
+# DP: and SameSizeAsRenderStyle
+
+--- a/Source/JavaScriptCore/wtf/dtoa/utils.h
++++ b/Source/JavaScriptCore/wtf/dtoa/utils.h
+@@ -58,6 +58,9 @@ defined(_MIPS_ARCH_MIPS32R2)
+ #else
+ #undef DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS
+ #endif // _WIN32
++#elif defined(__MC68881__) || defined(__HAVE_68881__)
++/* m68k usually uses an 80bit wide FPU stack. */
++#undef DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS
+ #else
+ #error Target architecture was not detected as supported by Double-Conversion.
+ #endif
+--- a/Source/WebCore/css/StylePropertySet.h
++++ b/Source/WebCore/css/StylePropertySet.h
+@@ -143,6 +143,8 @@ private:
+
+ bool m_strictParsing : 1;
+ mutable bool m_hasCSSOMWrapper : 1;
++ /* all of the above plus the dummy below should add up to 32 */
++ unsigned unused_bitfield : 30;
+
+ CSSStyleSheet* m_contextStyleSheet;
+
+--- a/Source/WebCore/rendering/style/RenderStyle.h
++++ b/Source/WebCore/rendering/style/RenderStyle.h
+@@ -266,6 +266,9 @@ protected:
+ // CSS Text Layout Module Level 3: Vertical writing support
+ unsigned m_writingMode : 2; // WritingMode
+ // 45 bits
++
++ /* all of the above plus the dummy below should add up to 64 */
++ unsigned unused_bitfield : 19;
+ } inherited_flags;
+
+ // don't inherit
diff -Nru webkit-1.8.1/debian/patches/series webkit-1.8.1/debian/patches/series
--- webkit-1.8.1/debian/patches/series 2012-05-24 03:55:35.000000000 +0200
+++ webkit-1.8.1/debian/patches/series 2012-12-09 01:54:01.000000000 +0100
@@ -1,3 +1,4 @@
02_notebook_scroll.patch
10_kfreebsd_support.patch
-11_hurd_support.patch
\ No newline at end of file
+11_hurd_support.patch
+m68k.patch
diff -Nru webkit-1.8.1/debian/rules webkit-1.8.1/debian/rules
--- webkit-1.8.1/debian/rules 2012-09-13 23:12:20.000000000 +0200
+++ webkit-1.8.1/debian/rules 2012-12-09 01:52:40.000000000 +0100
@@ -29,7 +29,7 @@
LDFLAGS += -Wl,--no-relax
endif
-ifneq (,$(findstring $(DEB_BUILD_ARCH),ia64 mips mipsel s390 s390x hurd-i386))
+ifneq (,$(findstring $(DEB_BUILD_ARCH),ia64 m68k mips mipsel s390 s390x hurd-i386))
CFLAGS := $(CFLAGS:-g=)
endif
More information about the Pkg-webkit-maintainers
mailing list