Closed Bug 2070242 Opened 2 months ago Closed 2 months ago

Android x86_64 asan fuzzing build fails to link with clang 23

Categories

(Firefox Build System :: General, defect)

defect

Tracking

(firefox157 fixed)

RESOLVED FIXED
157 Branch
Tracking Status
firefox157 --- fixed

People

(Reporter: RyanVM, Assigned: RyanVM)

References

(Blocks 1 open bug)

Details

Attachments

(1 external file)

The android-x86_64-asan-fuzzing/opt build forces the bfd linker (bug 1855106) to hide undefined symbols that Rust's -nodefaultlibs linking model never resolves. Clang 23's Android driver now emits --pack-dyn-relocs=android for API levels 23-27 (our default MOZ_ANDROID_MIN_SDK_VERSION is 26), and bfd does not accept that flag, so the build fails outright once clang 23 is in use.

Switching back to lld (already the default linker for clang >= 15) reproduces the original problem bug 1855106 worked around, plus more: a pre-fix try run surfaced five undefined symbols, all referenced by libclang_rt.asan-x86_64-android.so:

__extendsftf2
__extenddftf2
__cxa_begin_catch
std::terminate()
__gxx_personality_v0

The first two are the symbols rust-lang/rust#109717 tracks (soft-float conversions normally supplied by libclang_rt.builtins, unavailable because rustc links with -nodefaultlibs); they still reproduce on rustc 1.95.0 despite the upstream compiler-builtins fix for that issue having merged in 2024. The last three are C++ exception-handling ABI symbols with no Rust-side fix possible, since Rust does not implement the Itanium C++ ABI.

-Wl,--allow-shlib-undefined suppresses both categories, so drop --enable-linker=bfd in mobile/android/config/mozconfigs/android-x86_64/nightly-fuzzing-asan and add export LDFLAGS="$LDFLAGS -Wl,--allow-shlib-undefined" in its place. Confirmed this compiles cleanly under both clang 22 (current default) and clang 23 (bug 2039813).

From talking to decoder, it sounds like we still want to keep these builds even if functionally they don't actually work, so this at least keeps them green in CI.

Bug 1855106 switched this build to bfd to hide libclang_rt.asan's undefined __extendsftf2/__extenddftf2
and C++ exception ABI symbols when linking Rust programs (rust-lang/rust#109717). clang 23's Android
driver passes --pack-dyn-relocs=android, which bfd does not accept. Switch back to lld, which already
rejects those same undefined symbols, and keep them tolerated with --allow-shlib-undefined instead.

Pushed by rvandermeulen@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/c62d4537b4b1 https://hg.mozilla.org/integration/autoland/rev/dc84efb73632 Stop forcing bfd for the Android x86_64 asan fuzzing build. r=firefox-build-system-reviewers,sergesanspaille
Status: NEW → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 157 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: