Repository: aws/aws-lc-rs (language: rust)

Issue:
Build fails for iOS simulator on x86_64
### Problem:

When I try to compile the latest version for iOS simulator on my M1 mac, it will build successfully when targeting the aarch64 simulator but not the x86_64 one. We need the x86_64 simulator slice to be able to run unit tests in our CI. I have also confirmed that AWS-LC does compile for the x86_64 simulator when using standalone CMake on the C library.

#### Relevant details
AWS-LC for Rust versions or commit: aws-lc-sys/v0.13.3

System information: for linux, below info can be collected by running `uname -srvmp`
 * CPU architecture: aarch64
 * CPU name: M1 Mac
 * OS: MacOS

Build log:
 * The log tells compiler and version.
```text
❯ cargo build --target x86_64-apple-ios
warning: use of deprecated type alias `toml_edit::Document`: Replaced with `DocumentMut`
 --> links-testing/build.rs:4:16
  |
4 | use toml_edit::Document;
  |                ^^^^^^^^
  |
  = note: `#[warn(deprecated)]` on by default

warning: use of deprecated type alias `toml_edit::Document`: Replaced with `DocumentMut`
  --> links-testing/build.rs:51:41
   |
51 |     let cargo_toml = cargo_toml.parse::<Document>().unwrap();
   |                                         ^^^^^^^^

warning: `links-testing` (build script) generated 2 warnings
   Compiling aws-lc-sys v0.14.0 (/Users/tomleavy/git/aws-lc-rs/aws-lc-sys)
   Compiling aws-lc-fips-sys v0.12.5 (/Users/tomleavy/git/aws-lc-rs/aws-lc-fips-sys)
error: failed to run custom build command for `aws-lc-sys v0.14.0 (/Users/tomleavy/git/aws-lc-rs/aws-lc-sys)`

Caused by:
  process didn't exit successfully: `/Users/tomleavy/git/aws-lc-rs/target/debug/build/aws-lc-sys-9a95abfa6d31adb3/build-script-main` (exit status: 101)
  --- stdout
  cargo:rustc-cfg=use_bindgen_generated
  CMAKE_TOOLCHAIN_FILE_x86_64-apple-ios = None
  CMAKE_TOOLCHAIN_FILE_x86_64_apple_ios = None
  TARGET_CMAKE_TOOLCHAIN_FILE = None
  CMAKE_TOOLCHAIN_FILE = None
  CMAKE_GENERATOR_x86_64-apple-ios = None
  CMAKE_GENERATOR_x86_64_apple_ios = None
  TARGET_CMAKE_GENERATOR = None
  CMAKE_GENERATOR = None
  CMAKE_PREFIX_PATH_x86_64-apple-ios = None
  CMAKE_PREFIX_PATH_x86_64_apple_ios = None
  TARGET_CMAKE_PREFIX_PATH = None
  CMAKE_PREFIX_PATH = None
  CMAKE_x86_64-apple-ios = None
  CMAKE_x86_64_apple_ios = None
  TARGET_CMAKE = None
  CMAKE = Some("cmake")
  running: cd "/Users/tomleavy/git/aws-lc-rs/target/x86_64-apple-ios/debug/build/aws-lc-sys-0814bc827fceafc2/out/build" && CMAKE_PREFIX_PATH="" "cmake" "/Users/tomleavy/git/aws-lc-rs/aws-lc-sys" "-DBUILD_SHARED_LIBS=0" "-DCMAKE_BUILD_TYPE=debug" "-DBORINGSSL_PREFIX=aws_lc_0_14_0_" "-DBORINGSSL_PREFIX_HEADERS=/Users/tomleavy/git/aws-lc-rs/aws-lc-sys/generated-include" "-DBUILD_TESTING=OFF" "-DBUILD_LIBSSL=OFF" "-DDISABLE_PERL=ON" "-DDISABLE_GO=ON" "-DCMAKE_SYSTEM_NAME=iOS" "-DCMAKE_INSTALL_PREFIX=/Users/tomleavy/git/aws-lc-rs/target/x86_64-apple-ios/debug/build/aws-lc-sys-0814bc827fceafc2/out" "-DCMAKE_C_FLAGS= -fPIC -m64 --target=x86_64-apple-ios -m64 -mios-simulator-version-min=17.4 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator17.4.sdk" "-DCMAKE_C_COMPILER=/usr/bin/clang" "-DCMAKE_CXX_FLAGS= -fPIC -m64 --target=x86_64-apple-ios -m64 -mios-simulator-version-min=17.4 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator17.4.sdk" "-DCMAKE_CXX_COMPILER=/usr/bin/clang++" "-DCMAKE_ASM_FLAGS= -fPIC -m64 --target=x86_64-apple-ios -m64 -mios-simulator-version-min=17.4 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator17.4.sdk" "-DCMAKE_ASM_COMPILER=/usr/bin/clang" "--no-warn-unused-cli"
  Not searching for unused variables given on the command line.
  -- Go not found. Disabling some code generation and using pre-generated code in generated-src/
  -- Perl not found. Disabling some code generation and using pre-generated code in generated-src/
  -- stdalign_check.c probe is negative, NOT enabling AWS_LC_STDALIGN_AVAILABLE:
  --     Change Dir: '/Users/tomleavy/git/aws-lc-rs/target/x86_64-apple-ios/debug/build/aws-lc-sys-0814bc827fceafc2/out/build/aws-lc/CMakeFiles/CMakeTmp'

  Run Build Command(s): /opt/homebrew/Cellar/cmake/3.28.1/bin/cmake -E env VERBOSE=1 /usr/bin/make -f Makefile cmTC_477fa/fast
  /Applications/Xcode.app/Contents/Developer/usr/bin/make  -f CMakeFiles/cmTC_477fa.dir/build.make CMakeFiles/cmTC_477fa.dir/build
  Building C object CMakeFiles/cmTC_477fa.dir/stdalign_check.c.o
  /usr/bin/clang   -fPIC -m64 --target=x86_64-apple-ios -m64 -mios-simulator-version-min=17.4 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator17.4.sdk -std=c99 -fvisibility=hidden -Wall -Wextra -Wno-unused-parameter -Werror -Wunused -Wcomment -Wchar-subscripts -Wuninitialized -Wshadow -Wwrite-strings -Wformat-security -Wunused-result  -Wvla -Wtype-limits -Werror -Wformat=2 -Wsign-compare -Wmissing-field-initializers -Wwrite-strings -ggdb -Wall -fvisibility=hidden -fno-common -Wnewline-eof -fcolor-diagnostics -Wstring-concatenation -Wimplicit-fallthrough -Wmissing-prototypes -Wold-style-definition -Wstrict-prototypes  -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk   -Werror -MD -MT CMakeFiles/cmTC_477fa.dir/stdalign_check.c.o -MF CMakeFiles/cmTC_477fa.dir/stdalign_check.c.o.d -o CMakeFiles/cmTC_477fa.dir/stdalign_check.c.o -c /Users/tomleavy/git/aws-lc-rs/aws-lc-sys/aws-lc/tests/compiler_features_tests/stdalign_check.c
  In file included from /Users/tomleavy/git/aws-lc-rs/aws-lc-sys/aws-lc/tests/compiler_features_tests/stdalign_check.c:8:
  In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0/include/stdint.h:52:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/stdint.h:52:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sys/_types.h:32:
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sys/cdefs.h:1010:2: error: Unsupported architecture
  #error Unsupported architecture
   ^
  In file included from /Users/tomleavy/git/aws-lc-rs/aws-lc-sys/aws-lc/tests/compiler_features_tests/stdalign_check.c:8:
  In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0/include/stdint.h:52:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/stdint.h:52:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sys/_types.h:33:
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/machine/_types.h:34:2: error: architecture not supported
  #error architecture not supported
   ^
  In file included from /Users/tomleavy/git/aws-lc-rs/aws-lc-sys/aws-lc/tests/compiler_features_tests/stdalign_check.c:8:
  In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0/include/stdint.h:52:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/stdint.h:52:
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sys/_types.h:55:9: error: unknown type name '__int64_t'
  typedef __int64_t       __darwin_blkcnt_t;      /* total blocks */
          ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sys/_types.h:56:9: error: unknown type name '__int32_t'
  typedef __int32_t       __darwin_blksize_t;     /* preferred block size */
          ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sys/_types.h:57:9: error: unknown type name '__int32_t'
  typedef __int32_t       __darwin_dev_t;         /* dev_t */
          ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sys/_types.h:60:9: error: unknown type name '__uint32_t'
  typedef __uint32_t      __darwin_gid_t;         /* [???] process and group IDs */
          ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sys/_types.h:61:9: error: unknown type name '__uint32_t'
  typedef __uint32_t      __darwin_id_t;          /* [XSI] pid_t, uid_t, or gid_t*/
          ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sys/_types.h:62:9: error: unknown type name '__uint64_t'; did you mean 'uint64_t'?
  typedef __uint64_t      __darwin_ino64_t;       /* [???] Used for 64 bit inodes */
          ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/_types/_uint64_t.h:31:28: note: 'uint64_t' declared here
  typedef unsigned long long uint64_t;
                             ^
  In file included from /Users/tomleavy/git/aws-lc-rs/aws-lc-sys/aws-lc/tests/compiler_features_tests/stdalign_check.c:8:
  In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0/include/stdint.h:52:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/stdint.h:52:
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sys/_types.h:68:9: error: unknown type name '__darwin_natural_t'
  typedef __darwin_natural_t __darwin_mach_port_name_t; /* Used by mach */
          ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sys/_types.h:70:9: error: unknown type name '__uint16_t'
  typedef __uint16_t      __darwin_mode_t;        /* [???] Some file attributes */
          ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sys/_types.h:71:9: error: unknown type name '__int64_t'
  typedef __int64_t       __darwin_off_t;         /* [???] Used for file sizes */
          ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sys/_types.h:72:9: error: unknown type name '__int32_t'
  typedef __int32_t       __darwin_pid_t;         /* [???] process and group IDs */
          ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sys/_types.h:73:9: error: unknown type name '__uint32_t'
  typedef __uint32_t      __darwin_sigset_t;      /* [???] signal set */
          ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sys/_types.h:74:9: error: unknown type name '__int32_t'
  typedef __int32_t       __darwin_suseconds_t;   /* [???] microseconds */
          ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sys/_types.h:75:9: error: unknown type name '__uint32_t'
  typedef __uint32_t      __darwin_uid_t;         /* [???] user IDs */
          ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sys/_types.h:76:9: error: unknown type name '__uint32_t'
  typedef __uint32_t      __darwin_useconds_t;    /* [???] microseconds */
          ^
  In file included from /Users/tomleavy/git/aws-lc-rs/aws-lc-sys/aws-lc/tests/compiler_features_tests/stdalign_check.c:8:
  In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0/include/stdint.h:52:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/stdint.h:53:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sys/_types/_intptr_t.h:30:
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/machine/types.h:37:2: error: architecture not supported
  #error architecture not supported
   ^
  In file included from /Users/tomleavy/git/aws-lc-rs/aws-lc-sys/aws-lc/tests/compiler_features_tests/stdalign_check.c:8:
  In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0/include/stdint.h:52:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/stdint.h:53:
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sys/_types/_intptr_t.h:32:9: error: unknown type name '__darwin_intptr_t'
  typedef __darwin_intptr_t       intptr_t;
          ^
  In file included from /Users/tomleavy/git/aws-lc-rs/aws-lc-sys/aws-lc/tests/compiler_features_tests/stdalign_check.c:10:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/stdlib.h:64:
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/_types.h:43:9: error: unknown type name '__uint32_t'
  typedef __uint32_t      __darwin_wctype_t;
          ^
  fatal error: too many errors emitted, stopping now [-ferror-limit=]
  20 errors generated.
  make[1]: *** [CMakeFiles/cmTC_477fa.dir/stdalign_check.c.o] Error 1
  make: *** [cmTC_477fa/fast] Error 2


  -- builtin_swap_check.c probe is negative, NOT enabling AWS_LC_BUILTIN_SWAP_SUPPORTED:
  --     Change Dir: '/Users/tomleavy/git/aws-lc-rs/target/x86_64-apple-ios/debug/build/aws-lc-sys-0814bc827fceafc2/out/build/aws-lc/CMakeFiles/CMakeTmp'

  Run Build Command(s): /opt/homebrew/Cellar/cmake/3.28.1/bin/cmake -E env VERBOSE=1 /usr/bin/make -f Makefile cmTC_3ddee/fast
  /Applications/Xcode.app/Contents/Developer/usr/bin/make  -f CMakeFiles/cmTC_3ddee.dir/build.make CMakeFiles/cmTC_3ddee.dir/build
  Building C object CMakeFiles/cmTC_3ddee.dir/builtin_swap_check.c.o
  /usr/bin/clang   -fPIC -m64 --target=x86_64-apple-ios -m64 -mios-simulator-version-min=17.4 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator17.4.sdk -std=c99 -fvisibility=hidden -Wall -Wextra -Wno-unused-parameter -Werror -Wunused -Wcomment -Wchar-subscripts -Wuninitialized -Wshadow -Wwrite-strings -Wformat-security -Wunused-result  -Wvla -Wtype-limits -Werror -Wformat=2 -Wsign-compare -Wmissing-field-initializers -Wwrite-strings -ggdb -Wall -fvisibility=hidden -fno-common -Wnewline-eof -fcolor-diagnostics -Wstring-concatenation -Wimplicit-fallthrough -Wmissing-prototypes -Wold-style-definition -Wstrict-prototypes  -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk   -Werror -MD -MT CMakeFiles/cmTC_3ddee.dir/builtin_swap_check.c.o -MF CMakeFiles/cmTC_3ddee.dir/builtin_swap_check.c.o.d -o CMakeFiles/cmTC_3ddee.dir/builtin_swap_check.c.o -c /Users/tomleavy/git/aws-lc-rs/aws-lc-sys/aws-lc/tests/compiler_features_tests/builtin_swap_check.c
  In file included from /Users/tomleavy/git/aws-lc-rs/aws-lc-sys/aws-lc/tests/compiler_features_tests/builtin_swap_check.c:8:
  In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0/include/stdint.h:52:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/stdint.h:52:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sys/_types.h:32:
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sys/cdefs.h:1010:2: error: Unsupported architecture
  #error Unsupported architecture
   ^
  In file included from /Users/tomleavy/git/aws-lc-rs/aws-lc-sys/aws-lc/tests/compiler_features_tests/builtin_swap_check.c:8:
  In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0/include/stdint.h:52:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/stdint.h:52:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sys/_types.h:33:
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/machine/_types.h:34:2: error: architecture not supported
  #error architecture not supported
   ^
  In file included from /Users/tomleavy/git/aws-lc-rs/aws-lc-sys/aws-lc/tests/compiler_features_tests/builtin_swap_check.c:8:
  In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0/include/stdint.h:52:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/stdint.h:52:
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sys/_types.h:55:9: error: unknown type name '__int64_t'
  typedef __int64_t       __darwin_blkcnt_t;      /* total blocks */
          ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sys/_types.h:56:9: error: unknown type name '__int32_t'
  typedef __int32_t       __darwin_blksize_t;     /* preferred block size */
          ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sys/_types.h:57:9: error: unknown type name '__int32_t'
  typedef __int32_t       __darwin_dev_t;         /* dev_t */
          ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sys/_types.h:60:9: error: unknown type name '__uint32_t'
  typedef __uint32_t      __darwin_gid_t;         /* [???] process and group IDs */
          ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sys/_types.h:61:9: error: unknown type name '__uint32_t'
  typedef __uint32_t      __darwin_id_t;          /* [XSI] pid_t, uid_t, or gid_t*/
          ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sys/_types.h:62:9: error: unknown type name '__uint64_t'; did you mean 'uint64_t'?
  typedef __uint64_t      __darwin_ino64_t;       /* [???] Used for 64 bit inodes */
          ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/_types/_uint64_t.h:31:28: note: 'uint64_t' declared here
  typedef unsigned long long uint64_t;
                             ^
  In file included from /Users/tomleavy/git/aws-lc-rs/aws-lc-sys/aws-lc/tests/compiler_features_tests/builtin_swap_check.c:8:
  In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0/include/stdint.h:52:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/stdint.h:52:
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sys/_types.h:68:9: error: unknown type name '__darwin_natural_t'
  typedef __darwin_natural_t __darwin_mach_port_name_t; /* Used by mach */
          ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sys/_types.h:70:9: error: unknown type name '__uint16_t'
  typedef __uint16_t      __darwin_mode_t;        /* [???] Some file attributes */
          ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sys/_types.h:71:9: error: unknown type name '__int64_t'
  typedef __int64_t       __darwin_off_t;         /* [???] Used for file sizes */
          ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sys/_types.h:72:9: error: unknown type name '__int32_t'
  typedef __int32_t       __darwin_pid_t;         /* [???] process and group IDs */
          ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sys/_types.h:73:9: error: unknown type name '__uint32_t'
  typedef __uint32_t      __darwin_sigset_t;      /* [???] signal set */
          ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sys/_types.h:74:9: error: unknown type name '__int32_t'
  typedef __int32_t       __darwin_suseconds_t;   /* [???] microseconds */
          ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sys/_types.h:75:9: error: unknown type name '__uint32_t'
  typedef __uint32_t      __darwin_uid_t;         /* [???] user IDs */
          ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sys/_types.h:76:9: error: unknown type name '__uint32_t'
  typedef __uint32_t      __darwin_useconds_t;    /* [???] microseconds */
          ^
  In file included from /Users/tomleavy/git/aws-lc-rs/aws-lc-sys/aws-lc/tests/compiler_features_tests/builtin_swap_check.c:8:
  In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0/include/stdint.h:52:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/stdint.h:53:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sys/_types/_intptr_t.h:30:
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/machine/types.h:37:2: error: architecture not supported
  #error architecture not supported
   ^
  In file included from /Users/tomleavy/git/aws-lc-rs/aws-lc-sys/aws-lc/tests/compiler_features_tests/builtin_swap_check.c:8:
  In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0/include/stdint.h:52:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/stdint.h:53:
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sys/_types/_intptr_t.h:32:9: error: unknown type name '__darwin_intptr_t'
  typedef __darwin_intptr_t       intptr_t;
          ^
  In file included from /Users/tomleavy/git/aws-lc-rs/aws-lc-sys/aws-lc/tests/compiler_features_tests/builtin_swap_check.c:9:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/stdlib.h:64:
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/_types.h:43:9: error: unknown type name '__uint32_t'
  typedef __uint32_t      __darwin_wctype_t;
          ^
  fatal error: too many errors emitted, stopping now [-ferror-limit=]
  20 errors generated.
  make[1]: *** [CMakeFiles/cmTC_3ddee.dir/builtin_swap_check.c.o] Error 1
  make: *** [cmTC_3ddee/fast] Error 2


  -- Configuring incomplete, errors occurred!

  --- stderr
  cargo:rerun-if-env-changed=AWS_LC_SYS_INTERNAL_NO_PREFIX
  cargo:rerun-if-env-changed=AWS_LC_RUST_INTERNAL_BINDGEN
  cargo:rerun-if-env-changed=AWS_LC_SYS_STATIC
  cargo:rerun-if-env-changed=AWS_LC_SYS_INCLUDES
  cargo:rerun-if-env-changed=AWS_LC_SYS_STATIC
  CMake Deprecation Warning at CMakeLists.txt:4 (cmake_minimum_required):
    Compatibility with CMake < 3.5 will be removed from a future version of
    CMake.

    Update the VERSION argument <min> value or use a ...<max> suffix to tell
    CMake that the project does not need compatibility with older versions.


  CMake Deprecation Warning at aws-lc/CMakeLists.txt:1 (cmake_minimum_required):
    Compatibility with CMake < 3.5 will be removed from a future version of
    CMake.

    Update the VERSION argument <min> value or use a ...<max> suffix to tell
    CMake that the project does not need compatibility with older versions.


  CMake Error at aws-lc/CMakeLists.txt:703 (elseif):
    given arguments:

      "STREQUAL" "riscv64"

    Unknown arguments specified


  thread 'main' panicked at /Users/tomleavy/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cmake-0.1.50/src/lib.rs:1098:5:

  command did not execute successfully, got: exit status: 1

  build script failed, must exit now
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: failed to run custom build command for `aws-lc-fips-sys v0.12.5 (/Users/tomleavy/git/aws-lc-rs/aws-lc-fips-sys)`

Caused by:
  process didn't exit successfully: `/Users/tomleavy/git/aws-lc-rs/target/debug/build/aws-lc-fips-sys-021df60f973f7d1f/build-script-main` (exit status: 101)
  --- stdout
  cargo:rustc-cfg=use_bindgen_generated
  CMAKE_TOOLCHAIN_FILE_x86_64-apple-ios = None
  CMAKE_TOOLCHAIN_FILE_x86_64_apple_ios = None
  TARGET_CMAKE_TOOLCHAIN_FILE = None
  CMAKE_TOOLCHAIN_FILE = None
  CMAKE_GENERATOR_x86_64-apple-ios = None
  CMAKE_GENERATOR_x86_64_apple_ios = None
  TARGET_CMAKE_GENERATOR = None
  CMAKE_GENERATOR = None
  CMAKE_PREFIX_PATH_x86_64-apple-ios = None
  CMAKE_PREFIX_PATH_x86_64_apple_ios = None
  TARGET_CMAKE_PREFIX_PATH = None
  CMAKE_PREFIX_PATH = None
  CMAKE_x86_64-apple-ios = None
  CMAKE_x86_64_apple_ios = None
  TARGET_CMAKE = None
  CMAKE = Some("cmake")
  running: cd "/Users/tomleavy/git/aws-lc-rs/target/x86_64-apple-ios/debug/build/aws-lc-fips-sys-9e3b325de1149101/out/build" && CMAKE_PREFIX_PATH="" "cmake" "/Users/tomleavy/git/aws-lc-rs/aws-lc-fips-sys" "-DBUILD_SHARED_LIBS=1" "-DCMAKE_BUILD_TYPE=debug" "-DBORINGSSL_PREFIX=aws_lc_fips_0_12_5_" "-DBORINGSSL_PREFIX_HEADERS=/Users/tomleavy/git/aws-lc-rs/aws-lc-fips-sys/generated-include" "-DBUILD_TESTING=OFF" "-DBUILD_LIBSSL=OFF" "-DCMAKE_SYSTEM_NAME=iOS" "-DFIPS=1" "-DCMAKE_INSTALL_PREFIX=/Users/tomleavy/git/aws-lc-rs/target/x86_64-apple-ios/debug/build/aws-lc-fips-sys-9e3b325de1149101/out" "-DCMAKE_C_FLAGS= -fPIC -m64 --target=x86_64-apple-ios -m64 -mios-simulator-version-min=17.4 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator17.4.sdk" "-DCMAKE_C_COMPILER=/usr/bin/clang" "-DCMAKE_CXX_FLAGS= -fPIC -m64 --target=x86_64-apple-ios -m64 -mios-simulator-version-min=17.4 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator17.4.sdk" "-DCMAKE_CXX_COMPILER=/usr/bin/clang++" "-DCMAKE_ASM_FLAGS= -fPIC -m64 --target=x86_64-apple-ios -m64 -mios-simulator-version-min=17.4 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator17.4.sdk" "-DCMAKE_ASM_COMPILER=/usr/bin/clang" "--no-warn-unused-cli"
  Not searching for unused variables given on the command line.
  -- stdalign_check.c probe is negative, NOT enabling AWS_LC_STDALIGN_AVAILABLE:
  --     Change Dir: '/Users/tomleavy/git/aws-lc-rs/target/x86_64-apple-ios/debug/build/aws-lc-fips-sys-9e3b325de1149101/out/build/aws-lc/CMakeFiles/CMakeTmp'

  Run Build Command(s): /opt/homebrew/Cellar/cmake/3.28.1/bin/cmake -E env VERBOSE=1 /usr/bin/make -f Makefile cmTC_37c68/fast
  /Applications/Xcode.app/Contents/Developer/usr/bin/make  -f CMakeFiles/cmTC_37c68.dir/build.make CMakeFiles/cmTC_37c68.dir/build
  Building C object CMakeFiles/cmTC_37c68.dir/stdalign_check.c.o
  /usr/bin/clang   -fPIC -m64 --target=x86_64-apple-ios -m64 -mios-simulator-version-min=17.4 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator17.4.sdk -fno-function-sections -fno-data-sections -std=c99 -fvisibility=hidden -Wall -Wextra -Wno-unused-parameter -Werror -Wunused -Wcomment -Wchar-subscripts -Wuninitialized -Wshadow -Wwrite-strings -Wformat-security -Wunused-result  -Wvla -Wtype-limits -Werror -Wformat=2 -Wsign-compare -Wmissing-field-initializers -Wwrite-strings -ggdb -Wall -fvisibility=hidden -fno-common -Wnewline-eof -fcolor-diagnostics -Wstring-concatenation -Wimplicit-fallthrough -Wmissing-prototypes -Wold-style-definition -Wstrict-prototypes  -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk   -Werror -MD -MT CMakeFiles/cmTC_37c68.dir/stdalign_check.c.o -MF CMakeFiles/cmTC_37c68.dir/stdalign_check.c.o.d -o CMakeFiles/cmTC_37c68.dir/stdalign_check.c.o -c /Users/tomleavy/git/aws-lc-rs/aws-lc-fips-sys/aws-lc/tests/compiler_features_tests/stdalign_check.c
  In file included from /Users/tomleavy/git/aws-lc-rs/aws-lc-fips-sys/aws-lc/tests/compiler_features_tests/stdalign_check.c:8:
  In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0/include/stdint.h:52:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/stdint.h:52:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sys/_types.h:32:
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sys/cdefs.h:1010:2: error: Unsupported architecture
  #error Unsupported architecture
   ^
  In file included from /Users/tomleavy/git/aws-lc-rs/aws-lc-fips-sys/aws-lc/tests/compiler_features_tests/stdalign_check.c:8:
  In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0/include/stdint.h:52:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/stdint.h:52:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sys/_types.h:33:
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/machine/_types.h:34:2: error: architecture not supported
  #error architecture not supported
   ^
  In file included from /Users/tomleavy/git/aws-lc-rs/aws-lc-fips-sys/aws-lc/tests/compiler_features_tests/stdalign_check.c:8:
  In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0/include/stdint.h:52:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/stdint.h:52:
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sys/_types.h:55:9: error: unknown type name '__int64_t'
  typedef __int64_t       __darwin_blkcnt_t;      /* total blocks */
          ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sys/_types.h:56:9: error: unknown type name '__int32_t'
  typedef __int32_t       __darwin_blksize_t;     /* preferred block size */
          ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sys/_types.h:57:9: error: unknown type name '__int32_t'
  typedef __int32_t       __darwin_dev_t;         /* dev_t */
          ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sys/_types.h:60:9: error: unknown type name '__uint32_t'
  typedef __uint32_t      __darwin_gid_t;         /* [???] process and group IDs */
          ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sys/_types.h:61:9: error: unknown type name '__uint32_t'
  typedef __uint32_t      __darwin_id_t;          /* [XSI] pid_t, uid_t, or gid_t*/
          ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sys/_types.h:62:9: error: unknown type name '__uint64_t'; did you mean 'uint64_t'?
  typedef __uint64_t      __darwin_ino64_t;       /* [???] Used for 64 bit inodes */
          ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/_types/_uint64_t.h:31:28: note: 'uint64_t' declared here
  typedef unsigned long long uint64_t;
                             ^
  In file included from /Users/tomleavy/git/aws-lc-rs/aws-lc-fips-sys/aws-lc/tests/compiler_features_tests/stdalign_check.c:8:
  In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0/include/stdint.h:52:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/stdint.h:52:
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sys/_types.h:68:9: error: unknown type name '__darwin_natural_t'
  typedef __darwin_natural_t __darwin_mach_port_name_t; /* Used by mach */
          ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sys/_types.h:70:9: error: unknown type name '__uint16_t'
  typedef __uint16_t      __darwin_mode_t;        /* [???] Some file attributes */
          ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sys/_types.h:71:9: error: unknown type name '__int64_t'
  typedef __int64_t       __darwin_off_t;         /* [???] Used for file sizes */
          ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sys/_types.h:72:9: error: unknown type name '__int32_t'
  typedef __int32_t       __darwin_pid_t;         /* [???] process and group IDs */
          ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sys/_types.h:73:9: error: unknown type name '__uint32_t'
  typedef __uint32_t      __darwin_sigset_t;      /* [???] signal set */
          ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sys/_types.h:74:9: error: unknown type name '__int32_t'
  typedef __int32_t       __darwin_suseconds_t;   /* [???] microseconds */
          ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sys/_types.h:75:9: error: unknown type name '__uint32_t'
  typedef __uint32_t      __darwin_uid_t;         /* [???] user IDs */
          ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sys/_types.h:76:9: error: unknown type name '__uint32_t'
  typedef __uint32_t      __darwin_useconds_t;    /* [???] microseconds */
          ^
  In file included from /Users/tomleavy/git/aws-lc-rs/aws-lc-fips-sys/aws-lc/tests/compiler_features_tests/stdalign_check.c:8:
  In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0/include/stdint.h:52:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/stdint.h:53:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sys/_types/_intptr_t.h:30:
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/machine/types.h:37:2: error: architecture not supported
  #error architecture not supported
   ^
  In file included from /Users/tomleavy/git/aws-lc-rs/aws-lc-fips-sys/aws-lc/tests/compiler_features_tests/stdalign_check.c:8:
  In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0/include/stdint.h:52:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/stdint.h:53:
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sys/_types/_intptr_t.h:32:9: error: unknown type name '__darwin_intptr_t'
  typedef __darwin_intptr_t       intptr_t;
          ^
  In file included from /Users/tomleavy/git/aws-lc-rs/aws-lc-fips-sys/aws-lc/tests/compiler_features_tests/stdalign_check.c:10:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/stdlib.h:64:
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/_types.h:43:9: error: unknown type name '__uint32_t'
  typedef __uint32_t      __darwin_wctype_t;
          ^
  fatal error: too many errors emitted, stopping now [-ferror-limit=]
  20 errors generated.
  make[1]: *** [CMakeFiles/cmTC_37c68.dir/stdalign_check.c.o] Error 1
  make: *** [cmTC_37c68/fast] Error 2


  -- builtin_swap_check.c probe is negative, NOT enabling AWS_LC_BUILTIN_SWAP_SUPPORTED:
  --     Change Dir: '/Users/tomleavy/git/aws-lc-rs/target/x86_64-apple-ios/debug/build/aws-lc-fips-sys-9e3b325de1149101/out/build/aws-lc/CMakeFiles/CMakeTmp'

  Run Build Command(s): /opt/homebrew/Cellar/cmake/3.28.1/bin/cmake -E env VERBOSE=1 /usr/bin/make -f Makefile cmTC_fb297/fast
  /Applications/Xcode.app/Contents/Developer/usr/bin/make  -f CMakeFiles/cmTC_fb297.dir/build.make CMakeFiles/cmTC_fb297.dir/build
  Building C object CMakeFiles/cmTC_fb297.dir/builtin_swap_check.c.o
  /usr/bin/clang   -fPIC -m64 --target=x86_64-apple-ios -m64 -mios-simulator-version-min=17.4 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator17.4.sdk -fno-function-sections -fno-data-sections -std=c99 -fvisibility=hidden -Wall -Wextra -Wno-unused-parameter -Werror -Wunused -Wcomment -Wchar-subscripts -Wuninitialized -Wshadow -Wwrite-strings -Wformat-security -Wunused-result  -Wvla -Wtype-limits -Werror -Wformat=2 -Wsign-compare -Wmissing-field-initializers -Wwrite-strings -ggdb -Wall -fvisibility=hidden -fno-common -Wnewline-eof -fcolor-diagnostics -Wstring-concatenation -Wimplicit-fallthrough -Wmissing-prototypes -Wold-style-definition -Wstrict-prototypes  -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk   -Werror -MD -MT CMakeFiles/cmTC_fb297.dir/builtin_swap_check.c.o -MF CMakeFiles/cmTC_fb297.dir/builtin_swap_check.c.o.d -o CMakeFiles/cmTC_fb297.dir/builtin_swap_check.c.o -c /Users/tomleavy/git/aws-lc-rs/aws-lc-fips-sys/aws-lc/tests/compiler_features_tests/builtin_swap_check.c
  In file included from /Users/tomleavy/git/aws-lc-rs/aws-lc-fips-sys/aws-lc/tests/compiler_features_tests/builtin_swap_check.c:8:
  In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0/include/stdint.h:52:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/stdint.h:52:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sys/_types.h:32:
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sys/cdefs.h:1010:2: error: Unsupported architecture
  #error Unsupported architecture
   ^
  In file included from /Users/tomleavy/git/aws-lc-rs/aws-lc-fips-sys/aws-lc/tests/compiler_features_tests/builtin_swap_check.c:8:
  In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0/include/stdint.h:52:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/stdint.h:52:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sys/_types.h:33:
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/machine/_types.h:34:2: error: architecture not supported
  #error architecture not supported
   ^
  In file included from /Users/tomleavy/git/aws-lc-rs/aws-lc-fips-sys/aws-lc/tests/compiler_features_tests/builtin_swap_check.c:8:
  In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0/include/stdint.h:52:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/stdint.h:52:
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sys/_types.h:55:9: error: unknown type name '__int64_t'
  typedef __int64_t       __darwin_blkcnt_t;      /* total blocks */
          ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sys/_types.h:56:9: error: unknown type name '__int32_t'
  typedef __int32_t       __darwin_blksize_t;     /* preferred block size */
          ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sys/_types.h:57:9: error: unknown type name '__int32_t'
  typedef __int32_t       __darwin_dev_t;         /* dev_t */
          ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sys/_types.h:60:9: error: unknown type name '__uint32_t'
  typedef __uint32_t      __darwin_gid_t;         /* [???] process and group IDs */
          ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sys/_types.h:61:9: error: unknown type name '__uint32_t'
  typedef __uint32_t      __darwin_id_t;          /* [XSI] pid_t, uid_t, or gid_t*/
          ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sys/_types.h:62:9: error: unknown type name '__uint64_t'; did you mean 'uint64_t'?
  typedef __uint64_t      __darwin_ino64_t;       /* [???] Used for 64 bit inodes */
          ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/_types/_uint64_t.h:31:28: note: 'uint64_t' declared here
  typedef unsigned long long uint64_t;
                             ^
  In file included from /Users/tomleavy/git/aws-lc-rs/aws-lc-fips-sys/aws-lc/tests/compiler_features_tests/builtin_swap_check.c:8:
  In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0/include/stdint.h:52:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/stdint.h:52:
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sys/_types.h:68:9: error: unknown type name '__darwin_natural_t'
  typedef __darwin_natural_t __darwin_mach_port_name_t; /* Used by mach */
          ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sys/_types.h:70:9: error: unknown type name '__uint16_t'
  typedef __uint16_t      __darwin_mode_t;        /* [???] Some file attributes */
          ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sys/_types.h:71:9: error: unknown type name '__int64_t'
  typedef __int64_t       __darwin_off_t;         /* [???] Used for file sizes */
          ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sys/_types.h:72:9: error: unknown type name '__int32_t'
  typedef __int32_t       __darwin_pid_t;         /* [???] process and group IDs */
          ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sys/_types.h:73:9: error: unknown type name '__uint32_t'
  typedef __uint32_t      __darwin_sigset_t;      /* [???] signal set */
          ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sys/_types.h:74:9: error: unknown type name '__int32_t'
  typedef __int32_t       __darwin_suseconds_t;   /* [???] microseconds */
          ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sys/_types.h:75:9: error: unknown type name '__uint32_t'
  typedef __uint32_t      __darwin_uid_t;         /* [???] user IDs */
          ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sys/_types.h:76:9: error: unknown type name '__uint32_t'
  typedef __uint32_t      __darwin_useconds_t;    /* [???] microseconds */
          ^
  In file included from /Users/tomleavy/git/aws-lc-rs/aws-lc-fips-sys/aws-lc/tests/compiler_features_tests/builtin_swap_check.c:8:
  In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0/include/stdint.h:52:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/stdint.h:53:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sys/_types/_intptr_t.h:30:
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/machine/types.h:37:2: error: architecture not supported
  #error architecture not supported
   ^
  In file included from /Users/tomleavy/git/aws-lc-rs/aws-lc-fips-sys/aws-lc/tests/compiler_features_tests/builtin_swap_check.c:8:
  In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0/include/stdint.h:52:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/stdint.h:53:
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sys/_types/_intptr_t.h:32:9: error: unknown type name '__darwin_intptr_t'
  typedef __darwin_intptr_t       intptr_t;
          ^
  In file included from /Users/tomleavy/git/aws-lc-rs/aws-lc-fips-sys/aws-lc/tests/compiler_features_tests/builtin_swap_check.c:9:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/stdlib.h:64:
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/_types.h:43:9: error: unknown type name '__uint32_t'
  typedef __uint32_t      __darwin_wctype_t;
          ^
  fatal error: too many errors emitted, stopping now [-ferror-limit=]
  20 errors generated.
  make[1]: *** [CMakeFiles/cmTC_fb297.dir/builtin_swap_check.c.o] Error 1
  make: *** [cmTC_fb297/fast] Error 2


  -- Configuring incomplete, errors occurred!

  --- stderr
  cargo:rerun-if-env-changed=AWS_LC_FIPS_SYS_STATIC
  cargo:rerun-if-env-changed=AWS_LC_RUST_INTERNAL_BINDGEN
  cargo:rerun-if-env-changed=AWS_LC_FIPS_SYS_INCLUDES
  cargo:rerun-if-env-changed=AWS_LC_FIPS_SYS_STATIC
  CMake Deprecation Warning at CMakeLists.txt:4 (cmake_minimum_required):
    Compatibility with CMake < 3.5 will be removed from a future version of
    CMake.

    Update the VERSION argument <min> value or use a ...<max> suffix to tell
    CMake that the project does not need compatibility with older versions.


  CMake Deprecation Warning at aws-lc/CMakeLists.txt:1 (cmake_minimum_required):
    Compatibility with CMake < 3.5 will be removed from a future version of
    CMake.

    Update the VERSION argument <min> value or use a ...<max> suffix to tell
    CMake that the project does not need compatibility with older versions.


  CMake Error at aws-lc/CMakeLists.txt:711 (elseif):
    given arguments:

      "STREQUAL" "riscv64"

    Unknown arguments specified


  thread 'main' panicked at /Users/tomleavy/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cmake-0.1.50/src/lib.rs:1098:5:

  command did not execute successfully, got: exit status: 1

  build script failed, must exit now
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
...
```



Discussion / hints:
I'm able to reproduce the problem you report, and I've made progress correcting our build setup. But I'm still having trouble determining how to remedy the SDK's header files only supporting ARM-based architectures:
```
 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/include/sys/cdefs.h:1010:2: error: Unsupported architecture
  #error Unsupported architecture
```

I'm curious about how you built AWS-LC for `x86_64-apple-ios`. I can reach out to you directly for details.

Fix patch:
diff --git a/.github/workflows/cross.yml b/.github/workflows/cross.yml
index e8a6874f544..decd66e71e5 100644
--- a/.github/workflows/cross.yml
+++ b/.github/workflows/cross.yml
@@ -58,15 +58,10 @@ jobs:
       - name: Cross-compilation w/ bindgen
         run: cross test -p aws-lc-rs --release --features bindgen,unstable --target ${{ matrix.target }}
 
-  aws-lc-rs-platform-build:
+  aws-lc-rs-ios-aarch64:
     if: github.repository == 'aws/aws-lc-rs'
-    name: Cross-platform build
-    runs-on: ${{ matrix.os }}
-    strategy:
-      fail-fast: false
-      matrix:
-        rust: [ stable ]
-        os: [ macos-13-xlarge ]
+    name: iOS aarch64 cross-platform build
+    runs-on: macos-13-xlarge
     steps:
       - uses: actions/checkout@v3
         with:
@@ -74,11 +69,25 @@ jobs:
       - uses: dtolnay/rust-toolchain@master
         id: toolchain
         with:
-          toolchain: ${{ matrix.rust }}
+          toolchain: stable
           target: aarch64-apple-ios-sim
-      - name: Set Rust toolchain override
-        run: rustup override set ${{ steps.toolchain.outputs.name }}
       - name: Install bash
         run: brew install bash
       - name: iOS Simulator Runner
         run: ./scripts/ci/ios-simulator-runner.sh
+
+  aws-lc-rs-ios-x86_64:
+    if: github.repository == 'aws/aws-lc-rs'
+    name: iOS x86-64 cross-platform build
+    runs-on: macos-13-xlarge
+    steps:
+      - uses: actions/checkout@v3
+        with:
+          submodules: 'recursive'
+      - uses: dtolnay/rust-toolchain@master
+        id: toolchain
+        with:
+          toolchain: stable
+          target: x86_64-apple-ios
+      - name: Build for `x86_64-apple-ios`
+        run: cargo build -p aws-lc-rs --target x86_64-apple-ios --features bindgen
diff --git a/aws-lc-sys/builder/cmake_builder.rs b/aws-lc-sys/builder/cmake_builder.rs
index b2004a0f5f3..60874c8ad00 100644
--- a/aws-lc-sys/builder/cmake_builder.rs
+++ b/aws-lc-sys/builder/cmake_builder.rs
@@ -102,14 +102,22 @@ impl CmakeBuilder {
         cmake_cfg.define("DISABLE_GO", "ON");
 
         if target_vendor() == "apple" {
-            if target_os().trim() == "ios" {
+            if target_os().to_lowercase() == "ios" {
                 cmake_cfg.define("CMAKE_SYSTEM_NAME", "iOS");
-                if target().trim().ends_with("-ios-sim") {
+                if target().ends_with("-ios-sim") || target_arch() == "x86_64" {
                     cmake_cfg.define("CMAKE_OSX_SYSROOT", "iphonesimulator");
+                } else {
+                    cmake_cfg.define("CMAKE_OSX_SYSROOT", "iphoneos");
                 }
+                cmake_cfg.define("CMAKE_THREAD_LIBS_INIT", "-lpthread");
             }
-            if target_arch().trim() == "aarch64" {
+            if target_arch() == "aarch64" {
                 cmake_cfg.define("CMAKE_OSX_ARCHITECTURES", "arm64");
+                cmake_cfg.define("CMAKE_SYSTEM_PROCESSOR", "arm64");
+            }
+            if target_arch() == "x86_64" {
+                cmake_cfg.define("CMAKE_OSX_ARCHITECTURES", "x86_64");
+                cmake_cfg.define("CMAKE_SYSTEM_PROCESSOR", "x86_64");
             }
         }
 


Test patch: