Thanks to visit codestin.com
Credit goes to github.com

Skip to content

iOS ARM64 support issue #13

@ipfans

Description

@ipfans

With clang in Xcode5.1:

➜  Developer  clang -arch arm64 main.c -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/ -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/usr/include -o main

It's working fine.

But when use ollvm-3.4, I got a error about ARM64 arch definition:

ollvm/bin/clang -arch arm64 main.c -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/ -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/usr/include
clang-3.4: error: invalid arch name '-arch arm64'

or

➜  Developer  ollvm/bin/clang --target=aarch64 main.c -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/ -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/usr/include
In file included from main.c:1:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/usr/include/stdio.h:64:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/usr/include/sys/cdefs.h:655:2: error:
      Unsupported architecture
#error Unsupported architecture
...(lots of error)

example main.c:

#include <stdio.h>

static void hello(){
    printf("hello world!\n");
}

int main() {
    hello();
    return 0;
}

So how can I build a arm64 binary with ollvm-3.4?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions