Closed Bug 1516642 Opened 6 years ago Closed 6 years ago

local builds fail with ~/.mozbuild/android-ndk-r15c/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: hidden symbol 'arc4random_buf' is not defined locally

Categories

(Firefox Build System :: Android Studio and Gradle Integration, defect)

defect
Not set
blocker

Tracking

(firefox-esr60 wontfix, firefox65 wontfix, firefox66 wontfix, firefox67 fixed)

RESOLVED FIXED
mozilla67
Tracking Status
firefox-esr60 --- wontfix
firefox65 --- wontfix
firefox66 --- wontfix
firefox67 --- fixed

People

(Reporter: mac198442, Assigned: glandium)

References

Details

(Keywords: regression)

Attachments

(1 file, 1 obsolete file)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:66.0) Gecko/20100101 Firefox/66.0 Steps to reproduce: Try to build Fennec using current trunk and android-ndk-15c (the newest NDK that ever worked for me) Actual results: 104:33.57 /home/mac/.mozbuild/android-ndk-r15c/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: hidden symbol 'arc4random_buf' is not defined locally 105:19.14 /home/mac/.mozbuild/android-ndk-r15c/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: hidden symbol 'arc4random_buf' is not defined locally Expected results: The build should have completed
Severity: normal → blocker
hg bisect identified this: The first bad revision is: changeset: 451973:e63ef8bbd6a1 user: Peter Van der Beken <peterv@propagandism.org> date: Thu Dec 27 15:13:11 2018 +0000 summary: Bug 1374012 - Update to Expat 2.2.1. Part 2a: Better hashing. r=erahm
Has Regression Range: --- → yes
Keywords: regression
Flags: needinfo?(peterv)
I suspect something like what was done in bug 1282141 is now required in parser/expat/lib/xmlparse.c.
(In reply to mac198442 from comment #3) > I suspect something like what was done in bug 1282141 is now required in > parser/expat/lib/xmlparse.c. Yeah, sadly, looks like this is needed here as well. We probably don't see that in automation 'cuz we're using our own clang builds and newer headers.
Is there a workaround for this beyond using a pre-{bug 1374012] m-c? Having to do so is becoming more and more unwieldy as time passes.
(In reply to Botond Ballo [:botond] from comment #6) > Is there a workaround for this beyond using a pre-{bug 1374012] m-c? Having > to do so is becoming more and more unwieldy as time passes. I tried running |mach bootstrap| to update my NDK, but that just resulted in a different linker error (bug 1517875).
You can try this: diff --git a/parser/expat/lib/xmlparse.c b/parser/expat/lib/xmlparse.c --- a/parser/expat/lib/xmlparse.c +++ b/parser/expat/lib/xmlparse.c @@ -834,17 +834,17 @@ ENTROPY_DEBUG(const char * label, unsign return entropy; } static unsigned long generate_hash_secret_salt(XML_Parser parser) { unsigned long entropy; (void)parser; -#if defined(HAVE_ARC4RANDOM_BUF) || defined(__CloudABI__) +#if !defined(__ANDROID__) && (defined(HAVE_ARC4RANDOM_BUF) || defined(__CloudABI__)) (void)gather_time_entropy; arc4random_buf(&entropy, sizeof(entropy)); return ENTROPY_DEBUG("arc4random_buf", entropy); #else /* Try high quality providers first .. */ #ifdef _WIN32 if (writeRandomBytes_RtlGenRandom((void *)&entropy, sizeof(entropy))) { return ENTROPY_DEBUG("RtlGenRandom", entropy);
I ended up manually downloading NDK r18b, and was able to successfully build with that.
How odd perhaps I should investigate why my NDK r18b builds fail.
I should have mentioned in comment #8 that i can successfully build with NDK r15c with this patch applied.

We are hitting that as well preparing Tor Browser builds for Android for the upcoming release.

Status: UNCONFIRMED → NEW
Ever confirmed: true

Setting the right dependency in the hope that it saves at least someone else some time when hitting this bug.

Blocks: 1374012

(In reply to Georg Koppen from comment #12)

We are hitting that as well preparing Tor Browser builds for Android for the upcoming release.

Just FYI: I would be most pleased if Tor for Android used the same configuration that m-c does, namely what is produced by the mach bootstrap changes in Bug 1477487.

Assignee: nobody → mh+mozilla
Attachment #9042042 - Attachment is obsolete: true

The function has been in bionic (Android's libc since the first commit
in the upstream repository), but it's not been in stdlib.h until
recently. As it happens, we have a similar declaration in
xpcom/base/nsUUIDGenerator.cpp.

Flags: needinfo?(peterv)
Pushed by mh@glandium.org: https://hg.mozilla.org/integration/autoland/rev/57664c81a1de Add a function declaration for arc4random_buf in expat. r=peterv
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 67

Is this something we should backport to 66 to avoid downstream bustage after it goes to release?

Flags: needinfo?(mh+mozilla)

Are there downstreams building fennec with NDK r15c?

Flags: needinfo?(mh+mozilla)
Flags: needinfo?(ryanvm)

I have no clue, that's why I asked you :). If you don't think it's likely to be an issue, I'm perfectly fine with leaving things as-is.

Flags: needinfo?(ryanvm)

(In reply to Mike Hommey [:glandium] from comment #20)

Are there downstreams building fennec with NDK r15c?

The only downstream I'm aware of building Fennec is f-droid, but I can't find their build process definition/logs right now.

I know only two downstreams of fennec: fennec_fdroid and icecat. Both are built on f-droid. The latter is based on ESR, so is not affected. The former builds 65 with NDK 19 according to https://gitlab.com/fdroid/fdroiddata/blob/master/metadata/org.mozilla.fennec_fdroid.txt so, is not affected either.

Product: Firefox for Android → Firefox Build System
Target Milestone: Firefox 67 → mozilla67
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: