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

Rust now requires MacOS > 10.12 #56

Open
strowk opened this issue Mar 13, 2024 · 3 comments
Open

Rust now requires MacOS > 10.12 #56

strowk opened this issue Mar 13, 2024 · 3 comments

Comments

@strowk
Copy link

strowk commented Mar 13, 2024

See
https://blog.rust-lang.org/2023/09/25/Increasing-Apple-Version-Requirements.html

This:

TARGET_DIR=/opt/osxcross UNATTENDED=yes OSX_VERSION_MIN=10.7 ./build.sh

needs to be upped to 10.12 in at least some targets, otherwise error looking like this:

          ld: warning: object file (/target/x86_64-apple-darwin/release/deps/libidna-9e0bb8c28bf4f03d.rlib(idna-9e0bb8c28bf4f03d.idna.3875f9ff72356008-cgu.7.rcgu.o)) was built for newer macOS version (10.12) than being linked (10.7)
          Undefined symbols for architecture x86_64:
            "_clock_gettime", referenced from:
                std::sys::unix::time::Timespec::now::h0ebd2e38935918ca in libstd-4b3c9502f998a9c9.rlib(std-4b3c9502f998a9c9.std.ccb858c55971878c-cgu.0.rcgu.o)
            "_getentropy", referenced from:
                std::sys::unix::rand::hashmap_random_keys::ha92d0a2687c22b7a in libstd-4b3c9502f998a9c9.rlib(std-4b3c9502f998a9c9.std.ccb858c55971878c-cgu.0.rcgu.o)
          ld: symbol(s) not found for architecture x86_64
          clang: error: linker command failed with exit code 1 (use -v to see invocation)

would be happening (this is from build for x86_64).

Simply upping the value to 10.12 would be more strict than what Rust seems to require now though.
There was no issue for me on aarch64-apple-darwin, and that is in alignment with blog post linked above, as that target is not mentioned as affected by change (aarch64-apple-ios is mentioned, but not darwin).

@Knniff
Copy link

Knniff commented Apr 24, 2024

Is there a fix for this, because no combinations of sdks for the apple targets work for me right now.

@strowk
Copy link
Author

strowk commented Apr 24, 2024

@Knniff

For myself, I did a "hacky" workaround here - strowk/tisq@afacd74

Basically I have "cross" folder with cloned cross, which has a problematic file under this subpath: "docker/cross-toolchains/docker/darwin.sh". I override this file with that one - https://github.com/strowk/tisq/blob/afacd74aecd639ca4790950352c4e41b008fcf7f/patched-darwin.sh#L52
before building (it is wired in using cargo-make, I was too lazy for xargo or other fancy ways).

The only difference is in line 52 there

    TARGET_DIR=/opt/osxcross UNATTENDED=yes OSX_VERSION_MIN=10.7 ./build.sh

is replaced by

    TARGET_DIR=/opt/osxcross UNATTENDED=yes OSX_VERSION_MIN=10.12 ./build.sh # this line is changed 10.7 to 10.12

Result of this is successful build, though obviously the binary would not work anymore for MacOS < 10.12 (which is not officially supported by Apple themselves anyway).

I suppose alternative to this could be pinning Rust toolchain to something before 1.74 , if old versions of OS are more important for you than new versions of language.

@Knniff
Copy link

Knniff commented Apr 30, 2024

Thank you for your explanation.
Which version of the SDK are you using? I tried a few but all came out with some kind of linker error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants