zbrateam / Firmware

📱 Virtual dependencies for on-device capabilities
GNU General Public License v3.0
10 stars 6 forks source link

Undefined symbols ___cxa_guard_acquire and ___cxa_guard_release #4

Open CRKatri opened 3 years ago

CRKatri commented 3 years ago
➜ 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_guardrelease 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.

ankurshinde1 commented 3 years ago

Have you solved this issue?