summaryrefslogtreecommitdiff
path: root/configure.ac
AgeCommit message (Collapse)Author
2025-06-06Detect `clock_gettime` and `clock_getres` for winpthreadsNobuyoshi Nakada
2024-10-20merge revision(s) bcb3247072e6973d0f6b50ca5fed238d5824bd28: [Backport #20500]nagachika
[Bug #19778] Pass additional include options to INCFLAGS in common.mk
2024-10-20merge revision(s) 5fa6ba9568e87e43e08a4daeba1572254c589fb1: [Backport #20500]nagachika
[Bug #20500] Search non-default directories for jemalloc Co-Authored-by: lish82 (Hiroki Katagiri)
2024-07-15Revert "merge revision(s) 5fa6ba9568e87e43e08a4daeba1572254c589fb1: ↵nagachika
[Backport #20500]" This reverts commit fc5b9ffad1b0710bd999521d0bf9631af6b762c2.
2024-07-15merge revision(s) 5fa6ba9568e87e43e08a4daeba1572254c589fb1: [Backport #20500]nagachika
[Bug #20500] Search non-default directories for jemalloc Co-Authored-by: lish82 (Hiroki Katagiri)
2024-07-06[Backport #11036 to 3.2] Add explicit compiler fence when pushing frames to ↵Ivo Anjo
ensure safe profiling **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. This is a backport of #11036 to Ruby 3.2 . **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-07-06merge revision(s) 1e08a9f0e9058186db18f29efc6458c00f10a856: [Backport #20499]nagachika
[Bug #20499] Use Xcode owned tools for Xcode clang Xcode has its own version tools that may be incompatible with genuine LLVM tools, use the tools in the same directory.
2024-06-18Revert "merge revision(s) 18eaf0be905e3e251423b42d6f4e56b7cae1bc3b: ↵nagachika
[Backport #20494]" This reverts commit ec30266267b2a063089b8ce7967203bcbadbdf4e.
2024-06-15merge revision(s) 18eaf0be905e3e251423b42d6f4e56b7cae1bc3b: [Backport #20494]nagachika
[Bug #20494] Search non-default directories for GMP Co-Authored-by: lish82 (Hiroki Katagiri)
2024-02-25merge revision(s) ↵nagachika
665b4c5b2a31078d7db0173ad60daad0b463c1fd,642875e474b4e6a13770b1dbbc33d466ba5e0718,54b9b80b84760717aadb8bf67f638785ed895a58,361bce8d2c4c90a01eb3b7365a87dec0d93bb2b6: [Backport #19967] [Bug #19967] Reset `LIBPATHENV` env after started Not to affect other tools invoked as child processes. --- common.mk | 3 ++- template/Makefile.in | 3 +++ template/fake.rb.in | 3 +++ tool/fake.rb | 8 ++++++++ 4 files changed, 16 insertions(+), 1 deletion(-) [Bug #19967] Revert "configure.ac: LIBPATHENV on macOS" This reverts commit 1961c786aab243b3eb60e7238224e87975d88056. These environment variables should no longer propagate to child processes. --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) [Bug #19967] Delete real path --- tool/fake.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) [Bug #19967] Ignore library before build --- tool/fake.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
2023-09-30merge revision(s) fe0225ff4d5af8b1f54009727b39d0d9b821eea3: [Backport #19778]nagachika
[Bug #19778] Add `-I` options for opt-dir to `$INCFLAGS` These options have been separated from `$CFLAGS` already in the other places. --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
2023-07-22merge revision(s) 038f9ade3c4d965415e4956561975454cf9eeb21: [Backport #19585]nagachika
Use tools appropriate with CC To get rid of mysterious errors such as: ``` /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/nm: error: libruby.3.3-static.a(/): The end of the file was unexpectedly encountered ``` and ``` ld: warning: ignoring file ../../libruby.3.3-static.a, building for macOS-x86_64 but attempting to link with file built for macOS-x86_64 Undefined symbols for architecture x86_64: "_rb_rational_num", referenced from: ``` --- configure.ac | 6 ++++++ 1 file changed, 6 insertions(+)
2023-03-18merge revision(s) 96d1acfdf6c6b42f2029f44d5b5920961d6efa92: [Backport #19161]NARUSE, Yui
[Bug #19161] Check for TLS usability On all platforms using GCC, even other than darwin. --- configure.ac | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-)
2022-12-24Revert "darwin: resolve rb symbols from ext by `-flat_namespace` to see ↵NARUSE, Yui
libruby transitively" This reverts commit c5eefb7f37db2865891298dd1a1e60dff09560ad. Flat namespace breaks gems with C extention if its symbols conflict with ohter libraries.
2022-12-23darwin: resolve rb symbols from ext by `-flat_namespace` to see libruby ↵Yuta Saito
transitively This repairs the assumption, which many fat-gem maintainer expect, "An extension built with --disable-shared Ruby is loadable from --enable-shared Ruby". By default all references resolved to a dynamic library use "two-level namespace", which record the library name and symbol name for each resolution entry. On the other hand, `-flat_namespace` discards the library name information and resolves symbols "flatly". This behavior is useful for us to ignore which image (`ruby` executable or `libruby.dylib`) provides rb symbols at runtime. Notes: Merged: https://github.com/ruby/ruby/pull/7008
2022-12-20configure.ac: limit miniruby dep to when bundle_loader needs itMike Dalessio
See also e7bffe0 https://bugs.ruby-lang.org/issues/19239 Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org> Notes: Merged: https://github.com/ruby/ruby/pull/6959
2022-12-19YJIT: Improve the description about --enable-yjit (#6947)Takashi Kokubun
Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2022-12-18Suppress cross tool warning for pkg-config [ci skip]Nobuyoshi Nakada
It is used from mkmf.rb on target environments.
2022-12-18configure.ac: add miniruby to PREP when cross-compiling to darwinMike Dalessio
miniruby is used to resolve symbols in ext bundles https://bugs.ruby-lang.org/issues/19239 Co-authored-by: Yuta Saito <kateinoigakukun@gmail.com> Notes: Merged: https://github.com/ruby/ruby/pull/6944
2022-12-12Make it so YJIT is no longer marked as experimental (#6909)Maxime Chevalier-Boisvert
Tested on production workloads at Shopify for > 1 year and proven to be quite stable. Enabling YJIT at run-time is still guarded behind the --yjit command-line option for now. Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2022-12-02YJIT: echo "\n" is not portableAlan Wu
It's unspecified by POSIX. zsh and dash give a newline and bash doesn't substitute it. Attributes don't have to be followed by a newline anyway, so just remove it. [Bug #19174]
2022-12-03Fix up "Avoid bash specific variable substitution"Nobuyoshi Nakada
Keep `target_alias` empty if it is set to empty. If it is set to non empty, `os_version_style_transform` is not used.
2022-12-02Avoid bash specific variable substitutionNobuyoshi Nakada
It may cause parse errors in some other sh even in never executed parts. Notes: Merged: https://github.com/ruby/ruby/pull/6844
2022-11-24YJIT: Make sure rustc's target matches before enabling (#6804)Alan Wu
For people using Rosetta 2 on ARM Macs, it can happen that the rustc in the PATH compiles for x86_64 while clang is targeting ARM. We were enabling YJIT in these situations because the test program compiled fine, but caused linking failure later due to the architecture mismatch. Adjust the test program to fail when rustc's target arch is different from ruby's target arch. [Bug #19146] Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2022-11-20Add a comment about confusing code [ci skip]Takashi Kokubun
2022-11-17Add support for `sockaddr_un` on Windows. (#6513)Samuel Williams
* Windows: Fix warning about undefined if_indextoname() * Windows: Fix UNIXSocket on MINGW and make .pair more reliable * Windows: Use nonblock=true for read tests with scheduler * Windows: Move socket detection from File.socket? to File.stat Add S_IFSOCK to Windows and interpret reparse points accordingly. Enable tests that work now. * Windows: Use wide-char functions to UNIXSocket This fixes behaviour with non-ASCII characters. It also fixes deletion of temporary UNIXSocket.pair files. * Windows: Add UNIXSocket tests for specifics of Windows impl. * Windows: fix VC build due to missing _snwprintf Avoid usage of _snwprintf, since it fails linking ruby.dll like so: linking shared-library x64-vcruntime140-ruby320.dll x64-vcruntime140-ruby320.def : error LNK2001: unresolved external symbol snwprintf x64-vcruntime140-ruby320.def : error LNK2001: unresolved external symbol vsnwprintf_l whereas linking miniruby.exe succeeds. This patch uses snprintf on the UTF-8 string instead. Also remove branch GetWindowsDirectoryW, since it doesn't work. * Windows: Fix dangling symlink test failures Co-authored-by: Lars Kanis <kanis@comcard.de> Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2022-11-16YJIT: Show YJIT build option in RUBY_DESCRIPTION (#6738)Takashi Kokubun
YJIT: Show YJIT profile in RUBY_DESCRIPTION Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2022-11-10Define YJIT_STATS on --enable-yjit=stats (#6710)Takashi Kokubun
Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2022-11-10Set up EXTSTATIC before checking itAlan Wu
The bundle_loader check for darwin checks EXTSTATIC, but previously the setup for the variable comes after the check. I had trouble building using --with-static-linked-ext on darwin before this change. Notes: Merged: https://github.com/ruby/ruby/pull/6675 Merged-By: XrXr
2022-11-08YJIT: Improve checking message for rustc version (#6693)Alan Wu
Preivously we didn't have a "checking ...." line for this check and when rustc was too old, we would dump the error message to the console like: checking for rustc... rustc error: there is no argument named `x` --> <anon>:1:33 | 1 | fn main() { let x = 1; format!("{x}"); } | ^^^ error: aborting due to previous error `configure` checks usually don't do this and this might be confusing. With this commit it now says something like: checking whether rustc is new enough for YJIT... no Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2022-11-08YJIT: improve/fix code to automatically build YJIT when available (#6684)Maxime Chevalier-Boisvert
* YJIT: improve/fix code to automatically build YJIT when available * Set YJIT_SUPPORT=no * Fix rustc => $RUSTC Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2022-11-06Check `rustc` with the targetNobuyoshi Nakada
2022-11-06`--disable-jit-support` should disable YJIT successfullyNobuyoshi Nakada
Even if `rustc` is available, it should not be an error unless `--enable-yjit` is explicitly given. Notes: Merged: https://github.com/ruby/ruby/pull/6681
2022-11-06Disable YJIT support when cross-compilingNobuyoshi Nakada
As the target-list of `rustc` is different from `config.guess` and `config.sub`, `$target` cannot be used directly.
2022-11-06Add `--target` option to RUSTC when cross-compilingNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/6677
2022-11-06Should use the configured rustc consistentlyNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/6677
2022-11-04Auto-enable YJIT build when rustc >= 1.58.0 present (#6662)Maxime Chevalier-Boisvert
* Auto-enable YJIT build when rustc >= 1.58.0 present * Try different incantation to have rustc output to stdout only * Add comment, remove whitespace * Try to detect if we are on a platform on which YJIT is supported Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2022-10-30Try -fstack-protector-strong on MinGWNobuyoshi Nakada
The CI for MinGW has used it.
2022-10-29Clear `_FORTIFY_SOURCE` before definitionNobuyoshi Nakada
As clang on macOS defines this macro as 0 internally when a sanitizer option is given, clear it before definition to suppress redefinition warnings. Notes: Merged: https://github.com/ruby/ruby/pull/6646
2022-10-19YJIT: fold the "asm_comments" feature into "disasm" (#6591)Alan Wu
Previously, enabling only "disasm" didn't actually build. Since these two features are closely related and we don't really use one without the other, let's simplify and merge the two features together. Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2022-10-19Fix and improve coroutines for Darwin (macOS) ppc/ppc64. (#5975)Sergey Fedorov
Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2022-10-15Remove wrong dollarNobuyoshi Nakada
2022-10-02[Bug #16909] Honor the tool prefix against pkg-configNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/6482
2022-09-27YJIT: reverse configure.ac changes that disable `--yjit-stats` on Graviton1 ↵Maxime Chevalier-Boisvert
(#6457) Reverse configure.ac changes that disable YJIT stats on Graviton1 Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2022-09-26Generate the revision.h before MakefileNobuyoshi Nakada
Except for GNU make which updates makefiles automatically, repeating configure in the same directory causes `make` to stop whenever pulled a new commit. This is unexpected in CIs. Notes: Merged: https://github.com/ruby/ruby/pull/6436
2022-09-25Extract `RUBY_RELEASE_DATE` from also revision.hNobuyoshi Nakada
This make variable is very useful for daily build. Notes: Merged: https://github.com/ruby/ruby/pull/6433 Merged-By: nobu <nobu@ruby-lang.org>
2022-09-23YJIT: Support Rust 1.58.1 for --yjit-stats on Arm (#6410)Takashi Kokubun
* YJIT: Test Rust 1.58.1 as well on Cirrus * YJIT: Avoid using a Rust 1.60.0 feature * YJIT: Use autoconf to detect support * YJIT: We actually need to run it for checking it properly * YJIT: Try cfg!(target_feature = "lse") * Revert "YJIT: Try cfg!(target_feature = "lse")" This reverts commit 4e2a9ca9a9c83052c23b5e205c91bdf79e88342e. * YJIT: Add --features stats only when it works * Update configure.ac Co-authored-by: Maxime Chevalier-Boisvert <maximechevalierb@gmail.com> Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2022-09-23Allow --enable-yjit on OpenBSDJeremy Evans
yjit uses _Unwind_* functions from libunwind. These functions are available in libc++abi (which requires libpthread), so add those to LDFLAGS if enabling yjit on OpenBSD. Notes: Merged: https://github.com/ruby/ruby/pull/6421
2022-09-20YJIT: Support MAKE=bmake for release buildAlan Wu
This add support for bmake, which should allow building with `configure --enable-yjit` for the BSDs. Tested on FreeBSD 13 and on macOS with `configure MAKE=bmake` on a case-sensitive file system. It works by including a fragment into the Makefile through the configure script, similar to common.mk. It uses the always rebuild approach to keep build system changes minimal. Notes: Merged: https://github.com/ruby/ruby/pull/6408
2022-09-17[Bug #19005] dynamic_lookup linker option in external librariesNobuyoshi Nakada
The warning against `-undefined dynamic_lookup` is just a warning yet, and many gems seem to pay no attention to warnings. Until it fails actually, keep it as a migration path, except for standard extension libraries and bundled extension gems. Notes: Merged: https://github.com/ruby/ruby/pull/6394 Merged-By: nobu <nobu@ruby-lang.org>