Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Makefile should be modified to support iOS on-device compiling #50

Open
Torrekie opened this issue Jul 4, 2021 · 2 comments
Open

Makefile should be modified to support iOS on-device compiling #50

Torrekie opened this issue Jul 4, 2021 · 2 comments

Comments

@Torrekie
Copy link
Contributor

Torrekie commented Jul 4, 2021

When trying to build on iOS, it uses macos method by default

iPhone:~/proj mobile$ cd fsmon/
iPhone:~/proj/fsmon mobile$ make
cc -I. -Wall -DFSMON_VERSION=\"1.8.4\" -g -ggdb -mmacosx-version-min=10.12 -DTARGET_OSX=1 -o fsmon-macos main.c util.c backend/*.c -framework CoreServices

When passing "-mmacosx-version-min" to clang on iOS, it will build for macos but link for iOS, then causes the binary file could not be executed or building failure.

But when attempting make ios to compile, it will give some errors that tells xcrun not exist.

iPhone:~/proj/fsmon mobile$ make ios
make: xcrun: Command not found
make: xcrun: Command not found
arch armv7 -arch arm64 -isysroot  -fembed-bitcode -flto -target arm64-apple-ios10.0 -miphoneos-version-min=10.0 -O3 -Wall -fembed-bitcode -I. -Wall -DFSMON_VERSION=\"1.8.4\" -g -ggdb -DTARGET_IOS=1 -o fsmon-ios main.c util.c backend/*.c \
        -framework CoreFoundation \
        -weak_framework MobileCoreServices \
        -weak_framework CoreServices
arch: Can't find armv7 in PATH
make: [Makefile:80: ios] Error 1 (ignored)
xcrun --sdk iphoneos strip fsmon-ios
make: xcrun: Command not found
make: *** [Makefile:81: ios] Error 127

Unless we can simulate xcrun's behavior, we should swap sysroot to / (or some specific path that stores iphoneos sdk, I poured it in to my system paths so I will no need to specify sysroot path when compiling other source codes) and use native toolchain.

@trufae
Copy link
Member

trufae commented Jul 4, 2021 via email

@Torrekie
Copy link
Contributor Author

Torrekie commented Jul 4, 2021

Probably using make ios CC=gcc is enough to make it work. Can you try?

On 4 Jul 2021, at 10:51, Torrekie @.***> wrote:


When trying to build on iOS, it uses macos method in default

iPhone:/proj mobile$ cd fsmon/
iPhone:
/proj/fsmon mobile$ make
cc -I. -Wall -DFSMON_VERSION="1.8.4" -g -ggdb -mmacosx-version-min=10.12 -DTARGET_OSX=1 -o fsmon-macos main.c util.c backend/*.c -framework CoreServices
When passing "-mmacosx-version-min" to clang on iOS, it will build for macos but link for iOS, then causes the binary file could not be executed or building failure.

But when attempting make ios to compile, it will give some errors that tells xcrun not exist.

iPhone:~/proj/fsmon mobile$ make ios
make: xcrun: Command not found
make: xcrun: Command not found
arch armv7 -arch arm64 -isysroot -fembed-bitcode -flto -target arm64-apple-ios10.0 -miphoneos-version-min=10.0 -O3 -Wall -fembed-bitcode -I. -Wall -DFSMON_VERSION="1.8.4" -g -ggdb -DTARGET_IOS=1 -o fsmon-ios main.c util.c backend/*.c
-framework CoreFoundation
-weak_framework MobileCoreServices
-weak_framework CoreServices
arch: Can't find armv7 in PATH
make: [Makefile:80: ios] Error 1 (ignored)
xcrun --sdk iphoneos strip fsmon-ios
make: xcrun: Command not found
make: *** [Makefile:81: ios] Error 127
Unless we can simulate xcrun's behavior, we should swap sysroot to / (or some specific path that stores iphoneos sdk, I poured it in to my system paths so I will no need to specify sysroot path when compiling other source codes) and use native toolchain.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

I've created a pull request to fix this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants