summaryrefslogtreecommitdiff
path: root/configure.ac
AgeCommit message (Collapse)Author
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
2024-04-15Add --with-shared-gc build flagMatt Valentine-House
2024-04-16Not all `nm`s support the `--help` optionNobuyoshi Nakada
2024-04-04Revert "hijack SIGCHLD handler for internal use"Nobuyoshi Nakada
This reverts commit 054a412d540e7ed2de63d68da753f585ea6616c3. SIGCHLD `waidpid`, `waitpid_lock` and related code, have been removed at ruby/ruby#7527.
2024-04-02[DOC] Fix wheather -> whether typos in configure.Matt Valentine-House
2024-03-31Manage required baseruby version in one placeNobuyoshi Nakada
Add a Ruby script mode to `tool/missing-baseruby.bat` that checks if `RUBY_VERSION` meets the required version. This will enable similar checks on mswin as well.
2024-03-30Manage required baseruby version in one placeNobuyoshi Nakada
2024-03-10Clean intermediate files and debug info for each targetNobuyoshi Nakada
By replacing `ALLOBJS` suffix with intermediate file suffixes instead of roughly removing by wildcards. Made `cleanlibs` append `.dSYM` suffix for each word in `TARGET_SO`, not the end of the entire list.
2024-03-06Remove `-f` option for `codesign`Nobuyoshi Nakada
Recent `codesign` seems to emit a "replacing existing signature" warning even if it was an adhoc signature added by the linker. Since "adhoc" signatures do not cause a failure when replaced, it is just unnecessary and noisy.
2024-03-02configure.ac: Append `POSTLINK` to `LINK_SO` for all platformsYuta Saito
The `POSTLINK` variable had been used only for darwin platforms, but it's now used for WebAssembly/WASI as well. To make shared extension libraries properly post-processed, we need to append `POSTLINK` to `LINK_SO` but it was done only for darwin platforms. This commit generalizes the appending to all platforms.
2024-03-01[wasm-pic] Add `LDSHARED` definition for WASI platformYuta Saito
We are going to add dynamic linking support for WASI platform. The `LDSHARED` definition is used to link shared libraries for building ruby binaries and extensions.
2024-02-29[wasm-pic] Remove --pass-arg=asyncify-ignore-imports from POSTLINKYuta Saito
Before PIC era, we could assume that the stack is not unwound by imported functions since all imported functions are WASI syscalls and they don't use Asyncify at all. However, PIC binary can import functions from other modules and we cannot guarantee that they won't unwind the stack.
2024-02-18Install binary executable files to architecture dependent pathNobuyoshi Nakada
2024-02-15Bump the required BASERUBY version to 3.0 (#9976)Takashi Kokubun
2024-01-16Bump the required BASERUBY version to 2.7 (#9566)Takashi Kokubun
[[Misc #16671]](https://bugs.ruby-lang.org/issues/16671)
2023-12-28[Bug #20085] Use consistent default options for `-mbranch-protection`Yuta Saito
We need to use the same options for both C compiler and assembler when `-mbranch-protection` is guessed by configure. Otherwise, `coroutine/arm64/Context.{h,S}` will use incompatible PAC strategies.
2023-12-27[Bug #20088] Fix ARCH_FLAG for cross compilingNobuyoshi Nakada
2023-12-20KQueue support for M:N threadsJP Camara
* Allows macOS users to use M:N threads (and technically FreeBSD, though it has not been verified on FreeBSD) * Include sys/event.h header check for macros, and include sys/event.h when present * Rename epoll_fd to more generic kq_fd (Kernel event Queue) for use by both epoll and kqueue * MAP_STACK is not available on macOS so conditionall apply it to mmap flags * Set fd to close on exec * Log debug messages specific to kqueue and epoll on creation * close_invalidate raises an error for the kqueue fd on child process fork. It's unclear rn if that's a bug, or if it's kqueue specific behavior Use kq with rb_thread_wait_for_single_fd * Only platforms with `USE_POLL` (linux) had changes applied to take advantage of kernel event queues. It needed to be applied to the `select` so that kqueue could be properly applied * Clean up kqueue specific code and make sure only flags that were actually set are removed (or an error is raised) * Also handle kevent specific errnos, since most don't apply from epoll to kqueue * Use the more platform standard close-on-exec approach of `fcntl` and `FD_CLOEXEC`. The io-event gem uses `ioctl`, but fcntl seems to be the recommended choice. It is also what Go, Bun, and Libuv use * We're making changes in this file anyways - may as well fix a couple spelling mistakes while here Make sure FD_CLOEXEC carries over in dup * Otherwise the kqueue descriptor should have FD_CLOEXEC, but doesn't and fails in assert_close_on_exec
2023-12-19Add tool/missing-baseruby.bat, used when BASERUBY not availableJeremy Evans
Previously, the embedded semicolon in BASERUBY if BASERUBY is not available breaks tarball builds without BASERUBY when using OpenBSD make, due to the inability to escape MFLAGS correctly. This moves the same BASERUBY code into a separate file, avoiding the MFLAGS quoting issue. BASERUBY must be passed to build-ext because it is required by ripper since the introduction of lrama. Fixes [Bug #19683] Co-authored-by: Nobuyoshi Nakada <[email protected]>
2023-12-18RJIT: Share rb_vm_insns_count for vm_insns_countTakashi Kokubun
2023-12-15Fix `ARCH_FLAG` when cross-compiling on macOSNobuyoshi Nakada
2023-12-13RJIT: Just skip generating code for aarch64/arm64 (#9221)Takashi Kokubun
2023-12-12Fix a typo for `RJIT_TARGET_OK` (#8222)Nobuyoshi Nakada
2023-11-24Check `windres` message using the found `windres` only if neededNobuyoshi Nakada
2023-11-23windows-arm64 support (#8995)Pierrick Bouvier
* [win32] fix compilation for windows-arm64 Credits to MSYS2 Ruby package using this patch. * [win32] nm use full options Fix compilation error when using MSYS2 environment. Credits to MSYS2 Ruby package using this patch. * [win32] detect llvm-windres (used for windows-arm64) When adding preprocessor option for llvm-windres (using clang as parameter), it fails. Thus, do not add this. It's needed to be able to compile windows-arm64 version, because MSYS2 toolchain is LLVM based (instead of GCC/binutils). * [win32] pioinfo detection for windows-arm64 This fixes "unexpected ucrtbase.dll" for native windows-arm64 ruby binary. It does not solve issue with x64 version emulated on this platform. Value of pioinfo pointer can be found in ucrtbase.dll at latest adrp/add sequence before return of _isatty function. This works for both release and debug ucrt. Due to the nature of aarch64 ISA (vs x86 or x64), it's needed to disassemble instructions to retrieve offset value, which is a bit more complicated than matching specific string patterns. Details about adrp/add usage can be found in this blog post: https://devblogs.microsoft.com/oldnewthing/20220809-00/?p=106955 For instruction decoding, the Arm documentation was used as a reference.
2023-11-21[Bug #20004] Revert "[Feature #19422] Enable shared by default on macOS"Hiroshi SHIBATA
This reverts commit 9694445051c4192c8f659529133acab253bd0bc3. This change broke our release CI. https://github.com/ruby/actions/actions/runs/6599016994/job/17927644579#step:16:44 Invoking `/Users/runner/work/actions/actions/snapshot-master/ruby -rrubygems /Users/runner/work/actions/actions/snapshot-master/bin/gem --backtrace build lib/bundler/bundler.gemspec` failed with output: ---------------------------------------------------------------------- dyld[42417]: Library not loaded: '/usr/local/lib/libruby.3.3.dylib' Referenced from: '/Users/runner/work/actions/actions/snapshot-master/ruby' Reason: tried: '/usr/local/lib/libruby.3.3.dylib' (no such file), '/usr/lib/libruby.3.3.dylib' (no such file) ----------------------------------------------------------------------
2023-11-09[Bug #18286] Make builtin binary if sharable in universal binariesNobuyoshi Nakada
2023-11-09Revert "Disable iseq-dumped builtin module for universal x86_64/arm64 binaries"Nobuyoshi Nakada
This reverts commit 1d5598fe0d3470e7cab06a756d40a9221fcd501b.
2023-11-09Disable iseq-dumped builtin module for universal x86_64/arm64 binariesBen Hamilton
During the build, Ruby has special logic to serialize its own builtin module to disk using the binary iseq format during the build (I assume for speed so it doesn't have to parse builtin every time it starts up). However, since iseq format is architecture-specific, when building on x86_64 for universal x86_64 + arm64, the serialized builtin module is written with the x86_64 architecture of the build machine, which fails this check whenever ruby imports the builtin module on arm64: https://github.com/ruby/ruby/blob/1fdaa0666086529b3aae2d509a2e71c4247c3a12/compile.c#L13243 Thankfully, there's logic to disable this feature for cross-compiled builds: https://github.com/ruby/ruby/blob/1fdaa0666086529b3aae2d509a2e71c4247c3a12/builtin.c#L6 This disables the iseq logic for universal builds as well. Fixes [Bug #18286]
2023-11-07Select proper dsymutil for gcc 13Nobuyoshi Nakada
2023-11-07Ignore duplicate libraries warnings from gcc 13Nobuyoshi Nakada
2023-10-21[Bug #19967] Revert "configure.ac: LIBPATHENV on macOS"Nobuyoshi Nakada
This reverts commit 1961c786aab243b3eb60e7238224e87975d88056. These environment variables should no longer propagate to child processes.
2023-10-17Get rid of `set` with empty argument which dumps all definitionsNobuyoshi Nakada
2023-10-15disable MN threads on s390s-linuxKoichi Sasada
I check the s390s-linux/Ubuntu system and I found that MN threads doesn't work with: * function inlining (-O0 doesn't repro) * Thread local specifier (`_Thread_local`. With `pthread_get_specific works) (it is not an issue of `__tls_get_addr()` written in thread.c) * swap context with ucontext (coroutine/ucontext) I couldn't find out what is the root cause of this issue but disable MN threads to make CI healthy.
2023-10-14Ignore symbols even in empty shared libraryNobuyoshi Nakada
On some platforms, such as FreeBSD and Oracle Linux, symbols defined in the crt0 setup routine are exported from shared libraries. So ignore the symbols that would be exported even in an empty shared library.
2023-10-12[Feature #19422] Enable shared by default on macOSNobuyoshi Nakada
2023-10-12M:N thread scheduler for RactorsKoichi Sasada
This patch introduce M:N thread scheduler for Ractor system. In general, M:N thread scheduler employs N native threads (OS threads) to manage M user-level threads (Ruby threads in this case). On the Ruby interpreter, 1 native thread is provided for 1 Ractor and all Ruby threads are managed by the native thread. From Ruby 1.9, the interpreter uses 1:1 thread scheduler which means 1 Ruby thread has 1 native thread. M:N scheduler change this strategy. Because of compatibility issue (and stableness issue of the implementation) main Ractor doesn't use M:N scheduler on default. On the other words, threads on the main Ractor will be managed with 1:1 thread scheduler. There are additional settings by environment variables: `RUBY_MN_THREADS=1` enables M:N thread scheduler on the main ractor. Note that non-main ractors use the M:N scheduler without this configuration. With this configuration, single ractor applications run threads on M:1 thread scheduler (green threads, user-level threads). `RUBY_MAX_CPU=n` specifies maximum number of native threads for M:N scheduler (default: 8). This patch will be reverted soon if non-easy issues are found. [Bug #19842]