Граф коммитов

471 Коммитов

Автор SHA1 Сообщение Дата
Nobuyoshi Nakada fc842c9ccc
Check `rustc` with the target 2022-11-06 19:32:50 +09:00
Nobuyoshi Nakada 9627aab825
`--disable-jit-support` should disable YJIT successfully
Even if `rustc` is available, it should not be an error unless
`--enable-yjit` is explicitly given.
2022-11-06 17:07:44 +09:00
Nobuyoshi Nakada cb899a990a
Disable YJIT support when cross-compiling
As the target-list of `rustc` is different from `config.guess` and
`config.sub`, `$target` cannot be used directly.
2022-11-06 10:16:12 +09:00
Nobuyoshi Nakada 1454f8f219 Add `--target` option to RUSTC when cross-compiling 2022-11-06 06:47:38 +09:00
Nobuyoshi Nakada 10fd1d9507 Should use the configured rustc consistently 2022-11-06 06:47:38 +09:00
Maxime Chevalier-Boisvert dd4ae9a475
Auto-enable YJIT build when rustc >= 1.58.0 present (#6662)
* 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
2022-11-04 17:02:04 -04:00
Nobuyoshi Nakada 0717cb8419
Try -fstack-protector-strong on MinGW
The CI for MinGW has used it.
2022-10-30 19:16:09 +09:00
Nobuyoshi Nakada c5ca250eb5
Clear `_FORTIFY_SOURCE` before definition
As clang on macOS defines this macro as 0 internally when a sanitizer
option is given, clear it before definition to suppress redefinition
warnings.
2022-10-29 16:17:45 +09:00
Alan Wu 5ca23caa20
YJIT: fold the "asm_comments" feature into "disasm" (#6591)
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.
2022-10-19 14:03:07 -04:00
Sergey Fedorov 567725ed30
Fix and improve coroutines for Darwin (macOS) ppc/ppc64. (#5975) 2022-10-19 23:49:45 +13:00
Nobuyoshi Nakada ee6cc25026
Remove wrong dollar 2022-10-15 01:03:47 +09:00
Nobuyoshi Nakada f3a3ab110e
[Bug #16909] Honor the tool prefix against pkg-config 2022-10-02 16:08:38 +09:00
Maxime Chevalier-Boisvert 8fcbb79742
YJIT: reverse configure.ac changes that disable `--yjit-stats` on Graviton1 (#6457)
Reverse configure.ac changes that disable YJIT stats on Graviton1
2022-09-27 19:27:19 -04:00
Nobuyoshi Nakada ecffc6a203 Generate the revision.h before Makefile
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.
2022-09-26 13:03:23 +09:00
Nobuyoshi Nakada dc7d929e54
Extract `RUBY_RELEASE_DATE` from also revision.h
This make variable is very useful for daily build.
2022-09-25 22:40:05 +09:00
Takashi Kokubun 912ea8257a
YJIT: Support Rust 1.58.1 for --yjit-stats on Arm (#6410)
* 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>
2022-09-23 16:17:54 -04:00
Jeremy Evans 88bf8ad6e9 Allow --enable-yjit on OpenBSD
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.
2022-09-23 05:51:34 +09:00
Alan Wu a8dc49b4d5 YJIT: Support MAKE=bmake for release build
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.
2022-09-20 14:17:27 -04:00
Nobuyoshi Nakada 6898984f1c
[Bug #19005] dynamic_lookup linker option in external libraries
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.
2022-09-17 12:09:34 +09:00
Kenta Murata 2e25b85a7e
configure.ac: Apply suggestions from code review in #6366
Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
2022-09-14 23:14:36 +09:00
Kenta Murata f512df7398
configure.ac: Add --with-gmp-dir (#6366)
Add the `--with-gmp-dir` to specify the prefix directory of GMP.
The`--without-gmp` option is preserved for convenience.  It can
be used to force to reject using GMP even if the `--with-gmp-dir`
option is specified.
2022-09-14 22:17:39 +09:00
Nobuyoshi Nakada c428fc0e1f -undefined dynamic_lookup is obsolete 2022-09-14 11:27:05 +09:00
Nobuyoshi Nakada e2b47b832f
configure.ac: Manage OPT_DIR better (#6367)
* Check rpath flag earlier

* Manage OPT_DIR at once
2022-09-14 10:42:38 +09:00
Nobuyoshi Nakada ed029e9bd4
Autoconf 2.70 or AC_PROG_CC_C99 for earlier is checking for C99
It is no longer necessary to add it to `CFLAGS`/`CPPFLAGS` later.

Furthermore, as `CPPFLAGS` is used also with C++ compiler, the option
particular to C such as `-std=gnu99` results in an error.
2022-09-12 19:53:10 +09:00
Nobuyoshi Nakada 1f91dcdab3
Define BOOTSTRAPRUBY from HAVE_BASERUBY 2022-09-07 14:33:25 +09:00
Nobuyoshi Nakada 3a575d13d5
Ensure BASERUBY when cross-compiling 2022-09-07 10:08:23 +09:00
Takashi Kokubun cb26917d1c
Drop Solaris support for MJIT
I tried to debug:
http://rubyci.s3.amazonaws.com/solaris10-gcc/ruby-master/log/20220905T070005Z.fail.html.gz
but I don't have sudo privilege to install dependencies such as xz on
that machine. Thus I can't extract a prebuilt libclang binary.

Anyway, if we find out ABI is different from x86_64 / aarch64, we'd like
to have sparc CI associated to GitHub to run `make mjit-bindgen`, but we
can't. Supporting this could be too hard, so I'm leaving it for now.
2022-09-05 01:25:00 -07:00
Nobuyoshi Nakada a01271c1c4
BOOTSTRAPRUBY needs fake.rb when cross-compiling 2022-09-03 21:37:24 +09:00
Nobuyoshi Nakada 7c67d0fd79
Make sources by BASERUBY if available instead of miniruby 2022-09-03 19:25:29 +09:00
Nobuyoshi Nakada 6f5305e0d2
Exclude LIBPATHENV wrapper from PREP 2022-09-03 19:20:03 +09:00
Nobuyoshi Nakada 21a5da3c4c
Check if MSys shell can run a command with a drive letter 2022-09-03 19:20:03 +09:00
Nobuyoshi Nakada cd1a0b3caa Stop defining `RUBY_ABI_VERSION` if released versions
As commented in include/ruby/internal/abi.h, since teeny versions of
Ruby should guarantee ABI compatibility, `RUBY_ABI_VERSION` has no role
in released versions of Ruby.
2022-08-12 15:57:25 +09:00
Nobuyoshi Nakada 74d95744bd
Add `--enable-devel` configure option
Since `RUBY_DEVEL` in cppflags has no effect in the configure script
and makefiles.
2022-08-11 11:34:52 +09:00
Jeremy Evans 357352af5e Do not enable RUBY_DEVEL by RUBY_PATCHLEVEL
This makes RUBY_DEVEL not enabled automatically.  It still can be
enabled manually.

Test manually using RUBY_DEVEL in CI.

Implements [Feature #17468]
2022-08-09 22:13:17 -07:00
Yuta Saito 184fd94d7e Resolve abi symbols from libruby.dylib when available 2022-08-04 16:29:22 +09:00
Yuta Saito 6d8b9a9d61 Resolve abi symbol references from miniruby to avoid circular deps
Adding `ruby` to `PREP` causes the following circular dependencies
because `PREP` is used as a prerequisite by some targets required to
build `ruby` target itself.
```
make: Circular .rbconfig.time <- ruby dependency dropped.
make: Circular builtin_binary.inc <- ruby dependency dropped.
make: Circular ext/extinit.c <- ruby dependency dropped.
make: Circular ruby <- ruby dependency dropped.
```

Adding a new Make variable like `EXTPREP` only for exts may be also
reasonable, but it would introduce another complexity into our build
system. `-bundle_loader` doesn't care that link-time and run-time
loader executables are different as long as bound symbols are provided,
so it's ok to resolve from miniruby to simplify our build.
2022-08-04 16:29:22 +09:00
Alan Wu c69582a540 Quote $(BUILTRUBY) so paths with spaces work 2022-08-04 16:29:22 +09:00
Yuta Saito 50d81bfbc1 Link ext bundles with bundle loader option for newer ld64
ld64 shipped with Xcode 14 emits a warning when using `-undefined
dynamic_lookup`.

```
ld: warning: -undefined dynamic_lookup may not work with chained fixups
```

Actually, `-undefined dynamic_lookup` doesn't work when:

1. Link a *shared library* with the option
2. Link it with a program that uses the chained-fixup introduced from
   macOS 12 and iOS 15
because `-undefined dynamic_lookup` uses lazy-bindings and they won't be
bound while dyld fixes-up by traversing chained-fixup info.

However, we build exts as *bundles* and they are loaded only through
`dlopen`, so it's safe to use `-undefined dynamic_lookup` in theory.
So the warning produced by ld64 is false-positive, and it results
failure of option checking in configuration. Therefore, it would be an
option to ignore the warning during our configuration.

On the other hand, `-undefined dynamic_lookup` is already deprecated on
all darwin platforms except for macOS, so it's good time to get rid of
the option. ld64 also provides `-bundle_loader <executable>` option,
which allows to resolve symbols defined in the executable symtab while
linking. It behaves almost the same with `-undefined dynamic_lookup`,
but it makes the following changes:

1. Require that unresolved symbols among input objects must be defined
   in the executable.
2. Lazy symbol binding will lookup only the symtab of the bundle loader
   executable. (`-undefined dynamic_lookup` lookups all symtab as flat
   namespace)

This patch adds `-bundle_loader $(RUBY)` when non-EXTSTATIC
configuration by assuming ruby executable can be linked before building
exts.

See "New Features" subsection under "Linking" section for chained fixup
https://developer.apple.com/documentation/xcode-release-notes/xcode-13-release-notes
2022-08-04 16:29:22 +09:00
John Hawthorn 0e85586ecc Add --enable-yjit=dev_nodebug configure option 2022-07-29 16:32:14 -07:00
John Hawthorn fbd24793cb Add --enable-yjit=stats configure option 2022-07-29 16:32:14 -07:00
Jeremy Evans 2725c5dbe0 Fix invalid mkdir detection on OpenBSD
This was broken by 67e54ce408, which
resulted in " -d" being used as the mkdir_p program. I think this
is because $ac_install_sh has been set to '' at the point it is
used.

There's probably a better way to fix this, but this should allow
the OpenBSD CI to continue to work until a better fix is in place.
2022-07-08 21:08:19 -07:00
Nobuyoshi Nakada 67e54ce408
Fallback `mkdir_p` to `as_mkdir_p`
Assume `mkdir -p` to be race-free on recent systems.
And we do not provide install-sh anyway.
2022-07-07 15:06:10 +09:00
Nobuyoshi Nakada fc8020c68e
[Bug #18879] Fix macOS version detections
macOS's AvailabilityMacros.h does not contain macros for future
versions.  If a version macro is not defined, consider only earlier
versions to be targeted.
2022-06-27 01:08:46 +09:00
Nobuyoshi Nakada ec5c56412f [Feature #18839] Drop support for gcc 3 [ci skip] 2022-06-20 12:11:41 +09:00
Nobuyoshi Nakada e711711539
Show gcc version if too old, and move to GCC block [ci skip] 2022-06-18 13:40:46 +09:00
Nobuyoshi Nakada e77d2c296e
Disable maybe-uninitialized warning for gcc 4
It often shows false positive warnings (at least in 4.8).  Newer
versions work well and we can check correct warnings.
2022-06-18 13:15:02 +09:00
KJ Tsanaktsidis 05ffc037ad Disable Mach exception handlers when read barriers in place
The GC compaction mechanism implements a kind of read barrier by marking
some (OS) pages as unreadable, and installing a SIGBUS/SIGSEGV handler
to detect when they're accessed and invalidate an attempt to move the
object.

Unfortunately, when a debugger is attached to the Ruby interpreter on
Mac OS, the debugger will trap the EXC_BAD_ACCES mach exception before
the runtime can transform that into a SIGBUS signal and dispatch it.
Thus, execution gets stuck; any attempt to continue from the debugger
re-executes the line that caused the exception and no forward progress
can be made.

This makes it impossible to debug either the Ruby interpreter or a C
extension whilst compaction is in use.

To fix this, we disable the EXC_BAD_ACCESS handler when installing the
SIGBUS/SIGSEGV handlers, and re-enable them once the compaction is done.
The debugger will still trap on the attempt to read the bad page, but it
will be trapping the SIGBUS signal, rather than the EXC_BAD_ACCESS mach
exception. It's possible to continue from this in the debugger, which
invokes the signal handler and allows forward progress to be made.
2022-06-18 00:10:16 +09:00
Jeremiah Gowdy 1dfe007e16 Update configure.ac
Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
2022-06-17 11:58:10 +09:00
Jeremiah Gowdy f3b54d5fc2 Add branch protection to aarch64 targets 2022-06-17 11:58:10 +09:00
Takashi Kokubun f8502a2699
Drop MinGW support of MJIT (#6012)
[Feature #18824]
2022-06-13 09:28:28 -07:00