summaryrefslogtreecommitdiff
path: root/template
AgeCommit message (Collapse)Author
2025-05-15YJIT: ZJIT: Allow both JITs in the same buildAlan Wu
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. Notes: Merged: https://github.com/ruby/ruby/pull/13262
2025-05-12digest.so needs ruby/digest.h which is installed by build-extNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/13302
2025-05-02YJIT: ZJIT: Share identical glue functionsAlan Wu
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. Notes: Merged: https://github.com/ruby/ruby/pull/13229
2025-04-30Suppress gcc 15 unterminated-string-initialization warningsNobuyoshi Nakada
2025-04-28Suppress error message when gc is cleaned already [ci skip]Nobuyoshi Nakada
2025-04-23Check Unicode version of the normalization tableNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/13154
2025-04-22Remove extra empty expressionsNobuyoshi Nakada
Only `class_table` values are not quoted and need to terminate %-= literal.
2025-04-18Add zjit_* instructions to profile the interpreter ↵Takashi Kokubun
(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 Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Use separate cargo build flagsTakashi Kokubun
Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Pass CARGO_BUILD_ARGS through properlyAlan Wu
Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Fix template/Makefile.inTakashi Kokubun
Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18prepare Unicode normalization for Unicode 16.0.0Martin Dürst
2025-04-06Ensure builtin binaries are aligned to ibf_headerNobuyoshi Nakada
Since IBF result string size should be multiple of 4, this should not increase the binary size actually. Notes: Merged: https://github.com/ruby/ruby/pull/13075
2025-03-28Ignore to build C extension for test files of bundled gemsHiroshi SHIBATA
2025-03-05Remove obsoleted insn_may_depend_on_sp_or_pc()Takashi Kokubun
which was for MJIT
2025-02-13[Feature #21116] Extract RJIT as a third-party gemNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/12740
2025-02-11YJIT doesn't merge archives anymore [ci skip]Alan Wu
2025-01-14Use LRAMA instead of YACCydah
Notes: Merged: https://github.com/ruby/ruby/pull/12556
2025-01-13CPPFLAGS is needed for dtrace not only INCFLAGSNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/12563
2024-12-27Win32: Fix sub make commandsNobuyoshi Nakada
`cmd.exe` built-in `cd` does not recognize slashes as path separators, replace to backslashes. Notes: Merged: https://github.com/ruby/ruby/pull/12481
2024-12-25fake.rb: Override constants in Ruby moduleNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/12451
2024-12-22Split `modular-gc` into build and installationNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/12428
2024-12-22Allow variables in modular_gc_dirNobuyoshi Nakada
Such as `$(ruby_version)`, `$(arch)` and so on. Notes: Merged: https://github.com/ruby/ruby/pull/12428
2024-12-10Split system dependent commands to clean modular-gcNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/12300
2024-12-05Standardize on the name "modular GC"Peter Zhu
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". Notes: Merged: https://github.com/ruby/ruby/pull/12261
2024-11-26Shell dependent command should be in Makefile.inNobuyoshi Nakada
As common.mk is used by nmake.exe, the commands there need to be accepted also by cmd.exe. Notes: Merged: https://github.com/ruby/ruby/pull/12166
2024-10-11Remove unused PRELOADENV macro in ruby-runner.hPeter Zhu
Notes: Merged: https://github.com/ruby/ruby/pull/11871
2024-10-11Remove unused SOEXT macro in ruby-runner.hPeter Zhu
Notes: Merged: https://github.com/ruby/ruby/pull/11871
2024-10-08Substitute `coroutine_transfer` with prefixed symbol in MakefileNobuyoshi Nakada
``` 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-07Make rbconfig/sizeof keys US-ASCIINobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/11815
2024-10-07Make rbconfig/sizeof keys as literalsNobuyoshi Nakada
These keys are made from string literals, and used only as keys of hashes. Notes: Merged: https://github.com/ruby/ruby/pull/11814
2024-10-03fake.rb: Copy options in RUBY_DESCRIPTION to the fake stringNobuyoshi Nakada
The `RUBY_DESCRIPTION_WITH` macro has been removed already, so there are no more descriptions strings with rjit/yjit enabled. Notes: Merged: https://github.com/ruby/ruby/pull/11766
2024-09-29Remove leading spaces from `LIBPATHFLAG` and `RPATHFLAG`Nobuyoshi Nakada
Join with a space in `MakeMakefile#libpathflag` instead. Notes: Merged: https://github.com/ruby/ruby/pull/11724
2024-09-11Clean up clean only extensionsNobuyoshi Nakada
The clean targets should clean up all extensions, including those have nothing to build for any reason, e.g., platform requirements etc. Notes: Merged: https://github.com/ruby/ruby/pull/11588
2024-09-11Fix duplicate dependency linesNobuyoshi Nakada
exts.mk should deal with cleanings of extensions, including bundled gems. Notes: Merged: https://github.com/ruby/ruby/pull/11588
2024-09-08Fix prelude to use IBFNobuyoshi Nakada
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-08Extract `rb_builtin_find`Nobuyoshi Nakada
Refactor out the same code from `rb_builtin_ast_value` and `pm_builtin_ast_value.
2024-08-29[PRISM] Handle RubyVM.keep_script_linesKevin Newton
Notes: Merged: https://github.com/ruby/ruby/pull/11501
2024-07-15[DOC] Document RbConfig::SIZEOFAlan Wu
2024-07-15[DOC] Document RbConfig::LIMITSAlan Wu
2024-07-15Refactor so RDoc picks up RbConfig::{SIZEOF,LIMITS}Alan Wu
2024-07-11Fix Makefile.in for non GNUmakePeter Zhu
On OpenBSD the Makefile errors with: Using $< in a non-suffix rule context is a GNUmake idiom
2024-07-11Rename gc/gc_impl.c to gc/default.cPeter Zhu
Changing the name makes it clear that this is the default GC in Ruby.
2024-07-11Move gc_impl.c to gc/gc_impl.cPeter Zhu
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-08Add make target shared-gcPeter Zhu
Allows building shared GC using `make shared-gc SHARED_GC=gc_impl`
2024-07-07Also export CC for dtrace's benefit as wellKJ Tsanaktsidis
The CFLAGS might contain flags that only work with the specified CC
2024-07-07Ensure CFLAGS are passed to probes.o generationKJ Tsanaktsidis
The dtrace python script from systemtap on Linux actually looks at the CFLAGS environment variable when invoking gcc to make the probes.o file. If we don't pass the CFLAGS we're using, this probes.o file can wind up without the required annotations indicating that it supports e.g. Intel CET. Fix this by explicitly exporting our build flags to the environment for this script. [Bug #18061]
2024-07-07Remove $(ASFLAGS) from build system and assemble with $(CFLAGS) insteadKJ Tsanaktsidis
We already assemble our assembly files using the $(CC) compiler driver, rather than the actual $(AS) assembler. This means that * The C preprocessor gets run on the assembly file * It's valid to pass gcc-style flags to it, like e.g. -mbranch-protection or -fcf-protection * If you do so, the relevant preprocessor macros like __CET__ get set * If you really wanted to pass assembler flags, you would need to do that using -Wa,... anyway So I think it makes sense to pass "$(XCFLAGS) $(CFLAGS) $(CPPFLAGS)" to gcc/clang/etc when assembling, rather than passing $(ASFLAGS) (since the flags are not actually passed to `as`, but `cc`!). The side effect of this is that if there are mitigation flags like -fcf-protection in $CFLAGS, then the relevant macros like __CET__ will be defined when assembling the files. [Bug #20601]
2024-06-24Use gperf 3.1 to generate ANSI-C codeNobuyoshi Nakada
2024-06-11Extract hardening CFLAGS to a special $hardenflags variableKJ Tsanaktsidis
This changes the automatic detection of -fstack-protector, -D_FORTIFY_SOURCE, and -mbranch-protection to write to $hardenflags instead of $XCFLAGS. The definition of $cflags is changed to "$hardenflags $orig_cflags $optflags $debugflags $warnflags" to match. Furthermore, these flags are _prepended_ to $hardenflags, rather than appended. The implications of doing this are as follows: * If a CRuby builder specifies cflags="-mbranch-protection=foobar" at the ./configure script, and the configure script detects that -mbranch-protection=pac-ret is accepted, then GCC will be invoked as "gcc -mbranch-protection=pac-ret -mbranch-protection=foobar". Since the last flags take precedence, that means that user-supplied values of these flags in $cflags will take priority. * Likewise, if a CRuby builder explicitly specifies "hardenflags=-mbranch-protection=foobar", because we _prepend_ to $hardenflags in our autoconf script, we will still invoke GCC as "gcc -mbranch-protection=pac-ret -mbranch-protection=foobar". * If a CRuby builder specifies CFLAGS="..." at the configure line, automatic detection of hardening flags is ignored as before. * C extensions will _also_ be built with hardening flags now as well (this was not the case by default before because the detected flags went into $XCFLAGS). Additionally, as part of this work, I changed how the detection of PAC/BTI in Context.S works. Rather than appending the autodetected option to ASFLAGS, we simply compile a set of test programs with the actual CFLAGS in use to determine what PAC/BTI settings were actually chosen by the builder. Context.S is made aware of these choices through some custom macros. The result of this work is that: * Ruby will continue to choose some sensible defaults for hardening options for the C compiler * Distributors are able to specify CFLAGS that are consistent with their distribution and override these defaults * Context.S will react to whatever -mbranch-protection is actually in use, not what was autodetected * Extensions get built with hardening flags too. [Bug #20154] [Bug #20520]