Thread with 6 posts
jump to expanded posthey, are _you_ for some reason trying to build some simple Rust code for a mac, but you aren't on a mac?
turns out you *only* need a few hundred kilobytes of yaml files and some ~magic linker args~ to make this work
rustflags = ["-Clinker=rust-lld", "-Lxtra-macos", "-Clink-arg=-Fxtra-macos"]
don't need to fuck around with apple IDs, SDKs, and such nonsense
IANAL, but these files, especially with they way they've been constructed, are almost certainly not copyrightable
@r oh!! this reminds me of touchHLE's cross-compilation toolchain (https://github.com/touchHLE/common-3.0-sdk / https://github.com/touchHLE/touchHLE/blob/trunk/tests/integration.rs)
it's indeed the case that you don't need much to compile for an Apple target using upstream LLVM; the Apple platforms are very heavy on dynamic linking and stuff all the critical stuff into one big library, so they don't actually need that much help; neat seeing someone else doing a similar thing!
@hikari yeah, we were just really frustrated that the "default" seems to be "build on a macos VM, somehow" or "use a very sketchy repack of the entire SDK"
we figured this was _supposed to_ be possible and so finally dug around to find the flags you need
@r you might want to compare notes with whatever the zig folks are doing
@hikari other than passing some flag which maybe affects the sdk version stored in LC_BUILD_VERSION (not sure what purpose that serves?)
it seems like they just grab a copy of libSystem.tbd only: https://codeberg.org/ziglang/zig/src/branch/master/lib/libc/darwin
the thing we're working on requires a few more files
@hikari oh, they also have pruned/deduped .h files (hopefully only APSL etc ones?), but we don't need that in our project. we've just done the rust style of manually declaring the symbols and types we want (and hoping we got it right)