Skip to content

Undefined symbols ___cxa_guard_acquire and ___cxa_guard_release #4

@CRKatri

Description

@CRKatri
➜ make CC=aarch64-apple-darwin-clang STRIP=aarch64-apple-darwin-strip mkdir -p buildaarch64-apple-darwin-clang -arch arm64 -isysroot /home/cameron/Documents/SDK/iPhoneOS14.3.sdk -miphoneos-version-min=11.0 -fobjc-arc -DMAINTAINER='@"Zebra Team"' -DPREFIX='@""' -DEXECPREFIX='@"usr"' src/*.m -o build/firmware -Ibuild -framework Foundation -O3
Undefined symbols for architecture arm64:
  "___cxa_guard_acquire", referenced from:
      +[DeviceInfo sharedDevice] in DeviceInfo-0cbf38.o
      -[Firmware generatePackageListFile:] in Firmware-9fa4e8.o
      -[Firmware generatePackage:forVersion:withDescription:] in Firmware-9fa4e8.o
      -[Firmware generatePackage:forVersion:withDescription:andName:] in Firmware-9fa4e8.o
  "___cxa_guard_release", referenced from:
      +[DeviceInfo sharedDevice] in DeviceInfo-0cbf38.o
      -[Firmware generatePackageListFile:] in Firmware-9fa4e8.o
      -[Firmware generatePackage:forVersion:withDescription:] in Firmware-9fa4e8.o
      -[Firmware generatePackage:forVersion:withDescription:andName:] in Firmware-9fa4e8.o
ld: symbol(s) not found for architecture arm64
clang-10: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Makefile:33: all] Error 1

This is only happening when compiling with arc, and can be fixed by disabling arc or adding -lc++ to the CFLAGS, because ___cxa_guard_release and ___cxa_guard_acquire are defined in libc++abi according to my 14.3 sdk. I am opening this issue because I believe there to be a better solution than those work arounds.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions