[mips] /usr/bin/ld: libxul.so: hidden symbol `cacheflush' isn't defined

RESOLVED FIXED in Firefox 68



3 months ago
2 months ago


(Reporter: glandium, Assigned: glandium)



Firefox Tracking Flags

(firefox68 fixed, firefox69 fixed)



(2 attachments)

/usr/bin/ld: /<<PKGBUILDDIR>>/build-browser/mips64el-unknown-linux-gnuabi64/release/libgkrust.a(mdb.o): in function `mdb_page_flush':
/<<PKGBUILDDIR>>/third_party/rust/lmdb-rkv-sys/lmdb/libraries/liblmdb/mdb.c:3421: undefined reference to `cacheflush'
/usr/bin/ld: /<<PKGBUILDDIR>>/third_party/rust/lmdb-rkv-sys/lmdb/libraries/liblmdb/mdb.c:3421: undefined reference to `cacheflush'
/usr/bin/ld: /<<PKGBUILDDIR>>/build-browser/mips64el-unknown-linux-gnuabi64/release/libgkrust.a(mdb.o): in function `mdb_env_write_meta':
/<<PKGBUILDDIR>>/third_party/rust/lmdb-rkv-sys/lmdb/libraries/liblmdb/mdb.c:3919: undefined reference to `cacheflush'
/usr/bin/ld: /<<PKGBUILDDIR>>/third_party/rust/lmdb-rkv-sys/lmdb/libraries/liblmdb/mdb.c:3919: undefined reference to `cacheflush'
/usr/bin/ld: libxul.so: hidden symbol `cacheflush' isn't defined

The problem is we build mdb.c with all the hidden visibility things, but it contains a declaration for a system function, that it could, in fact, get from a system header instead.

Myk, how do we patch mdb.c?

Flags: needinfo?(myk)

We maintain a fork of LMDB at https://github.com/mozilla/lmdb, where the mdb.RE/0.9 branch tracks the upstream stable 0.9 release branch of LMDB and the mdb.RE/0.9-moz branch contains our fork of that branch.

To patch mdb.c, we need to

  1. make the change to the mdb.RE/0.9-moz branch;
  2. update the submodule reference in https://github.com/mozilla/lmdb-rs to point to the new tip of that branch;
  3. publish a new version of lmdb-rkv-sys (and possibly lmdb-rkv) to crates.io;
  4. update toolkit/library/rust/shared/Cargo.toml to require the new version of lmdb-rkv-sys.

If you submit the change in a PR for mozilla/lmdb, then I'll merge it, update mozilla/lmdb-rs, publish lmdb-rkv-sys, and submit a patch to update toolkit/library/rust/shared/Cargo.toml.

Flags: needinfo?(myk)


Note this is not enough to fix the issue. There's also a patch to config/system-headers.mozbuild that I'll attach here shortly.

Flags: needinfo?(myk)

The only change is a fix for building for mips.

(Clearing needinfo request, as I've merged https://github.com/mozilla/lmdb/pull/3.)

Flags: needinfo?(myk)
Pushed by mh@glandium.org:
Wrap the sys/cachectl.h system header on mips linux. r=froydnj
Update vendored lmdb-rkv-sys to 0.8.4. r=chmanchester

Comment on attachment 9070119 [details]
Bug 1557171 - Wrap the sys/cachectl.h system header on mips linux.

Beta/Release Uplift Approval Request

  • User impact if declined: Build failure on MIPS (tier 3). Would be nice to have in ESR68 for downstreams.
  • Is this code covered by automated tests?: No
  • Has the fix been verified in Nightly?: No
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Both patches are NPOTB. The second has a trivial conflict in Cargo.lock on beta, due to differences in the context. It can be applied with patch -F8 (maybe even -F7)
  • String changes made/needed:
Attachment #9070119 - Flags: approval-mozilla-beta?
Attachment #9070467 - Flags: approval-mozilla-beta?
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla69

Comment on attachment 9070119 [details]
Bug 1557171 - Wrap the sys/cachectl.h system header on mips linux.

tier3 build fix, approved for 68.0b10

Attachment #9070119 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Attachment #9070467 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
You need to log in before you can comment on or make changes to this bug.