Discussion:
Bug#1079077: mozjs128: Fails to build on armel
(too old to reply)
Jeremy Bícha
2024-08-19 21:00:01 UTC
Permalink
Source: mozjs128
Version: 128.1.0-1
Severity: important
Tags: ftbfs
User: debian-***@lists.debian.org
Usertags: armel
X-Debbugs-CC: debian-***@lists.debian.org

mozjs128 fails to build on armel, apparently because of atomic
operations. Assistance is requested because we want to switch gjs from
mozjs115 to mozjs128 soon.

I attempted a very simple -latomic fix but it failed. mozjs has a more
complicated buildsystem so maybe I didn't set it in the right place.

https://salsa.debian.org/gnome-team/mozjs/-/commit/d5a129b11

Build log excerpt
==========
In file included from
/<<PKGBUILDDIR>>/js/src/jsapi-tests/testGCHeapBarriers.cpp:19:
/<<PKGBUILDDIR>>/js/src/jsapi-tests/tests.h: In member function
‘virtual void JSAPIRuntimeTest::maybeAppendException(JSAPITestString&)’:
/<<PKGBUILDDIR>>/js/src/jsapi-tests/tests.h:336:29: note: ‘s’ declared here
336 | JS::Rooted<JSString*> s(cx, JS::ToString(cx, v));
| ^
/<<PKGBUILDDIR>>/js/src/jsapi-tests/tests.h:328:55: note: ‘this’ declared here
328 | void maybeAppendException(JSAPITestString& message) override {
| ^~~~~~~~
/usr/bin/ld: ../../../js/src/build/libjs_static.a(Interpreter.o): in
function `std::__atomic_base<unsigned long long>::store(unsigned long
long, std::memory_order)':

Full build log
======
https://buildd.debian.org/status/package.php?p=mozjs128

Thank you,
Jeremy Bícha
Simon McVittie
2024-08-29 10:40:01 UTC
Permalink
Control: tags -1 + upstream pending
Control: forwarded -1 https://bugzilla.mozilla.org/show_bug.cgi?id=1915578
Post by Jeremy Bícha
I attempted a very simple -latomic fix but it failed. mozjs has a more
complicated buildsystem so maybe I didn't set it in the right place.
Adding -latomic to LDFLAGS will not usually work, because order matters:
if there are atomic operations in a static library, then the link line
needs to include "my-static-library.a -latomic" in that order. LDFLAGS
normally appear before all libraries, though.

The bug was that the build system tried to detect whether atomic operations
require -latomic, but due to a build system mistake it was actually
detecting whether atomic operations require ["-","l","a","t","o","m","i","c"]
which of course doesn't actually help.

After fixing this, there are still several test failures because the
SharedArrayBuffer feature is disabled, but I think it's better if we treat
those as a separate armel bug.

smcv

Loading...