Opened 8 months ago

Closed 8 months ago

#29182 closed defect (fixed)

Release candidate build breaks on Android with "error: hidden symbol 'arc4random_buf' is not defined locally"

Reported by: gk Owned by: tbb-team
Priority: Immediate Milestone:
Component: Applications/Tor Browser Version:
Severity: Normal Keywords: TorBrowserTeam201901
Cc: sisbell, sysrqb, boklm, dcf Actual Points:
Parent ID: Points:
Reviewer: Sponsor:


23:03.28 /var/tmp/dist/android-toolchain/android-ndk/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
23:03.28 /var/tmp/dist/android-toolchain/android-ndk/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
23:03.28 clang++: error: linker command failed with exit code 1 (use -v to see invocation)
23:03.28 /var/tmp/build/firefox-6dde994c6580/config/ recipe for target '' failed
23:03.28 make[4]: *** [] Error 1

Child Tickets

Change History (10)

comment:1 Changed 8 months ago by gk

For some reason our Android build for 8.5a7 is suddenly broken. Any pointers how to fix this and where this comes from are appreciated. That's pretty weird. The nightly from today built fine it seems. Maybe it's just a "local" issue?

comment:2 Changed 8 months ago by gk

sysrqb notes that he encountered that yesterday when using the 8.0 branch. Given that our nightly with 8.5 this morning still succeeded this seems likely to be introduced by upstream in the point release.

comment:3 Changed 8 months ago by sysrqb

Quick update. I'm testing with this now-ish (seems somewhat promising):

diff --git a/parser/expat/lib/xmlparse.c b/parser/expat/lib/xmlparse.c
index 209f20e094dc..056974e1479d 100644
--- a/parser/expat/lib/xmlparse.c
+++ b/parser/expat/lib/xmlparse.c
@@ -839,7 +839,7 @@ generate_hash_secret_salt(XML_Parser parser)
   unsigned long entropy;
-#if defined(HAVE_ARC4RANDOM_BUF) || defined(__CloudABI__)
+#if (defined(HAVE_ARC4RANDOM_BUF) || defined(__CloudABI__)) && !defined(ANDROID)
   arc4random_buf(&entropy, sizeof(entropy));
   return ENTROPY_DEBUG("arc4random_buf", entropy);
Last edited 8 months ago by sysrqb (previous) (diff)

comment:5 in reply to:  4 Changed 8 months ago by sysrqb

Replying to omg:

Heh, nifty. Nice find, thanks. I guess that confirms (most of) my assumptions.

comment:6 Changed 8 months ago by dcf

Cc: dcf added

comment:7 Changed 8 months ago by sysrqb

Cc: dcf removed
 0:31.51 make[4]: Entering directory '/home/user/tor-browser/obj-x86-linux-android/parser/expat/lib'
 0:31.51 /home/user/android-toolchain/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -std=gnu99 --target=i686-linux-android -o xmlparse.o -c -I/home/user/tor-browser/obj-x86-linux-android/dist/system_wrappers -include /home/user/tor-browser/config/gcc_hidden.h -DNDEBUG=1 -DTRIMMED=1 -DHAVE_EXPAT_CONFIG_H -DSTATIC_EXPORTABLE_JS_API -DMOZ_HAS_MOZGLUE -DMOZILLA_INTERNAL_API -DIMPL_LIBXUL -I/home/user/tor-browser/parser/expat/lib -I/home/user/tor-browser/obj-x86-linux-android/parser/expat/lib -I/home/user/tor-browser/obj-x86-linux-android/dist/include -I/home/user/tor-browser/obj-x86-linux-android/dist/include/nspr -I/home/user/tor-browser/obj-x86-linux-android/dist/include/nss -fPIC -include /home/user/tor-browser/obj-x86-linux-android/mozilla-config.h -DMOZILLA_CLIENT -Qunused-arguments -isystem /home/user/android-toolchain/android-ndk/platforms/android-16/arch-x86/usr/include -isystem /home/user/android-toolchain/android-ndk/platforms/android-16/arch-x86/usr/include -gcc-toolchain /home/user/android-toolchain/android-ndk/toolchains/x86-4.9/prebuilt/linux-x86_64 -D__ANDROID_API__=16 -Qunused-arguments -Wall -Wempty-body -Wignored-qualifiers -Wpointer-arith -Wsign-compare -Wtype-limits -Wunreachable-code -Wunreachable-code-return -Wclass-varargs -Wloop-analysis -Wstring-conversion -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wformat -Wformat-security -Wno-gnu-zero-variadic-macro-arguments -fno-short-enums -fno-exceptions -fno-strict-aliasing -ffunction-sections -fdata-sections -fno-math-errno -pipe -g -Oz -fomit-frame-pointer  -MD -MP -MF .deps/xmlparse.o.pp   /home/user/tor-browser/parser/expat/lib/xmlparse.c

 0:31.94 /home/user/tor-browser/parser/expat/lib/xmlparse.c:844:3: warning: implicit declaration of function 'arc4random_buf' is invalid in C99 [-Wimplicit-function-declaration]
 0:31.94   arc4random_buf(&entropy, sizeof(entropy));
 0:31.94   ^

comment:8 Changed 8 months ago by sysrqb

Cc: dcf added

comment:9 Changed 8 months ago by omg

Keywords: TorBrowserTeam201901 added; TorBrowserTeam20901 removed

comment:10 Changed 8 months ago by gk

Resolution: fixed
Status: newclosed

Thanks to everyone who helped here! I took the proposed fix from bug 1516642 and applied it onto tor-browser-60.5.0esr-8.5-1 (commit 4d0f9fa5fdd5831fbc2e28cb6c7b1056bd4deeab). Not sure yet, if we want to have a better fix, but if so then we should engage in bug 1516642 and get it into upstream. Closing as we are done here.

Note: See TracTickets for help on using tickets.