SSheldon / rust-objc-exception

Rust interface for Objective-C's throw and try/catch statements.
7 stars 7 forks source link

Fails to cross-compile for Apple Silicon #6

Open fenhl opened 3 years ago

fenhl commented 3 years ago

I'm trying to cross-compile something that depends on this crate for Apple Silicon (aarch64-apple-darwin) from an Intel Mac (x86_64-apple-darwin), and getting the errors below. Is this a bug in this crate or am I doing something wrong?

$ cargo +beta build --target=aarch64-apple-darwin
   Compiling objc_exception v0.1.2
The following warnings were emitted during compilation:

warning: In file included from extern/exception.m:1:
warning: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/objc/objc.h:31:
warning: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/types.h:75:
warning: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:807:2: error: Unsupported architecture
warning: #error Unsupported architecture
warning:  ^
warning: In file included from extern/exception.m:1:
warning: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/objc/objc.h:31:
warning: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/types.h:78:
warning: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/machine/types.h:37:2: error: architecture not supported
warning: #error architecture not supported
warning:  ^
warning: In file included from extern/exception.m:1:
warning: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/objc/objc.h:31:
warning: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/types.h:79:
warning: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:33:
warning: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/machine/_types.h:34:2: error: architecture not supported
warning: #error architecture not supported
warning:  ^
warning: In file included from extern/exception.m:1:
warning: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/objc/objc.h:31:
warning: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/types.h:79:
warning: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:55:9: error: unknown type name '__int64_t'
warning: typedef __int64_t       __darwin_blkcnt_t;      /* total blocks */
warning:         ^
warning: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:56:9: error: unknown type name '__int32_t'; did you mean '__int128_t'?
warning: typedef __int32_t       __darwin_blksize_t;     /* preferred block size */
warning:         ^
warning: note: '__int128_t' declared here
warning: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:57:9: error: unknown type name '__int32_t'; did you mean '__int128_t'?
warning: typedef __int32_t       __darwin_dev_t;         /* dev_t */
warning:         ^
warning: note: '__int128_t' declared here
warning: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:60:9: error: unknown type name '__uint32_t'; did you mean '__uint128_t'?
warning: typedef __uint32_t      __darwin_gid_t;         /* [???] process and group IDs */
warning:         ^
warning: note: '__uint128_t' declared here
warning: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:61:9: error: unknown type name '__uint32_t'; did you mean '__uint128_t'?
warning: typedef __uint32_t      __darwin_id_t;          /* [XSI] pid_t, uid_t, or gid_t*/
warning:         ^
warning: note: '__uint128_t' declared here
warning: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:62:9: error: unknown type name '__uint64_t'
warning: typedef __uint64_t      __darwin_ino64_t;       /* [???] Used for 64 bit inodes */
warning:         ^
warning: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:68:9: error: unknown type name '__darwin_natural_t'
warning: typedef __darwin_natural_t __darwin_mach_port_name_t; /* Used by mach */
warning:         ^
warning: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:70:9: error: unknown type name '__uint16_t'; did you mean '__uint128_t'?
warning: typedef __uint16_t      __darwin_mode_t;        /* [???] Some file attributes */
warning:         ^
warning: note: '__uint128_t' declared here
warning: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:71:9: error: unknown type name '__int64_t'
warning: typedef __int64_t       __darwin_off_t;         /* [???] Used for file sizes */
warning:         ^
warning: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:72:9: error: unknown type name '__int32_t'; did you mean '__int128_t'?
warning: typedef __int32_t       __darwin_pid_t;         /* [???] process and group IDs */
warning:         ^
warning: note: '__int128_t' declared here
warning: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:73:9: error: unknown type name '__uint32_t'; did you mean '__uint128_t'?
warning: typedef __uint32_t      __darwin_sigset_t;      /* [???] signal set */
warning:         ^
warning: note: '__uint128_t' declared here
warning: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:74:9: error: unknown type name '__int32_t'; did you mean '__int128_t'?
warning: typedef __int32_t       __darwin_suseconds_t;   /* [???] microseconds */
warning:         ^
warning: note: '__int128_t' declared here
warning: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:75:9: error: unknown type name '__uint32_t'; did you mean '__uint128_t'?
warning: typedef __uint32_t      __darwin_uid_t;         /* [???] user IDs */
warning:         ^
warning: note: '__uint128_t' declared here
warning: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:76:9: error: unknown type name '__uint32_t'; did you mean '__uint128_t'?
warning: typedef __uint32_t      __darwin_useconds_t;    /* [???] microseconds */
warning:         ^
warning: note: '__uint128_t' declared here
warning: In file included from extern/exception.m:1:
warning: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/objc/objc.h:31:
warning: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/types.h:81:
warning: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/machine/endian.h:37:2: error: architecture not supported
warning: #error architecture not supported
warning:  ^
warning: In file included from extern/exception.m:1:
warning: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/objc/objc.h:31:
warning: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/types.h:95:9: error: unknown type name 'u_int64_t'
warning: typedef u_int64_t               u_quad_t;       /* quads */
warning:         ^
warning: fatal error: too many errors emitted, stopping now [-ferror-limit=]
warning: 20 errors generated.

error: failed to run custom build command for `objc_exception v0.1.2`

Caused by:
  process didn't exit successfully: `/Users/fenhl/Desktop/objc-exception-test/target/debug/build/objc_exception-15498750a929223e/build-script-build` (exit code: 1)
  --- stdout
  TARGET = Some("aarch64-apple-darwin")
  OPT_LEVEL = Some("0")
  HOST = Some("x86_64-apple-darwin")
  CC_aarch64-apple-darwin = None
  CC_aarch64_apple_darwin = None
  TARGET_CC = None
  CC = None
  CROSS_COMPILE = None
  CFLAGS_aarch64-apple-darwin = None
  CFLAGS_aarch64_apple_darwin = None
  TARGET_CFLAGS = None
  CFLAGS = None
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some("true")
  CARGO_CFG_TARGET_FEATURE = None
  running: "cc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-arch" "arm64" "-Wall" "-Wextra" "-o" "/Users/fenhl/Desktop/objc-exception-test/target/aarch64-apple-darwin/debug/build/objc_exception-4eefb3a648f6962d/out/extern/exception.o" "-c" "extern/exception.m"
  cargo:warning=In file included from extern/exception.m:1:
  cargo:warning=In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/objc/objc.h:31:
  cargo:warning=In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/types.h:75:
  cargo:warning=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:807:2: error: Unsupported architecture
  cargo:warning=#error Unsupported architecture
  cargo:warning= ^
  cargo:warning=In file included from extern/exception.m:1:
  cargo:warning=In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/objc/objc.h:31:
  cargo:warning=In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/types.h:78:
  cargo:warning=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/machine/types.h:37:2: error: architecture not supported
  cargo:warning=#error architecture not supported
  cargo:warning= ^
  cargo:warning=In file included from extern/exception.m:1:
  cargo:warning=In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/objc/objc.h:31:
  cargo:warning=In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/types.h:79:
  cargo:warning=In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:33:
  cargo:warning=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/machine/_types.h:34:2: error: architecture not supported
  cargo:warning=#error architecture not supported
  cargo:warning= ^
  cargo:warning=In file included from extern/exception.m:1:
  cargo:warning=In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/objc/objc.h:31:
  cargo:warning=In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/types.h:79:
  cargo:warning=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:55:9: error: unknown type name '__int64_t'
  cargo:warning=typedef __int64_t       __darwin_blkcnt_t;      /* total blocks */
  cargo:warning=        ^
  cargo:warning=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:56:9: error: unknown type name '__int32_t'; did you mean '__int128_t'?
  cargo:warning=typedef __int32_t       __darwin_blksize_t;     /* preferred block size */
  cargo:warning=        ^
  cargo:warning=note: '__int128_t' declared here
  cargo:warning=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:57:9: error: unknown type name '__int32_t'; did you mean '__int128_t'?
  cargo:warning=typedef __int32_t       __darwin_dev_t;         /* dev_t */
  cargo:warning=        ^
  cargo:warning=note: '__int128_t' declared here
  cargo:warning=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:60:9: error: unknown type name '__uint32_t'; did you mean '__uint128_t'?
  cargo:warning=typedef __uint32_t      __darwin_gid_t;         /* [???] process and group IDs */
  cargo:warning=        ^
  cargo:warning=note: '__uint128_t' declared here
  cargo:warning=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:61:9: error: unknown type name '__uint32_t'; did you mean '__uint128_t'?
  cargo:warning=typedef __uint32_t      __darwin_id_t;          /* [XSI] pid_t, uid_t, or gid_t*/
  cargo:warning=        ^
  cargo:warning=note: '__uint128_t' declared here
  cargo:warning=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:62:9: error: unknown type name '__uint64_t'
  cargo:warning=typedef __uint64_t      __darwin_ino64_t;       /* [???] Used for 64 bit inodes */
  cargo:warning=        ^
  cargo:warning=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:68:9: error: unknown type name '__darwin_natural_t'
  cargo:warning=typedef __darwin_natural_t __darwin_mach_port_name_t; /* Used by mach */
  cargo:warning=        ^
  cargo:warning=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:70:9: error: unknown type name '__uint16_t'; did you mean '__uint128_t'?
  cargo:warning=typedef __uint16_t      __darwin_mode_t;        /* [???] Some file attributes */
  cargo:warning=        ^
  cargo:warning=note: '__uint128_t' declared here
  cargo:warning=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:71:9: error: unknown type name '__int64_t'
  cargo:warning=typedef __int64_t       __darwin_off_t;         /* [???] Used for file sizes */
  cargo:warning=        ^
  cargo:warning=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:72:9: error: unknown type name '__int32_t'; did you mean '__int128_t'?
  cargo:warning=typedef __int32_t       __darwin_pid_t;         /* [???] process and group IDs */
  cargo:warning=        ^
  cargo:warning=note: '__int128_t' declared here
  cargo:warning=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:73:9: error: unknown type name '__uint32_t'; did you mean '__uint128_t'?
  cargo:warning=typedef __uint32_t      __darwin_sigset_t;      /* [???] signal set */
  cargo:warning=        ^
  cargo:warning=note: '__uint128_t' declared here
  cargo:warning=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:74:9: error: unknown type name '__int32_t'; did you mean '__int128_t'?
  cargo:warning=typedef __int32_t       __darwin_suseconds_t;   /* [???] microseconds */
  cargo:warning=        ^
  cargo:warning=note: '__int128_t' declared here
  cargo:warning=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:75:9: error: unknown type name '__uint32_t'; did you mean '__uint128_t'?
  cargo:warning=typedef __uint32_t      __darwin_uid_t;         /* [???] user IDs */
  cargo:warning=        ^
  cargo:warning=note: '__uint128_t' declared here
  cargo:warning=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:76:9: error: unknown type name '__uint32_t'; did you mean '__uint128_t'?
  cargo:warning=typedef __uint32_t      __darwin_useconds_t;    /* [???] microseconds */
  cargo:warning=        ^
  cargo:warning=note: '__uint128_t' declared here
  cargo:warning=In file included from extern/exception.m:1:
  cargo:warning=In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/objc/objc.h:31:
  cargo:warning=In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/types.h:81:
  cargo:warning=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/machine/endian.h:37:2: error: architecture not supported
  cargo:warning=#error architecture not supported
  cargo:warning= ^
  cargo:warning=In file included from extern/exception.m:1:
  cargo:warning=In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/objc/objc.h:31:
  cargo:warning=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/types.h:95:9: error: unknown type name 'u_int64_t'
  cargo:warning=typedef u_int64_t               u_quad_t;       /* quads */
  cargo:warning=        ^
  cargo:warning=fatal error: too many errors emitted, stopping now [-ferror-limit=]
  cargo:warning=20 errors generated.
  exit code: 1

  --- stderr

  error occurred: Command "cc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-arch" "arm64" "-Wall" "-Wextra" "-o" "/Users/fenhl/Desktop/objc-exception-test/target/aarch64-apple-darwin/debug/build/objc_exception-4eefb3a648f6962d/out/extern/exception.o" "-c" "extern/exception.m" with args "cc" did not execute successfully (status code exit code: 1).
awakecoding commented 3 years ago

I am facing the same issue, but the odd thing is it only occurs in the GitHub Actions cloud runners for me, but not on my macbook.