summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Wu <XrXr@users.noreply.github.com>2025-02-13 16:28:10 -0500
committerAlan Wu <XrXr@users.noreply.github.com>2025-02-13 17:27:28 -0500
commit41251fdd309d4ff8f699268e33c32a114257211e (patch)
tree87b895b4244eb254c34f6ef9d85f0f92e20a070f
parente0cb069c0684bb8baf505a9d7a281d0ff8e1bf82 (diff)
YJIT: Fix linker warnings on macOS for Cargo (development) builds
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/12743
-rw-r--r--yjit/yjit.mk5
1 files changed, 5 insertions, 0 deletions
diff --git a/yjit/yjit.mk b/yjit/yjit.mk
index 137085376d..90f14568da 100644
--- a/yjit/yjit.mk
+++ b/yjit/yjit.mk
@@ -30,11 +30,16 @@ $(YJIT_LIBS):
$(ECHO) 'Error: Tried to build YJIT without configuring it first. Check `make showconfig`?'
@false
else ifeq ($(YJIT_SUPPORT),$(filter dev dev_nodebug stats,$(YJIT_SUPPORT)))
+# NOTE: MACOSX_DEPLOYMENT_TARGET to match `rustc --print deployment-target` to avoid the warning below.
+# ld: warning: object file (yjit/target/debug/libyjit.a(<libcapstone object>)) was built for
+# newer macOS version (15.2) than being linked (15.0)
+# We don't use newer macOS feature as of yet.
$(YJIT_LIBS): $(YJIT_SRC_FILES)
$(ECHO) 'building Rust YJIT ($(YJIT_SUPPORT) mode)'
+$(Q)$(CHDIR) $(top_srcdir)/yjit && \
CARGO_TARGET_DIR='$(CARGO_TARGET_DIR)' \
CARGO_TERM_PROGRESS_WHEN='never' \
+ MACOSX_DEPLOYMENT_TARGET=11.0 \
$(CARGO) $(CARGO_VERBOSE) build $(CARGO_BUILD_ARGS)
$(YJIT_LIB_TOUCH)
else