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

IPHONEOS_DEPLOYMENT_TARGET not followed for some object files #137326

Open
joao-victor-silva opened this issue Feb 20, 2025 · 5 comments
Open

IPHONEOS_DEPLOYMENT_TARGET not followed for some object files #137326

joao-victor-silva opened this issue Feb 20, 2025 · 5 comments
Labels
C-bug Category: This is a bug. needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. O-ios Operating system: iOS

Comments

@joao-victor-silva
Copy link

I'm developing a internal SDK and I have to build it for iOS:

IPHONEOS_DEPLOYMENT_TARGET=13.0 cargo build --target=aarch64-apple-ios

I expected the static library output would follow the IPHONEOS_DEPLOYMENT_TARGET all the way through when checking with otool:

Expected output

Archive : target/aarch64-apple-ios/debug/libmylibrary.a
target/aarch64-apple-ios/debug/libmylibrary.a(mylibrary.001qxyu3qsjczz20kuhn46b2i.rcgu.o):
Load command 0
      cmd LC_SEGMENT_64
  cmdsize 1112
  segname 
   vmaddr 0x0000000000000000
   vmsize 0x000000000000107a
  fileoff 1272
 filesize 4218
  maxprot rwx
 initprot rwx
   nsects 13
    flags (none)
Section
  sectname __text
   segname __TEXT
      addr 0x0000000000000000
      size 0x0000000000000014
    offset 1272
     align 2^2 (4)
    reloff 5496
    nreloc 1
      type S_REGULAR
attributes PURE_INSTRUCTIONS SOME_INSTRUCTIONS
 reserved1 0
 reserved2 0
Section
  sectname __debug_loc
   segname __DWARF
      addr 0x0000000000000014
      size 0x0000000000000039
    offset 1292
     align 2^0 (1)
    reloff 0
    nreloc 0
      type S_REGULAR
attributes DEBUG
 reserved1 0
 reserved2 0
Section
  sectname __debug_abbrev
   segname __DWARF
      addr 0x000000000000004d
      size 0x00000000000000d2
    offset 1349
     align 2^0 (1)
    reloff 0
    nreloc 0
      type S_REGULAR
attributes DEBUG
 reserved1 0
 reserved2 0
Section
  sectname __debug_info
   segname __DWARF
      addr 0x000000000000011f
      size 0x0000000000000463
    offset 1559
     align 2^0 (1)
    reloff 5504
    nreloc 2
      type S_REGULAR
attributes DEBUG
 reserved1 0
 reserved2 0
Section
  sectname __debug_aranges
   segname __DWARF
      addr 0x0000000000000582
      size 0x0000000000000030
    offset 2682
     align 2^0 (1)
    reloff 5520
    nreloc 1
      type S_REGULAR
attributes DEBUG
 reserved1 0
 reserved2 0
Section
  sectname __debug_str
   segname __DWARF
      addr 0x00000000000005b2
      size 0x00000000000004b4
    offset 2730
     align 2^0 (1)
    reloff 0
    nreloc 0
      type S_REGULAR
attributes DEBUG
 reserved1 0
 reserved2 0
Section
  sectname __apple_names
   segname __DWARF
      addr 0x0000000000000a66
      size 0x0000000000000058
    offset 3934
     align 2^0 (1)
    reloff 0
    nreloc 0
      type S_REGULAR
attributes DEBUG
 reserved1 0
 reserved2 0
Section
  sectname __apple_objc
   segname __DWARF
      addr 0x0000000000000abe
      size 0x0000000000000024
    offset 4022
     align 2^0 (1)
    reloff 0
    nreloc 0
      type S_REGULAR
attributes DEBUG
 reserved1 0
 reserved2 0
Section
  sectname __apple_namespac
   segname __DWARF
      addr 0x0000000000000ae2
      size 0x0000000000000198
    offset 4058
     align 2^0 (1)
    reloff 0
    nreloc 0
      type S_REGULAR
attributes DEBUG
 reserved1 0
 reserved2 0
Section
  sectname __apple_types
   segname __DWARF
      addr 0x0000000000000c7a
      size 0x00000000000002e0
    offset 4466
     align 2^0 (1)
    reloff 0
    nreloc 0
      type S_REGULAR
attributes DEBUG
 reserved1 0
 reserved2 0
Section
  sectname __compact_unwind
   segname __LD
      addr 0x0000000000000f60
      size 0x0000000000000020
    offset 5208
     align 2^3 (8)
    reloff 5528
    nreloc 1
      type S_REGULAR
attributes DEBUG
 reserved1 0
 reserved2 0
Section
  sectname __eh_frame
   segname __TEXT
      addr 0x0000000000000f80
      size 0x0000000000000048
    offset 5240
     align 2^3 (8)
    reloff 5536
    nreloc 2
      type S_COALESCED
attributes NO_TOC STRIP_STATIC_SYMS LIVE_SUPPORT
 reserved1 0
 reserved2 0
Section
  sectname __debug_line
   segname __DWARF
      addr 0x0000000000000fc8
      size 0x00000000000000b2
    offset 5312
     align 2^0 (1)
    reloff 5552
    nreloc 1
      type S_REGULAR
attributes DEBUG
 reserved1 0
 reserved2 0
Load command 1
      cmd LC_BUILD_VERSION
  cmdsize 24
 platform IOS
    minos 13.0
      sdk n/a
   ntools 0
Load command 2
     cmd LC_SYMTAB
 cmdsize 24
  symoff 5560
   nsyms 6
  stroff 5656
 strsize 256
Load command 3
            cmd LC_DYSYMTAB
        cmdsize 80
      ilocalsym 0
      nlocalsym 4
     iextdefsym 4
     nextdefsym 1
      iundefsym 5
      nundefsym 1
         tocoff 0
           ntoc 0
      modtaboff 0
        nmodtab 0
   extrefsymoff 0
    nextrefsyms 0
 indirectsymoff 0
  nindirectsyms 0
      extreloff 0
        nextrel 0
      locreloff 0
        nlocrel 0
...

Instead, some object files were compile with a different IOS target version (17.2) as we can see in the minos of LC_BUILD_VERSION:

Actual output

target/aarch64-apple-ios/debug/libmylibrary.a(f3c5cc7ab326d4d0-atomic_thread_fence.o):
Load command 0
      cmd LC_SEGMENT_64
  cmdsize 872
  segname 
   vmaddr 0x0000000000000000
   vmsize 0x00000000000004bb
  fileoff 1048
 filesize 1211
  maxprot rwx
 initprot rwx
   nsects 10
    flags (none)
Section
  sectname __text
   segname __TEXT
      addr 0x0000000000000000
      size 0x0000000000000034
    offset 1048
     align 2^2 (4)
    reloff 2264
    nreloc 2
      type S_REGULAR
attributes PURE_INSTRUCTIONS SOME_INSTRUCTIONS
 reserved1 0
 reserved2 0
Section
  sectname __const
   segname __TEXT
      addr 0x0000000000000034
      size 0x0000000000000005
    offset 1100
     align 2^0 (1)
    reloff 0
    nreloc 0
      type S_REGULAR
attributes (none)
 reserved1 0
 reserved2 0
Section
  sectname __debug_abbrev
   segname __DWARF
      addr 0x0000000000000039
      size 0x000000000000006a
    offset 1105
     align 2^0 (1)
    reloff 0
    nreloc 0
      type S_REGULAR
attributes DEBUG
 reserved1 0
 reserved2 0
Section
  sectname __debug_info
   segname __DWARF
      addr 0x00000000000000a3
      size 0x000000000000009b
    offset 1211
     align 2^0 (1)
    reloff 2280
    nreloc 4
      type S_REGULAR
attributes DEBUG
 reserved1 0
 reserved2 0
Section
  sectname __debug_str
   segname __DWARF
      addr 0x000000000000013e
      size 0x00000000000001b9
    offset 1366
     align 2^0 (1)
    reloff 0
    nreloc 0
      type S_REGULAR
attributes DEBUG
 reserved1 0
 reserved2 0
Section
  sectname __apple_names
   segname __DWARF
      addr 0x00000000000002f7
      size 0x000000000000003c
    offset 1807
     align 2^0 (1)
    reloff 0
    nreloc 0
      type S_REGULAR
attributes DEBUG
 reserved1 0
 reserved2 0
Section
  sectname __apple_objc
   segname __DWARF
      addr 0x0000000000000333
      size 0x0000000000000024
    offset 1867
     align 2^0 (1)
    reloff 0
    nreloc 0
      type S_REGULAR
attributes DEBUG
 reserved1 0
 reserved2 0
Section
  sectname __apple_namespac
   segname __DWARF
      addr 0x0000000000000357
      size 0x0000000000000024
    offset 1903
     align 2^0 (1)
    reloff 0
    nreloc 0
      type S_REGULAR
attributes DEBUG
 reserved1 0
 reserved2 0
Section
  sectname __apple_types
   segname __DWARF
      addr 0x000000000000037b
      size 0x000000000000004e
    offset 1939
     align 2^0 (1)
    reloff 0
    nreloc 0
      type S_REGULAR
attributes DEBUG
 reserved1 0
 reserved2 0
Section
  sectname __debug_line
   segname __DWARF
      addr 0x00000000000003c9
      size 0x00000000000000f2
    offset 2017
     align 2^0 (1)
    reloff 2312
    nreloc 1
      type S_REGULAR
attributes DEBUG
 reserved1 0
 reserved2 0
Load command 1
      cmd LC_BUILD_VERSION
  cmdsize 24
 platform IOS
    minos 17.2
      sdk 17.2
   ntools 0
Load command 2
      cmd LC_LINKER_OPTIMIZATION_HINT
  cmdsize 16
  dataoff 2320
 datasize 8
Load command 3
     cmd LC_SYMTAB
 cmdsize 24
  symoff 2328
   nsyms 3
  stroff 2376
 strsize 40
Load command 4
            cmd LC_DYSYMTAB
        cmdsize 80
      ilocalsym 0
      nlocalsym 2
     iextdefsym 2
     nextdefsym 1
      iundefsym 3
      nundefsym 0
         tocoff 0
           ntoc 0
      modtaboff 0
        nmodtab 0
   extrefsymoff 0
    nextrefsyms 0
 indirectsymoff 0
  nindirectsyms 0
      extreloff 0
        nextrel 0
      locreloff 0
        nlocrel 0

...

In total 1578 but only 145 had these behavior of setting the minos 17.2. Is this behavior expected?

Meta

rustc --version --verbose:

rustc 1.84.1 (e71f9a9a9 2025-01-27)
binary: rustc
commit-hash: e71f9a9a98b0faf423844bf0ba7438f29dc27d58
commit-date: 2025-01-27
host: x86_64-apple-darwin
release: 1.84.1
LLVM version: 19.1.5

Addtional information that can be relevant:

  • In this project I use OpenSSL v3 compilied locally and exposed to the SDK by a sys crate for it, the bindings for the OpenSSL code were done using bindgen (ref)
  • I also use UniFFI to generate native bindings to Swift (ref)

#129432
#53808

@joao-victor-silva joao-victor-silva added the C-bug Category: This is a bug. label Feb 20, 2025
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Feb 20, 2025
@jieyouxu jieyouxu added the O-ios Operating system: iOS label Feb 20, 2025
@bjorn3
Copy link
Member

bjorn3 commented Feb 21, 2025

Those object files are part of the precompiled compiler-builtins crate. They probably need to be compiled with IPHONEOS_DEPLOYMENT_TARGET set to the minimum iOS version we support.

@joao-victor-silva
Copy link
Author

joao-victor-silva commented Feb 21, 2025

Good, I'm trying to validate this but so far I didn't find the usage of the compiler-builtins crate, I've tryied the command cargo tree --target=aarch64-apple-ios --all-features and I've got the following output:

cargo tree output
mylibrary v0.1.0
├── log v0.4.22
├── objc2-foundation v0.2.2
│   ├── bitflags v2.6.0
│   └── objc2 v0.5.2
│       ├── objc-sys v0.3.5
│       └── objc2-encode v4.0.3
├── openssl-sys v0.1.0
│   [build-dependencies]
│   └── bindgen v0.69.4
│       ├── bitflags v2.6.0
│       ├── cexpr v0.6.0
│       │   └── nom v7.1.3
│       │       ├── memchr v2.7.4
│       │       └── minimal-lexical v0.2.1
│       ├── clang-sys v1.8.1
│       │   ├── glob v0.3.1
│       │   ├── libc v0.2.158
│       │   └── libloading v0.8.5
│       │       └── cfg-if v1.0.0
│       │   [build-dependencies]
│       │   └── glob v0.3.1
│       ├── itertools v0.12.1
│       │   └── either v1.13.0
│       ├── lazy_static v1.5.0
│       ├── lazycell v1.3.0
│       ├── log v0.4.22
│       ├── prettyplease v0.2.20
│       │   ├── proc-macro2 v1.0.86
│       │   │   └── unicode-ident v1.0.12
│       │   └── syn v2.0.72
│       │       ├── proc-macro2 v1.0.86 (*)
│       │       ├── quote v1.0.36
│       │       │   └── proc-macro2 v1.0.86 (*)
│       │       └── unicode-ident v1.0.12
│       ├── proc-macro2 v1.0.86 (*)
│       ├── quote v1.0.36 (*)
│       ├── regex v1.10.6
│       │   ├── regex-automata v0.4.7
│       │   │   └── regex-syntax v0.8.4
│       │   └── regex-syntax v0.8.4
│       ├── rustc-hash v1.1.0
│       ├── shlex v1.3.0
│       ├── syn v2.0.72 (*)
│       └── which v4.4.2
│           ├── either v1.13.0
│           ├── home v0.5.9
│           └── rustix v0.38.34
│               ├── bitflags v2.6.0
│               ├── errno v0.3.9
│               │   └── libc v0.2.158
│               └── libc v0.2.158
├── oslog v0.2.0
│   ├── dashmap v5.5.3
│   │   ├── cfg-if v1.0.0
│   │   ├── hashbrown v0.14.5
│   │   ├── lock_api v0.4.12
│   │   │   └── scopeguard v1.2.0
│   │   │   [build-dependencies]
│   │   │   └── autocfg v1.3.0
│   │   ├── once_cell v1.19.0
│   │   └── parking_lot_core v0.9.10
│   │       ├── cfg-if v1.0.0
│   │       ├── libc v0.2.158
│   │       └── smallvec v1.13.2
│   └── log v0.4.22
│   [build-dependencies]
│   └── cc v1.2.1
│       └── shlex v1.3.0
├── thiserror v1.0.63
│   └── thiserror-impl v1.0.63 (proc-macro)
│       ├── proc-macro2 v1.0.86 (*)
│       ├── quote v1.0.36 (*)
│       └── syn v2.0.72 (*)
├── toml v0.8.19
│   ├── serde v1.0.205
│   │   └── serde_derive v1.0.205 (proc-macro)
│   │       ├── proc-macro2 v1.0.86 (*)
│   │       ├── quote v1.0.36 (*)
│   │       └── syn v2.0.72 (*)
│   ├── serde_spanned v0.6.8
│   │   └── serde v1.0.205 (*)
│   ├── toml_datetime v0.6.8
│   │   └── serde v1.0.205 (*)
│   └── toml_edit v0.22.22
│       ├── indexmap v2.4.0
│       │   ├── equivalent v1.0.1
│       │   └── hashbrown v0.14.5
│       ├── serde v1.0.205 (*)
│       ├── serde_spanned v0.6.8 (*)
│       ├── toml_datetime v0.6.8 (*)
│       └── winnow v0.6.20
└── uniffi v0.28.0
    ├── anyhow v1.0.86
    ├── camino v1.1.7
    │   └── serde v1.0.205 (*)
    ├── clap v4.5.15
    │   ├── clap_builder v4.5.15
    │   │   ├── anstream v0.6.15
    │   │   │   ├── anstyle v1.0.8
    │   │   │   ├── anstyle-parse v0.2.5
    │   │   │   │   └── utf8parse v0.2.2
    │   │   │   ├── anstyle-query v1.1.1
    │   │   │   ├── colorchoice v1.0.2
    │   │   │   ├── is_terminal_polyfill v1.70.1
    │   │   │   └── utf8parse v0.2.2
    │   │   ├── anstyle v1.0.8
    │   │   ├── clap_lex v0.7.2
    │   │   └── strsim v0.11.1
    │   └── clap_derive v4.5.13 (proc-macro)
    │       ├── heck v0.5.0
    │       ├── proc-macro2 v1.0.86 (*)
    │       ├── quote v1.0.36 (*)
    │       └── syn v2.0.72 (*)
    ├── uniffi_bindgen v0.28.0
    │   ├── anyhow v1.0.86
    │   ├── askama v0.12.1
    │   │   ├── askama_derive v0.12.5 (proc-macro)
    │   │   │   ├── askama_parser v0.2.1
    │   │   │   │   └── nom v7.1.3 (*)
    │   │   │   ├── basic-toml v0.1.9
    │   │   │   │   └── serde v1.0.205
    │   │   │   │       └── serde_derive v1.0.205 (proc-macro) (*)
    │   │   │   ├── mime v0.3.17
    │   │   │   ├── mime_guess v2.0.5
    │   │   │   │   ├── mime v0.3.17
    │   │   │   │   └── unicase v2.7.0
    │   │   │   │       [build-dependencies]
    │   │   │   │       └── version_check v0.9.5
    │   │   │   │   [build-dependencies]
    │   │   │   │   └── unicase v2.7.0 (*)
    │   │   │   ├── proc-macro2 v1.0.86 (*)
    │   │   │   ├── quote v1.0.36 (*)
    │   │   │   ├── serde v1.0.205 (*)
    │   │   │   └── syn v2.0.72 (*)
    │   │   └── askama_escape v0.10.3
    │   ├── camino v1.1.7 (*)
    │   ├── cargo_metadata v0.15.4
    │   │   ├── camino v1.1.7 (*)
    │   │   ├── cargo-platform v0.1.8
    │   │   │   └── serde v1.0.205 (*)
    │   │   ├── semver v1.0.23
    │   │   │   └── serde v1.0.205 (*)
    │   │   ├── serde v1.0.205 (*)
    │   │   ├── serde_json v1.0.122
    │   │   │   ├── itoa v1.0.11
    │   │   │   ├── memchr v2.7.4
    │   │   │   ├── ryu v1.0.18
    │   │   │   └── serde v1.0.205 (*)
    │   │   └── thiserror v1.0.63 (*)
    │   ├── fs-err v2.11.0
    │   │   [build-dependencies]
    │   │   └── autocfg v1.3.0
    │   ├── glob v0.3.1
    │   ├── goblin v0.8.2
    │   │   ├── log v0.4.22
    │   │   ├── plain v0.2.3
    │   │   └── scroll v0.12.0
    │   │       └── scroll_derive v0.12.0 (proc-macro)
    │   │           ├── proc-macro2 v1.0.86 (*)
    │   │           ├── quote v1.0.36 (*)
    │   │           └── syn v2.0.72 (*)
    │   ├── heck v0.5.0
    │   ├── once_cell v1.19.0
    │   ├── paste v1.0.15 (proc-macro)
    │   ├── serde v1.0.205 (*)
    │   ├── textwrap v0.16.1
    │   │   └── smawk v0.3.2
    │   ├── toml v0.5.11
    │   │   └── serde v1.0.205 (*)
    │   ├── uniffi_meta v0.28.0
    │   │   ├── anyhow v1.0.86
    │   │   ├── bytes v1.7.1
    │   │   ├── siphasher v0.3.11
    │   │   └── uniffi_checksum_derive v0.28.0 (proc-macro)
    │   │       ├── quote v1.0.36 (*)
    │   │       └── syn v2.0.72 (*)
    │   ├── uniffi_testing v0.28.0
    │   │   ├── anyhow v1.0.86
    │   │   ├── camino v1.1.7 (*)
    │   │   ├── cargo_metadata v0.15.4 (*)
    │   │   ├── fs-err v2.11.0 (*)
    │   │   └── once_cell v1.19.0
    │   └── uniffi_udl v0.28.0
    │       ├── anyhow v1.0.86
    │       ├── textwrap v0.16.1 (*)
    │       ├── uniffi_meta v0.28.0 (*)
    │       ├── uniffi_testing v0.28.0 (*)
    │       └── weedle2 v5.0.0
    │           └── nom v7.1.3
    │               ├── memchr v2.7.4
    │               └── minimal-lexical v0.2.1
    ├── uniffi_core v0.28.0
    │   ├── anyhow v1.0.86
    │   ├── bytes v1.7.1
    │   ├── camino v1.1.7 (*)
    │   ├── log v0.4.22
    │   ├── once_cell v1.19.0
    │   ├── paste v1.0.15 (proc-macro)
    │   └── static_assertions v1.1.0
    └── uniffi_macros v0.28.0 (proc-macro)
        ├── bincode v1.3.3
        │   └── serde v1.0.205 (*)
        ├── camino v1.1.7
        │   └── serde v1.0.205 (*)
        ├── fs-err v2.11.0
        │   [build-dependencies]
        │   └── autocfg v1.3.0
        ├── once_cell v1.19.0
        ├── proc-macro2 v1.0.86 (*)
        ├── quote v1.0.36 (*)
        ├── serde v1.0.205 (*)
        ├── syn v2.0.72 (*)
        ├── toml v0.5.11
        │   └── serde v1.0.205 (*)
        └── uniffi_meta v0.28.0
            ├── anyhow v1.0.86
            ├── bytes v1.7.1
            ├── siphasher v0.3.11
            └── uniffi_checksum_derive v0.28.0 (proc-macro) (*)
[build-dependencies]
└── uniffi v0.28.0
    ├── anyhow v1.0.86
    ├── uniffi_build v0.28.0
    │   ├── anyhow v1.0.86
    │   ├── camino v1.1.7 (*)
    │   └── uniffi_bindgen v0.28.0
    │       ├── anyhow v1.0.86
    │       ├── askama v0.12.1
    │       │   ├── askama_derive v0.12.5 (proc-macro) (*)
    │       │   └── askama_escape v0.10.3
    │       ├── camino v1.1.7 (*)
    │       ├── cargo_metadata v0.15.4
    │       │   ├── camino v1.1.7 (*)
    │       │   ├── cargo-platform v0.1.8
    │       │   │   └── serde v1.0.205 (*)
    │       │   ├── semver v1.0.23
    │       │   │   └── serde v1.0.205 (*)
    │       │   ├── serde v1.0.205 (*)
    │       │   ├── serde_json v1.0.122
    │       │   │   ├── itoa v1.0.11
    │       │   │   ├── memchr v2.7.4
    │       │   │   ├── ryu v1.0.18
    │       │   │   └── serde v1.0.205 (*)
    │       │   └── thiserror v1.0.63
    │       │       └── thiserror-impl v1.0.63 (proc-macro) (*)
    │       ├── fs-err v2.11.0 (*)
    │       ├── glob v0.3.1
    │       ├── goblin v0.8.2
    │       │   ├── log v0.4.22
    │       │   ├── plain v0.2.3
    │       │   └── scroll v0.12.0
    │       │       └── scroll_derive v0.12.0 (proc-macro) (*)
    │       ├── heck v0.5.0
    │       ├── once_cell v1.19.0
    │       ├── paste v1.0.15 (proc-macro)
    │       ├── serde v1.0.205 (*)
    │       ├── textwrap v0.16.1
    │       │   └── smawk v0.3.2
    │       ├── toml v0.5.11 (*)
    │       ├── uniffi_meta v0.28.0 (*)
    │       ├── uniffi_testing v0.28.0
    │       │   ├── anyhow v1.0.86
    │       │   ├── camino v1.1.7 (*)
    │       │   ├── cargo_metadata v0.15.4 (*)
    │       │   ├── fs-err v2.11.0 (*)
    │       │   └── once_cell v1.19.0
    │       └── uniffi_udl v0.28.0
    │           ├── anyhow v1.0.86
    │           ├── textwrap v0.16.1 (*)
    │           ├── uniffi_meta v0.28.0 (*)
    │           ├── uniffi_testing v0.28.0 (*)
    │           └── weedle2 v5.0.0
    │               └── nom v7.1.3 (*)
    ├── uniffi_core v0.28.0
    │   ├── anyhow v1.0.86
    │   ├── bytes v1.7.1
    │   ├── camino v1.1.7 (*)
    │   ├── log v0.4.22
    │   ├── once_cell v1.19.0
    │   ├── paste v1.0.15 (proc-macro)
    │   └── static_assertions v1.1.0
    └── uniffi_macros v0.28.0 (proc-macro) (*)

I know that some of those crates can use the compiler-builtins, like the bitflags crate, but is an optional dependency, so I can say for shure if the compiler-builtins is or isn't in use. There is another way to check its usage? And what crate is using it? If I knew this I can compile the dependency if the right iOS target.

edit: forgot to put the output in a code block

@bjorn3
Copy link
Member

bjorn3 commented Feb 21, 2025

Compiler-builtins is a part of the standard library which is shipped in precompiled form with rustc.

@joao-victor-silva
Copy link
Author

I can be wrong but this way how compiler-builtins is shipped with rustc looks like a core part of the compiler, not being easy to change, right?

I'm thinking how I can circunvent this issue for now, maybe downgrade the compiler version to a older one that compile with the iOS target that I need or compile everything (compiler-builtins + rustc) by myself and compile the project with it. Any of these solutions would work?

@bjorn3
Copy link
Member

bjorn3 commented Feb 21, 2025

If you are using nightly, you can use IPHONEOS_DEPLOYMENT_TARGET=13.0 cargo build -Zbuild-std=std --target=aarch64-apple-ios to rebuild the standard library including compiler-builtins with the lower deployment target.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. O-ios Operating system: iOS
Projects
None yet
Development

No branches or pull requests

4 participants