Commit graph

550 commits

Author SHA1 Message Date
Nobuyoshi Nakada
401932c18f
NMake needs caret to escape a hash sign 2025-08-12 18:19:09 +09:00
Nobuyoshi Nakada
b3598cf2a3 Win: Strip CRs from cpp and nm output
The combination of mingw tools and cygin/msys2 ruby leaves CRs.
2025-08-01 00:15:27 +09:00
Jean Boussier
d488935910 Get rid of ID_JUNK
It has been aliased as ID_INTERNAL for a long time and that alias
is much more descriptive.
2025-07-28 12:22:42 +02:00
Nobuyoshi Nakada
fb6f255028
Rename builtin_binary.inc as .rbbin
Distinguish between platform-dependent ".rbbin" and platform-
independent ".inc" files.
2025-07-26 20:19:55 +09:00
Hiroshi SHIBATA
be7b1164e6 Split autogenerated dependency to depend file from common.mk 2025-07-25 19:50:06 +09:00
Alan Wu
5ee3937a9c ZJIT: Have make zjit-test use the same Cargo features as miniruby
This is so that e.g. building with `--enable-zjit=dev` will test with the
disassembly feature. It makes more sense, saves on build time and
reveals that
`backend::arm64::tests::sp_movements_are_single_instruction` was in
fact failing with the `disasm` feature.
2025-07-16 14:10:22 -04:00
Alan Wu
92b218fbc3 YJIT: ZJIT: Allow both JITs in the same build
This commit allows building YJIT and ZJIT simultaneously, a "combo
build". Previously, `./configure --enable-yjit --enable-zjit` failed. At
runtime, though, only one of the two can be enabled at a time.

Add a root Cargo workspace that contains both the yjit and zjit crate.
The common Rust build integration mechanisms are factored out into
defs/jit.mk.

Combo YJIT+ZJIT dev builds are supported; if either JIT uses
`--enable-*=dev`, both of them are built in dev mode.

The combo build requires Cargo, but building one JIT at a time with only
rustc in release build remains supported.
2025-05-15 00:39:03 +09:00
Nobuyoshi Nakada
b48b841378 digest.so needs ruby/digest.h which is installed by build-ext 2025-05-12 02:50:25 +09:00
Alan Wu
33909a1c69 YJIT: ZJIT: Share identical glue functions
Working towards having YJIT and ZJIT in the same build, we need to
deduplicate some glue code that would otherwise cause name collision.
Add jit.c for this and build it for YJIT and ZJIT builds. Update bindgen
to look at jit.c; some shuffling of functions in the output, but the set
of functions shouldn't have changed.
2025-05-02 23:47:57 +09:00
Nobuyoshi Nakada
b42afa1dbc
Suppress gcc 15 unterminated-string-initialization warnings 2025-04-30 20:04:10 +09:00
Nobuyoshi Nakada
37db51b441
Suppress error message when gc is cleaned already [ci skip] 2025-04-28 19:55:26 +09:00
Nobuyoshi Nakada
59c7b3840d Check Unicode version of the normalization table 2025-04-23 14:14:36 +09:00
Nobuyoshi Nakada
3b7dd205a5
Remove extra empty expressions
Only `class_table` values are not quoted and need to terminate %-=
literal.
2025-04-22 21:09:26 +09:00
Takashi Kokubun
0a543daf15 Add zjit_* instructions to profile the interpreter (https://github.com/Shopify/zjit/pull/16)
* Add zjit_* instructions to profile the interpreter

* Rename FixnumPlus to FixnumAdd

* Update a comment about Invalidate

* Rename Guard to GuardType

* Rename Invalidate to PatchPoint

* Drop unneeded debug!()

* Plan on profiling the types

* Use the output of GuardType as type refined outputs
2025-04-18 21:52:59 +09:00
Takashi Kokubun
92d48f47a3 Use separate cargo build flags 2025-04-18 21:52:57 +09:00
Alan Wu
5208720746 Pass CARGO_BUILD_ARGS through properly 2025-04-18 21:52:56 +09:00
Takashi Kokubun
8ad08f1126 Fix template/Makefile.in 2025-04-18 21:52:55 +09:00
Martin Dürst
900ece77b2 prepare Unicode normalization for Unicode 16.0.0 2025-04-18 16:07:17 +09:00
Nobuyoshi Nakada
e25889951f
Ensure builtin binaries are aligned to ibf_header
Since IBF result string size should be multiple of 4, this should not
increase the binary size actually.
2025-04-06 12:24:23 +09:00
Hiroshi SHIBATA
589713bcb5
Ignore to build C extension for test files of bundled gems 2025-03-28 11:15:29 +09:00
Takashi Kokubun
e8f8565dc2 Remove obsoleted insn_may_depend_on_sp_or_pc()
which was for MJIT
2025-03-05 16:23:31 -08:00
Nobuyoshi Nakada
4a67ef09cc
[Feature #21116] Extract RJIT as a third-party gem 2025-02-13 18:01:03 +09:00
Alan Wu
bfcf36fe22 YJIT doesn't merge archives anymore [ci skip] 2025-02-11 19:46:07 -05:00
ydah
ccb4ba45ed Use LRAMA instead of YACC 2025-01-14 17:20:02 +09:00
Nobuyoshi Nakada
060ae17c80
CPPFLAGS is needed for dtrace not only INCFLAGS 2025-01-13 09:56:21 +09:00
Nobuyoshi Nakada
e109400748
Win32: Fix sub make commands
`cmd.exe` built-in `cd` does not recognize slashes as path separators,
replace to backslashes.
2024-12-27 16:26:14 +09:00
Nobuyoshi Nakada
b923a59b8e fake.rb: Override constants in Ruby module 2024-12-25 19:12:31 +09:00
Nobuyoshi Nakada
4fb5d746ce
Split modular-gc into build and installation 2024-12-22 22:10:26 +09:00
Nobuyoshi Nakada
2f2530b195
Allow variables in modular_gc_dir
Such as `$(ruby_version)`, `$(arch)` and so on.
2024-12-22 22:10:26 +09:00
Nobuyoshi Nakada
f12e2622c1 Split system dependent commands to clean modular-gc 2024-12-10 12:31:47 +09:00
Peter Zhu
ce1ad1b816 Standardize on the name "modular GC"
We have name fragmentation for this feature, including "shared GC",
"modular GC", and "external GC". This commit standardizes the feature
name to "modular GC" and the implementation to "GC library".
2024-12-05 10:33:26 -05:00
Nobuyoshi Nakada
c5d31cb96b Shell dependent command should be in Makefile.in
As common.mk is used by nmake.exe, the commands there need to be
accepted also by cmd.exe.
2024-11-26 19:06:21 +09:00
Peter Zhu
372bb990ac Remove unused PRELOADENV macro in ruby-runner.h 2024-10-11 09:02:48 -04:00
Peter Zhu
df2fb88028 Remove unused SOEXT macro in ruby-runner.h 2024-10-11 09:02:48 -04:00
Nobuyoshi Nakada
1f39184bc7 Substitute coroutine_transfer with prefixed symbol in Makefile
```
coroutine/arm64/Context.S:31:57: error: invoking macro TOKEN_PASTE argument 1: empty macro arguments are undefined in ISO C90 [-Wpedantic]
   31 | .global PREFIXED_SYMBOL(SYMBOL_PREFIX,coroutine_transfer)
      |                                                         ^
```
2024-10-08 23:29:49 +09:00
Nobuyoshi Nakada
67591b545c
Make rbconfig/sizeof keys US-ASCII 2024-10-07 19:20:08 +09:00
Nobuyoshi Nakada
dbb1abacf0
Make rbconfig/sizeof keys as literals
These keys are made from string literals, and used only as keys of
hashes.
2024-10-07 18:45:07 +09:00
Nobuyoshi Nakada
99620b98ba
fake.rb: Copy options in RUBY_DESCRIPTION to the fake string
The `RUBY_DESCRIPTION_WITH` macro has been removed already, so there
are no more descriptions strings with rjit/yjit enabled.
2024-10-03 01:02:18 +09:00
Nobuyoshi Nakada
1f6d2e77d9
Remove leading spaces from LIBPATHFLAG and RPATHFLAG
Join with a space in `MakeMakefile#libpathflag` instead.
2024-09-29 23:07:16 +09:00
Nobuyoshi Nakada
f7ffa76377
Clean up clean only extensions
The clean targets should clean up all extensions, including those have
nothing to build for any reason, e.g., platform requirements etc.
2024-09-11 14:13:30 +09:00
Nobuyoshi Nakada
cb576c13fb
Fix duplicate dependency lines
exts.mk should deal with cleanings of extensions, including bundled
gems.
2024-09-11 14:09:45 +09:00
Nobuyoshi Nakada
ecb58a8d08
Fix prelude to use IBF
Since universal-parser and prism support, prelude code used functions
inaccessible from outside libruby shared library.

```
linking goruby
/usr/bin/ld: goruby.o: in function `prelude_eval':
/home/runner/work/ruby/ruby/build/golf_prelude.c:221: undefined reference to `rb_ruby_prism_ptr'
/usr/bin/ld: goruby.o: in function `pm_prelude_load':
/home/runner/work/ruby/ruby/build/golf_prelude.c:192: undefined reference to `pm_options_line_set'
/usr/bin/ld: /home/runner/work/ruby/ruby/build/golf_prelude.c:193: undefined reference to `pm_parse_string'
/usr/bin/ld: goruby.o: in function `prelude_eval':
/home/runner/work/ruby/ruby/build/golf_prelude.c:224: undefined reference to `pm_iseq_new_with_opt'
/usr/bin/ld: /home/runner/work/ruby/ruby/build/golf_prelude.c:226: undefined reference to `pm_parse_result_free'
/usr/bin/ld: goruby.o: in function `prelude_ast_value':
/home/runner/work/ruby/ruby/build/golf_prelude.c:181: undefined reference to `rb_ruby_ast_data_get'
/usr/bin/ld: goruby.o: in function `prelude_eval':
/home/runner/work/ruby/ruby/build/golf_prelude.c:231: undefined reference to `rb_ruby_ast_data_get'
/usr/bin/ld: goruby.o: in function `pm_prelude_load':
/home/runner/work/ruby/ruby/build/golf_prelude.c:196: undefined reference to `pm_parse_result_free'
collect2: error: ld returned 1 exit status
```
2024-09-08 23:40:17 +09:00
Nobuyoshi Nakada
70871fa6e3
Extract rb_builtin_find
Refactor out the same code from `rb_builtin_ast_value` and
`pm_builtin_ast_value.
2024-09-08 23:16:46 +09:00
Kevin Newton
371432b2d7 [PRISM] Handle RubyVM.keep_script_lines 2024-08-29 20:27:01 -04:00
Alan Wu
a1435981e9 [DOC] Document RbConfig::SIZEOF 2024-07-15 21:08:13 -04:00
Alan Wu
3531d22918 [DOC] Document RbConfig::LIMITS 2024-07-15 21:08:13 -04:00
Alan Wu
9bf1049dfb Refactor so RDoc picks up RbConfig::{SIZEOF,LIMITS} 2024-07-15 21:08:13 -04:00
Peter Zhu
6fc83118bb Fix Makefile.in for non GNUmake
On OpenBSD the Makefile errors with:

    Using $< in a non-suffix rule context is a GNUmake idiom
2024-07-11 15:49:14 -04:00
Peter Zhu
a0469a4788 Rename gc/gc_impl.c to gc/default.c
Changing the name makes it clear that this is the default GC in Ruby.
2024-07-11 09:09:47 -04:00
Peter Zhu
e5d12f9cce Move gc_impl.c to gc/gc_impl.c
This commit creates a new directory `gc` to put different GC
implementations and moves the default GC from gc_impl.c to gc/gc_impl.c.
The default GC can be easily switched using the `BUILTIN_GC` variable
in Makefile.in.
2024-07-11 09:09:47 -04:00