diff options
| author | Alan Wu <XrXr@users.noreply.github.com> | 2025-12-17 13:51:12 -0500 |
|---|---|---|
| committer | Alan Wu <XrXr@users.noreply.github.com> | 2025-12-17 14:49:32 -0500 |
| commit | 656de67d5c8cd894eeda0baa618663098dce17f2 (patch) | |
| tree | 1d157fff08f05fed5173f83cf0c1217d0e9e6c66 /defs | |
| parent | ef3ac3e68c20276eed3de756c1260f43d94746d3 (diff) | |
JITs: Pass down GNU make jobserver resources when appropriate
To fix warnings from rustc on e.g. Make 4.3, which is in Ubuntu 24.04:
> warning: failed to connect to jobserver from environment variable
Diffstat (limited to 'defs')
| -rw-r--r-- | defs/jit.mk | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/defs/jit.mk b/defs/jit.mk index e893098ca2..42b56c4cd9 100644 --- a/defs/jit.mk +++ b/defs/jit.mk @@ -1,4 +1,9 @@ # Make recipes that deal with the rust code of YJIT and ZJIT. +# +# $(gnumake_recursive) adds the '+' prefix to pass down GNU make's +# jobserver resources to cargo/rustc as rust-lang.org recommends. +# Without it, certain make version trigger a warning. It does not +# add the prefix when `make --dry-run` so dry runs are indeed dry. ifneq ($(JIT_CARGO_SUPPORT),no) @@ -25,7 +30,7 @@ $(RUST_LIB): $(srcdir)/ruby.rs elif [ '$(YJIT_SUPPORT)' != no ]; then \ echo 'building YJIT ($(JIT_CARGO_SUPPORT) mode)'; \ fi - +$(Q)CARGO_TARGET_DIR='$(CARGO_TARGET_DIR)' \ + $(gnumake_recursive)$(Q)CARGO_TARGET_DIR='$(CARGO_TARGET_DIR)' \ CARGO_TERM_PROGRESS_WHEN='never' \ MACOSX_DEPLOYMENT_TARGET=11.0 \ $(CARGO) $(CARGO_VERBOSE) build --manifest-path '$(top_srcdir)/Cargo.toml' $(CARGO_BUILD_ARGS) @@ -34,7 +39,7 @@ else ifneq ($(strip $(RLIB_DIR)),) # combo build $(RUST_LIB): $(srcdir)/ruby.rs $(ECHO) 'building $(@F)' - $(Q) $(RUSTC) --edition=2024 \ + $(gnumake_recursive)$(Q) $(RUSTC) --edition=2024 \ '-L$(@D)' \ --extern=yjit \ --extern=zjit \ @@ -50,7 +55,7 @@ $(YJIT_RLIB): $(JIT_RLIB) $(ZJIT_RLIB): $(JIT_RLIB) $(JIT_RLIB): $(ECHO) 'building $(@F)' - $(Q) $(RUSTC) --crate-name=jit \ + $(gnumake_recursive)$(Q) $(RUSTC) --crate-name=jit \ --edition=2024 \ $(JIT_RUST_FLAGS) \ '--out-dir=$(@D)' \ |
