Bug#683464: iceweasel: FTBFS on m68k due to invalid alignment assumptions

Thorsten Glaser tg at mirbsd.de
Tue Jul 31 23:24:14 UTC 2012


Source: iceweasel
Version: 10.0.6esr-1
Tags: patch

Hi,

while building src:iceweasel (don't laugh please, libmozjs-dev is needed
as build dependency by a *lot* of packages) on Debian/m68k, the first
FTBFS (of how many to come, I don't know) occurs due to non-portable
alignment assumptions.

On m68k, the basic alignment unit is 2, as is the struct padding size,
even for larger types such as int or pointers, i.e. no "natural" align.

FAILURE:

g++ -o jsapi.o -c  -I./../../dist/system_wrappers_js -include ../../../js/src/config/gcc_hidden.h -DOSTYPE=\"Linux3.2.0-3+m68k\" -DOSARCH=Linux -DEXPORT_JS_API -DIMPL_MFBT -DJS_HAS_CTYPES -DDLL_PREFIX=\"lib\" -DDLL_SUFFIX=\".so\"  -I.  -I../../../js/src -I. -I./../../dist/include -I./../../dist/include/nsprpub  -I/usr/include/nspr  -I../../../js/src -I../../../js/src/assembler -I../../../js/src/yarr  -fPIC -D_FORTIFY_SOURCE=2 -fno-rtti -Wall -Wpointer-arith -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -Wcast-align -Wno-invalid-offsetof -Wno-variadic-macros -Werror=return-type -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -pthread -pipe  -DNDEBUG -DTRIMMED -g -O3 -freorder-blocks  -fomit-frame-pointer -DUSE_SYSTEM_MALLOC=1  -D_FORTIFY_SOURCE=2 -DMOZILLA_CLIENT -include ./js-confdefs.h -MD -MF .deps/jsapi.pp /tmp/buildd/iceweasel-10.0.6esr/js/src/jsapi.cpp
/tmp/buildd/iceweasel-10.0.6esr/js/src/jsapi.cpp: In member function 'bool JSAutoEnterCompartment::enter(JSContext*, JSObject*)':
/tmp/buildd/iceweasel-10.0.6esr/js/src/jsapi.cpp:1368:5: error: size of array 'js_static_assert101' is negative
make[5]: *** [jsapi.o] Error 1
make[5]: Leaving directory `/tmp/buildd/iceweasel-10.0.6esr/build-xulrunner/js/src'
make[4]: *** [libs_tier_js] Error 2
make[4]: Leaving directory `/tmp/buildd/iceweasel-10.0.6esr/build-xulrunner'
make[3]: *** [tier_js] Error 2
make[3]: Leaving directory `/tmp/buildd/iceweasel-10.0.6esr/build-xulrunner'
make[2]: *** [default] Error 2
make[2]: Leaving directory `/tmp/buildd/iceweasel-10.0.6esr/build-xulrunner'
dh_auto_build: make -j1 JS_READLINE=1 returned exit code 2
make[1]: *** [stamps/build-xulrunner] Error 2
make[1]: Leaving directory `/tmp/buildd/iceweasel-10.0.6esr'
make: *** [build] Error 2
dpkg-buildpackage: error: debian/rules build gave error exit status 2

FIX:

--- iceweasel-10.0.6esr/js/src/jsapi.h.orig	2012-07-31 23:16:25.000000000 +0000
+++ iceweasel-10.0.6esr/js/src/jsapi.h.new	2012-07-31 23:16:19.000000000 +0000
@@ -2279,7 +2279,11 @@ class JS_PUBLIC_API(JSAutoEnterCompartme
      * In practice, 32-bit Windows and Android get 16-word |bytes|, while
      * other platforms get 13-word |bytes|; m68k has special alignment rules.
      */
+#ifdef __m68k__
+    char bytes[46] __attribute__((__aligned__(4)));
+#else
     void* bytes[sizeof(void*) == 4 && MOZ_ALIGNOF(JSUint64) == 8 ? 16 : 13];
+#endif
 
     /*
      * This object may be in one of three states.  If enter() or


I am not 100% sure the fix is correct, as the data type differs.
At least jsapi.cpp now builds… as do some others.

Alternatively, you could add another data member to AutoCompartment
so it would become 48 bytes in size, and then use
    void* bytes[12];
on m68k via the same ifdef.

Thanks in advance for caring and applying the patch and all that follow,
//mirabilos
-- 
<Natureshadow> Dann mach ich git annex copy --to shore und fertig ist das
<Natureshadow> das ist ja viel cooler als ownCloud ...
<mirabilos> sag ich doch
<Natureshadow> ja wieso stimmt das denn immer was du sagst ...



More information about the pkg-mozilla-maintainers mailing list