Skip to content

Fix linker warnings on macOS #11293

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

Merged
merged 3 commits into from
Jul 23, 2025
Merged

Conversation

xiaozhuai
Copy link
Contributor

@xiaozhuai xiaozhuai commented Jul 22, 2025

Set up MACOSX_DEPLOYMENT_TARGET correctly

ld: warning: object file (target/aarch64-apple-darwin/debug/libwasmtime.a[1054](242b1992def1ef0b-helpers.o)) was built for newer 'macOS' version (15.5) than being linked (11.0)
ld: warning: object file (target/aarch64-apple-darwin/debug/libwasmtime.a[1891](44ff4c55aa9e5133-entropy_common.o)) was built for newer 'macOS' version (15.5) than being linked (11.0)
ld: warning: object file (target/aarch64-apple-darwin/debug/libwasmtime.a[1892](44ff4c55aa9e5133-error_private.o)) was built for newer 'macOS' version (15.5) than being linked (11.0)
ld: warning: object file (target/aarch64-apple-darwin/debug/libwasmtime.a[1893](44ff4c55aa9e5133-fse_decompress.o)) was built for newer 'macOS' version (15.5) than being linked (11.0)
ld: warning: object file (target/aarch64-apple-darwin/debug/libwasmtime.a[1896](44ff4c55aa9e5133-zstd_common.o)) was built for newer 'macOS' version (15.5) than being linked (11.0)
ld: warning: object file (target/aarch64-apple-darwin/debug/libwasmtime.a[1897](fb80479a5fb81f6a-fse_compress.o)) was built for newer 'macOS' version (15.5) than being linked (11.0)
ld: warning: object file (target/aarch64-apple-darwin/debug/libwasmtime.a[1898](fb80479a5fb81f6a-hist.o)) was built for newer 'macOS' version (15.5) than being linked (11.0)
ld: warning: object file (target/aarch64-apple-darwin/debug/libwasmtime.a[1899](fb80479a5fb81f6a-huf_compress.o)) was built for newer 'macOS' version (15.5) than being linked (11.0)
ld: warning: object file (target/aarch64-apple-darwin/debug/libwasmtime.a[1900](fb80479a5fb81f6a-zstd_compress.o)) was built for newer 'macOS' version (15.5) than being linked (11.0)
ld: warning: object file (target/aarch64-apple-darwin/debug/libwasmtime.a[1901](fb80479a5fb81f6a-zstd_compress_literals.o)) was built for newer 'macOS' version (15.5) than being linked (11.0)
ld: warning: object file (target/aarch64-apple-darwin/debug/libwasmtime.a[1902](fb80479a5fb81f6a-zstd_compress_sequences.o)) was built for newer 'macOS' version (15.5) than being linked (11.0)
ld: warning: object file (target/aarch64-apple-darwin/debug/libwasmtime.a[1903](fb80479a5fb81f6a-zstd_compress_superblock.o)) was built for newer 'macOS' version (15.5) than being linked (11.0)
ld: warning: object file (target/aarch64-apple-darwin/debug/libwasmtime.a[1904](fb80479a5fb81f6a-zstd_double_fast.o)) was built for newer 'macOS' version (15.5) than being linked (11.0)
ld: warning: object file (target/aarch64-apple-darwin/debug/libwasmtime.a[1905](fb80479a5fb81f6a-zstd_fast.o)) was built for newer 'macOS' version (15.5) than being linked (11.0)
ld: warning: object file (target/aarch64-apple-darwin/debug/libwasmtime.a[1906](fb80479a5fb81f6a-zstd_lazy.o)) was built for newer 'macOS' version (15.5) than being linked (11.0)
ld: warning: object file (target/aarch64-apple-darwin/debug/libwasmtime.a[1907](fb80479a5fb81f6a-zstd_ldm.o)) was built for newer 'macOS' version (15.5) than being linked (11.0)
ld: warning: object file (target/aarch64-apple-darwin/debug/libwasmtime.a[1908](fb80479a5fb81f6a-zstd_opt.o)) was built for newer 'macOS' version (15.5) than being linked (11.0)
ld: warning: object file (target/aarch64-apple-darwin/debug/libwasmtime.a[1910](88f362f13b0528ed-huf_decompress.o)) was built for newer 'macOS' version (15.5) than being linked (11.0)
ld: warning: object file (target/aarch64-apple-darwin/debug/libwasmtime.a[1911](88f362f13b0528ed-zstd_ddict.o)) was built for newer 'macOS' version (15.5) than being linked (11.0)
ld: warning: object file (target/aarch64-apple-darwin/debug/libwasmtime.a[1912](88f362f13b0528ed-zstd_decompress.o)) was built for newer 'macOS' version (15.5) than being linked (11.0)
ld: warning: object file (target/aarch64-apple-darwin/debug/libwasmtime.a[1913](88f362f13b0528ed-zstd_decompress_block.o)) was built for newer 'macOS' version (15.5) than being linked (11.0)
ld: warning: object file (target/aarch64-apple-darwin/debug/libwasmtime.a[1970](db3b6bfb95261072-gdbjit.o)) was built for newer 'macOS' version (15.5) than being linked (11.0)

@xiaozhuai xiaozhuai requested a review from a team as a code owner July 22, 2025 07:44
@xiaozhuai xiaozhuai requested review from fitzgen and removed request for a team July 22, 2025 07:44
@xiaozhuai xiaozhuai changed the title Fix build on macOS Fix build on macOS for downstream projects Jul 22, 2025
@github-actions github-actions bot added the wasmtime:c-api Issues pertaining to the C API. label Jul 22, 2025
@alexcrichton
Copy link
Member

Thanks! Looks like the linking error wasn't caught on CI earlier due to this block. Could you delete that as well as part of this PR as it should no longer be necessary?

For fixing linker warnings this looks reasonable to me 👍

@alexcrichton alexcrichton requested review from alexcrichton and removed request for fitzgen July 22, 2025 15:09
@xiaozhuai xiaozhuai changed the title Fix build on macOS for downstream projects Fix linker warnings on macOS Jul 23, 2025
@xiaozhuai
Copy link
Contributor Author

Sure, I've modified this PR.

@alexcrichton
Copy link
Member

Oh sorry I meant deleting the code in examples/CMakeLists.txt rather than here. The additions you had here in this PR looked correct to me and my comment was about how the similar linking directive in examples/CMakeLists.txt were redundant (or at least I think they were).

In the meantime this all looks good to me so I'll flag it for merge, but if you'd like I'd be happy to merge a PR with the changes of linking to CoreFoundation

@alexcrichton alexcrichton added this pull request to the merge queue Jul 23, 2025
Merged via the queue into bytecodealliance:main with commit 80d65bd Jul 23, 2025
44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wasmtime:c-api Issues pertaining to the C API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants