Package: libmozjs-dev
Version: 1.8.1.14-3
Severity: normal
File: /usr/lib/pkgconfig/xulrunner-js.pc

/usr/include/mozjs/jsapi.h contains #ifdefs that change the size
of struct JSFunctionSpec depending on whether MOZILLA_1_8_BRANCH
is defined.  The xulrunner source package defines this macro in
configure.in.  However, when an application is built to use
mozjs, it seems none of the files in the libmozjs-dev package
gives the application any hint on whether it too should define
MOZILLA_1_8_BRANCH; grepping through all files in the package
shows this macro only in the #ifdefs themselves.  If the
application does not define this macro, it gets a definition of
JSFunctionSpec that does not match the compiled library.  Because
JS_DefineFunctions() takes an array of JSFunctionSpec as the last
parameter and finds its elements by pointer arithmetic, this
function is then likely to locate only the first element
correctly.

This actually happened to me with the upstream ELinks sources.
There was no crash but JS_DefineFunctions() just failed to define
the second of two functions.

Please change the libmozjs-dev package so that applications can
find out which preprocessor macros they need to define in order to
get definitions that are compatible with the installed library.
In xulrunner 1.8, I suggest adding a #define MOZILLA_1_8_BRANCH
in jsconfig.h, or alternatively to xulrunner-js.pc.  (ELinks does
not currently call pkg-config for mozjs but I can change that if
necessary.)  In xulrunner 1.9, I guess the incompatibility has
already disappeared; however, I ask you to keep this bug in mind
in case new #ifdefs are ever added to the structure definitions.

-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable'), (1, 
'experimental')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.24-1-686
Locale: LANG=fi_FI.UTF-8, LC_CTYPE=fi_FI.UTF-8 (charmap=UTF-8)

Versions of packages libmozjs-dev depends on:
ii  libmozjs0d                    1.8.1.14-3 The Mozilla SpiderMonkey JavaScrip
ii  libnspr4-dev                  4.6.7-1    Development files for the NetScape

libmozjs-dev recommends no packages.

-- no debconf information

Attachment: pgpXccXePMJEb.pgp
Description: PGP signature

Reply via email to