summaryrefslogtreecommitdiff
path: root/configure.ac
AgeCommit message (Collapse)Author
2025-12-16merge revision(s) bc2a8a002a6c41fc1b28e02e15e2fb2b72d1b66e, ↵Takashi Kokubun
c26057ebafb23b063190d31d5b4d19a0e0a1306c: [Backport #21779] [PATCH] [Bug #21779] Uniquify `InitVM` functions as well as `Init` Avoid possible name conflict when `--with-static-linked-ext`. [PATCH] [Bug #21779] Do not export InitVM functions Fix ruby/io-console#105.
2025-07-14merge revision(s) b42afa1dbcbb91e89852b3b3bc72484d7f0a5528, ↵Takashi Kokubun
f1f0cc14cc7d3f9be35b203e5583f9224b1e2387, 543e3a1896ae2fe3b5b954f6497d261ab5663a15, ed2806117a0b76e4439ce1a061fae21d9e116d69, 46e4c8673747de96838d2c5dec37446d23d99d88: [Backport #21500] Suppress gcc 15 unterminated-string-initialization warnings Separate `__has_attribute` from `defined(__has_attribute)` Fix Visual C warnings: ``` regenc.h(121): warning C4067: unexpected tokens following preprocessor directive - expected a newline ``` Cast up `int` instruction code to `VALUE` Fix Visual C warnings: ``` iseq.c(3793): warning C4312: 'type cast': conversion from 'int' to 'void *' of greater size iseq.c(3794): warning C4312: 'type cast': conversion from 'int' to 'void *' of greater size ``` Do not let files depend on a phony target Detect `clock_gettime` and `clock_getres` for winpthreads
2025-02-13merge revision(s) 051af9529b03c11aff8f6a09522c69983e3a9d72: [Backport #21017]Takashi Kokubun
[Bug #21017] Fix `--with-parser` configure option
2024-12-18Fix the end of "dlext & soext" section [ci skip]Nobuyoshi Nakada
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-26[MinGW] - Fix NET_LUID checkRaed Rizqie
Notes: Merged: https://github.com/ruby/ruby/pull/12165
2024-11-09[Bug #20800] Use config target for bin directory as-isNobuyoshi Nakada
The "target" in `RbConfig::CONFIG` is being changed from config.sub to align to the system `uname`. Use the value modified by config.sub, and make the directory same as GNU utilities, such as binutils. Notes: Merged: https://github.com/ruby/ruby/pull/12043
2024-11-09[Bug #20800] Locate executable binary file under "libexec" directlyNobuyoshi Nakada
"libexec" means the directory for executable or binary files already. Notes: Merged: https://github.com/ruby/ruby/pull/12043
2024-11-09Add integer overflow check macros for add/sub as well as mulNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/12034
2024-10-23Check if -pipe option worksNobuyoshi Nakada
With `-pipe` option, gcc of Homebrew on macOS results in a mysterious error. ``` $ command -v gcc-14 /opt/homebrew/bin/gcc-14 $ gcc-14 --version gcc-14 (Homebrew GCC 14.2.0) 14.2.0 Copyright (C) 2024 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. $ gcc-14 -c -pipe conftest.c clang: error: no input files ``` Notes: Merged: https://github.com/ruby/ruby/pull/11928
2024-10-11Improve RUBY_GC_LIBRARYPeter Zhu
Instead of passing the full GC SO file name to RUBY_GC_LIBRARY, we now only need to pass the GC name. For example, before we needed to pass `RUBY_GC_LIBRARY=librubygc.default.so` but now we only need to pass `RUBY_GC_LIBRARY=default`. Notes: Merged: https://github.com/ruby/ruby/pull/11866
2024-10-10Add `--with-parser` configure optionNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/11852
2024-10-05Use quadrigraphs for a hashNobuyoshi Nakada
So that the closing bracket does not look like commented out.
2024-10-04[Bug #20783] Insert a space between RPATHFLAG and LIBPATHFLAGNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/11797
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-19Use ppc64le coroutines for powerpc64-freebsd*Piotr Kubaj
There is nothing endianness-related in ppc64le and all the tests pass on both ucontext and ppc64le coroutines on powerpc64-freebsd14.0 Notes: Merged: https://github.com/ruby/ruby/pull/10595
2024-09-19Use ppc64le coroutines on powerpc64le-freebsd*Piotr Kubaj
Only one ractor-related test fails, but it also fails with ucontext. Notes: Merged: https://github.com/ruby/ruby/pull/10595
2024-09-06Add an explicit check for broken libunwind buildsKJ Tsanaktsidis
Libunwind as packaged in MacOS cannot actually unwind code which has pointer authentication on, because _LIBUNWIND_IS_NATIVE_ONLY is not defined. Add a check for this, and prefer building with working unwinding over pointer authentication if we must make a choice. Notes: Merged: https://github.com/ruby/ruby/pull/11548
2024-09-06Revert "Check for both aarch64 and arm64 arch's for pac-ret"Peter Zhu
This reverts commit 6a746e1bc902d4245aac58db4e9ffc2f72d79629. This patch breaks the C level backtrace on macOS ARM machines. Notes: Merged: https://github.com/ruby/ruby/pull/11548
2024-08-22Check for both aarch64 and arm64 arch's for pac-retKJ Tsanaktsidis
Linux calls it aarch64, but MacOS calls it arm64; pac-ret works on both. Notes: Merged: https://github.com/ruby/ruby/pull/11405
2024-08-21[Bug #20687] Check if base ruby provides necessary librariesNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/11419
2024-08-16Revert soname changesRaed Rizqie
- only i386-ucrt soname is changed to fix building on x86 clang - fix detection of x86intrin.h on x86 system - mingw does not have LIBRUBY_SONAME Notes: Merged: https://github.com/ruby/ruby/pull/11362
2024-08-12Revert change of "mingw-ucrt" platform stringLars Kanis
... of commit 00176cd40fe9f385231e9c20b956fc4a84d240b9. The reverted change was made only for constistency, as discussed in https://github.com/ruby/ruby/pull/11358#issuecomment-2282222369 But the platform string "mingw-ucrt" should not be changed. It is used as RUBY_PLATFORM and as the rubygems platform, so that there should be a good reason to change the name of an established platform. "mingw-ucrt" was introduced intentionally in commit 576b2e64cdc5ea42ad345dd3c1c215e006c06fca. Related to GH-11358 Notes: Merged: https://github.com/ruby/ruby/pull/11364 Merged-By: XrXr
2024-08-11fix ucrt archRaed Rizqie
Notes: Merged: https://github.com/ruby/ruby/pull/11358
2024-07-18YJIT: Allow dev_nodebug to disasm release-mode code (#11198)Takashi Kokubun
* YJIT: Allow dev_nodebug to disasm release-mode code * Revert "YJIT: Squash canary before falling back" This reverts commit f05ad373d84909da7541bd6d6ace38b48eaf24a1. The stray canary issue should have been solved by def7023ee4a3fc6eeba9d3a34c31a5bcff315fac, alleviating this codegen accommodation. * s/runtime_assertions/runtime_checks/ --------- Co-authored-by: Alan Wu <XrXr@users.noreply.github.com> Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2024-07-16Stop using `sigsetjmp` to hijack SIGCHLD handlerNobuyoshi Nakada
It already has been dead code. Follow up of 65d3eacc80bbefb29e5cd0f3f9661d886f2e4cee.
2024-07-16Fix a typoKazuhiro NISHIYAMA
[Misc #20636]
2024-07-07Revert autoconf macros defining RUBY_AARCH64_{BTI|PAC}_ENABLEDKJ Tsanaktsidis
This partially reverts https://github.com/ruby/ruby/pull/10944; now that we decided to pass CFLAGS to $(CC) when assembling .S files, we don't need these autoconf macros that capture the state of __ARM_FEATURE{PAC|BTI}_DEFAULT. [Bug #20601]
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-07-05Change external GC to use directory at configurePeter Zhu
This commit changes the external GC API to use `--with-shared-gc=DIR` at configure time with a directory of the external GC and uses `RUBY_GC_LIBRARY` environment variable to load the external GC at runtime.
2024-07-03Add explicit compiler fence when pushing frames to ensure safe profilingIvo Anjo
**What does this PR do?** This PR tweaks the `vm_push_frame` function to add an explicit compiler fence (`atomic_signal_fence`) to ensure profilers that use signals to interrupt applications (stackprof, vernier, pf2, Datadog profiler) can safely sample from the signal handler. **Motivation:** The `vm_push_frame` was specifically tweaked in https://github.com/ruby/ruby/pull/3296 to initialize the a frame before updating the `cfp` pointer. But since there's nothing stopping the compiler from reordering the initialization of a frame (`*cfp =`) with the update of the cfp pointer (`ec->cfp = cfp`) we've been hesitant to rely on this on the Datadog profiler. In practice, after some experimentation + talking to folks, this reordering does not seem to happen. But since modern compilers have a way for us to exactly tell them not to do the reordering (`atomic_signal_fence`), this seems even better. I've actually extracted `vm_push_frame` into the "Compiler Explorer" website, which you can use to see the assembly output of this function across many compilers and architectures: https://godbolt.org/z/3oxd1446K On that link you can observe two things across many compilers: 1. The compilers are not reordering the writes 2. The barrier does not change the generated assembly output (== has no cost in practice) **Additional Notes:** The checks added in `configure.ac` define two new macros: * `HAVE_STDATOMIC_H` * `HAVE_DECL_ATOMIC_SIGNAL_FENCE` Since Ruby generates an arch-specific `config.h` header with these macros upon installation, this can be used by profilers and other libraries to test if Ruby was compiled with the fence enabled. **How to test the change?** As I mentioned above, you can check https://godbolt.org/z/3oxd1446K to confirm the compiled output of `vm_push_frame` does not change in most compilers (at least all that I've checked on that site).
2024-06-22Exported symbols in DLL on Windows are managed by win32/mkexports.rbNobuyoshi Nakada
2024-06-22build: fix crossruby build by handling empty `ac_abs_builddir`Yuta Saito
`ac_abs_builddir` can be empty when the build is top-level (not subdirs, and Ruby is usually the case). In such case, the MINIRUBY is expanded to `$RUBY -I -r'$(arch)-fake'`, which interprets `-r$(arch)-fake` as an argument to `-I` option. This led to: - Not loading the fake config file - Then not setting `CROSS_COMPILING` constant during extmk.rb execution - Then misusing cross-compiled `./miniruby` instead of baseruby to generate files used in exts. This commit fixes the issue by handling the empty `ac_abs_builddir` case properly.
2024-06-22Get rid of nesting backquotesNobuyoshi Nakada
Also executing variable containing an option may not be portable. Follow up of dd378c5a2483002d50053cf81d00004c1fb3c8bd.
2024-06-22Expand --with-opt-dir argumentsNobuyoshi Nakada
2024-06-21Support LCOV 2.0Yusuke Endoh
LCOV 2.0, a GCOV frontend, seems to have stricter error checking
2024-06-12Fix a typoydah
s/sepcifier/specifier/
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]
2024-06-09Use `dllexport` as `RUBY_FUNC_EXPORTED` on WindowsNobuyoshi Nakada
2024-06-06Disable __builtin_setjmp usage on linux-aarch64Jeremy Evans
It is questionable whether __builtin_setjmp should default to yes at all, but since it appears to still have problems on this platform, it seems safest to disable it. Fixes [Bug #14480]
2024-06-01Add dependencies of configure.acNobuyoshi Nakada
2024-05-29GCC LD does not support `.debug_macinfo` yetNobuyoshi Nakada
Lower debug info level if it is warned, not checks with werror_flag to fail due to this warning.
2024-05-23[Bug #20500] Search non-default directories for jemallocNobuyoshi Nakada
Co-Authored-by: lish82 (Hiroki Katagiri)
2024-05-22[Bug #20499] Use Xcode owned tools for Xcode clangNobuyoshi Nakada
Xcode has its own version tools that may be incompatible with genuine LLVM tools, use the tools in the same directory.
2024-05-22Revert "[Bug #20499] Use consistent version tools with CC"Hiroshi SHIBATA
This reverts commit 8277cf0799145bed0c813bfcc187739f77b3102d. This change break to build with `rbenv install ruby-dev` with the following error. ``` touch yjit/target/release/libyjit.a transdb.h updated ./tool/darwin-ar: line 6: /nm: No such file or directory ./tool/darwin-ar: line 6: exec: /nm: cannot execute: No such file or directory partial linking yjit/target/release/libyjit.a into yjit/target/release/libyjit.o ```
2024-05-21[Bug #20499] Use consistent version tools with CCNobuyoshi Nakada
As Apple Xcode is relocatable and selectable with `xcode-select`, use consistent versions of commands in the same location.
2024-05-20Fix the end of "compiler section"Nobuyoshi Nakada
2024-05-20[Bug #20494] Search non-default directories for GMPNobuyoshi Nakada
Co-Authored-by: lish82 (Hiroki Katagiri)
2024-04-27use of stdckdint.h卜部昌平
C23 is going to have this header. The industry is already moving towards accepting it; OSes and compilers started to implement theirs. Why not detect its presence and if any, prefer over other ways. See also: - https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2683.pdf - https://reviews.freebsd.org/D41734 - https://reviews.llvm.org/D157331 - https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=8441841a1b985d68245954af1ff023db121b0635
2024-04-19Suppress useless linker warnings totally on macOSNobuyoshi Nakada