Bug#1063446: libmozjs-115-dev: cannot call JS::CanonicalizeNaN(double) on mips64el

Simon McVittie smcv at debian.org
Thu Feb 8 10:37:33 GMT 2024


Package: libmozjs-115-dev
Version: 115.7.0-2
Severity: serious
Tags: upstream
Justification: makes gjs FTBFS (#1063433)
X-Debbugs-Cc: debian-mips at lists.debian.org
User: debian-mips at lists.debian.org
Usertags: mips64el
Control: block 1063433 by -1

Original steps to reproduce:
Try to compile gjs 1.78.3-1 (#1063433), which calls this public API:
double JS::CanonicalizeNaN(double)

Simplified steps to reproduce:
Try to compile the attached, with:
g++ test.cpp -o test $(pkgconf --cflags --libs mozjs-115)

Expected result:
gjs or the simplified test compiles, links and runs successfully

Actual result:
On amd64 and other architectures, linking succeeds.
On mips64el, linking fails:
/usr/bin/ld: /tmp/cc41qWiD.o: in function `main':
test.cpp:(.text+0x22c): undefined reference to `JS::detail::CanonicalizedNaNBits'

I think this is because mozjs has mips-specific code to detect which is
the preferred representation of NaN, with the result stored in a global
variable that is read by the inline function JS::CanonicalizeNaN(double);
but that global variable is not exported, so gjs cannot validly refer to it.

I'm preparing a possible patch (but it will take a long time to test,
because compiling mozjs on mips64el is extremely slow).

    smcv



More information about the pkg-gnome-maintainers mailing list