Skip to content

Android: lld: error: undefined symbol: __emutls_get_address #5921

@meme

Description

@meme

Seems that Android support has regressed, testing with Android NDK r20, the following missing symbol error occurs (presumably there are more):

lld: error: undefined symbol: __emutls_get_address
>>> referenced by debug.zig:253 (/zig/lib/std/debug.zig:253)
>>>               ./sample.o:(std.debug.panicExtra)
>>> referenced by debug.zig:255 (/zig/lib/std/debug.zig:255)
>>>               ./sample.o:(std.debug.panicExtra)
>>> referenced by debug.zig:284 (/zig/lib/std/debug.zig:284)
>>>               ./sample.o:(std.debug.panicExtra)

Can reproduce as follows (995fd73):

zig build-exe -target aarch64-linux-android --libc aarch64-linux-android.txt sample.zig

aarch64-linux-android.txt:

include_dir=$ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include
sys_include_dir=$ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include
static_crt_dir=$ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64/lib/gcc/aarch64-linux-android/4.9.x/
crt_dir=$ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/aarch64-linux-android/21

msvc_lib_dir=
kernel32_lib_dir=

Can't assign myself to an issue, but I'm taking a look at this currently. Question for the team though: how can we prevent regressions like this in the future?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementSolving this issue will likely involve adding new logic or components to the codebase.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions