Skip to content

Linking fails with "undefined symbol: __emutls_get_address" in Termux on Android #24589

@Spiffyk

Description

@Spiffyk

Zig Version

0.15.0-dev.1222+5fb36d260

Steps to Reproduce and Observed Behavior

  • Install the latest Termux
  • Install termux-chroot
  • Download Linux Zig master (0.15.0-dev.1222+5fb36d260 at the time of writing) for your device's architecture (aarch64 in my case)
  • Run termux-chroot (this gives you a structure more akin to FHS which solves some FileNotFound issues with Zig in general)
  • Create an empty project with zig init
  • Try to build it with zig build
  • Observe the error:
error: ld.lld: undefined symbol: __emutls_get_address
    note: referenced by debug.zig:687 (/home/zig-aarch64-linux-0.15.0-dev.1222+5fb36d260/lib/std/debug.zig:687)
    note:               .zig-cache/o/276a0aec3ab180d1d92269d96844e670/build_zcu.o:(debug.defaultPanic)
    note: referenced by debug.zig:689 (/home/zig-aarch64-linux-0.15.0-dev.1222+5fb36d260/lib/std/debug.zig:689)
    note:               .zig-cache/o/276a0aec3ab180d1d92269d96844e670/build_zcu.o:(debug.defaultPanic)
    note: referenced by debug.zig:712 (/home/zig-aarch64-linux-0.15.0-dev.1222+5fb36d260/lib/std/debug.zig:712)
    note:               .zig-cache/o/276a0aec3ab180d1d92269d96844e670/build_zcu.o:(debug.defaultPanic)
    note: referenced 10 more times

Possibly related past issues: #5921, #24236

Expected Behavior

The program compiles and links properly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugObserved behavior contradicts documented or intended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions