rustc
does not invoke ld
with appropriate -target
for linking a mac catalyst binary
#80202
Labels
A-linkage
Area: linking into static, shared libraries and binaries
C-bug
Category: This is a bug.
O-ios
Operating system: iOS
O-macos
Operating system: macOS
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I am trying to build a Mac Catalyst binary with rust. The compiler supports the
x86_64-apple-ios-macabi
target, butrustc
does not invokeld
correctly. Note that I am building withxargo
because I need to cross-compilecore
andstd
for the target triple myself (as Mac Catalyst is tier 3 iirc).I have the simplest possible project hosted here: https://github.com/visigoth/catalystsample
When running
xargo build --target x86_64-apple-ios-macabi
,rustc
eventually invokescc
like this to link the binary. Note that the invocation ofrustc
has-target x86_64-apple-ios-macabi
in it, whilecc
is invoked with-arch x86_64
:The important part is how
cc
is invoked:cc -arch x86_64
. This fails withld: building for macOS, but linking in object file built for Mac Catalyst, file ...
.If I simply change
cc -arch x86_64
tocc -target x86_64-apple-ios-macabi
and run the command manually, the binary links and runs successfully.The text was updated successfully, but these errors were encountered: