facebook / fishhook

A library that enables dynamically rebinding symbols in Mach-O binaries running on iOS.
BSD 3-Clause "New" or "Revised" License
5.17k stars 965 forks source link

build fail when __LP64__ is not defined #73

Open welbonwang opened 4 years ago

welbonwang commented 4 years ago

LP64 is not defined default when build for armv7. line 89 causes a error. It might be #ifdef __LP64__ instead of #if __LP64__

swolchok commented 4 years ago

I am not able to reproduce this problem. Can you provide more details, such as: how exactly are you building? What is the exact compiler error output you are seeing?

welbonwang commented 3 years ago

reproduce command as following:

clang -D__KERNEL_ARM_ARCH__=7 -arch armv7 -isysroot /Applications/Xcode10.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk -Wall -Wundef -Werror -c -o fishhook.o fishhook.c

and errors

fishhook.c:89:5: error: '__LP64__' is not defined, evaluates to 0 [-Werror,-Wundef]
#if __LP64__
    ^

I use Xcode 10.0.1

$ clang --version Apple LLVM version 10.0.1 (clang-1001.0.46.4) Target: x86_64-apple-darwin18.7.0 Thread model: posix InstalledDir: /Applications/Xcode10.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin