Bug #14440
closed--jit does not work by default on OpenBSD due to use of gcc instead of clang
Description
On OpenBSD, when using just --jit
, ruby issues a warning message to $stderr
:
$ ruby --jit -e 'p 1'
.ext/include/x86_64-openbsd/rb_mjit_min_header-2.6.0.h:2924: error: wrong number of arguments specified for '__deprecated__' attribute
compilation terminated due to -Wfatal-errors.
1
This is probably because MJIT doesn't work on old versions of GCC:
$ gcc -v
Reading specs from /usr/lib/gcc-lib/amd64-unknown-openbsd6.2/4.2.1/specs
Target: amd64-unknown-openbsd6.2
Configured with: OpenBSD/amd64 system compiler
Thread model: posix
gcc version 4.2.1 20070719
When using --jit --jit-cc=clang
, there are no problems:
$ ruby --jit --jit-cc=clang -e 'p 1'
1
Either --jit
should be made to work with older GCC versions, or older GCC versions should be skipped. It seems like for now, skipping older GCC versions would be easier.
Updated by shevegen (Robert A. Heiler) over 6 years ago
Agreed. May be simpler to just notify the user which GCC versions are
currently supported; and if it works the modern GCC, one can look to
see that older GCC versions could also use --jit.
Updated by k0kubun (Takashi Kokubun) over 6 years ago
Whether is the ruby compiled from gcc or clang? A known issue is that using MJIT header generated from different compiler may not work. So I may drop selecting cc in the future.
If the ruby is built from the old gcc and broken with --jit-cc=gcc, we need to fix it.
Updated by jeremyevans0 (Jeremy Evans) over 6 years ago
k0kubun (Takashi Kokubun) wrote:
Whether is the ruby compiled from gcc or clang? A known issue is that using MJIT header generated from different compiler may not work. So I may drop selecting cc in the future.
If the ruby is built from the old gcc and broken with --jit-cc=gcc, we need to fix it.
clang is the system compiler on OpenBSD on the most common architectures. So it sounds like --jit
should use clang by default in that case, since that is what is used to compile ruby itself.
Updated by k0kubun (Takashi Kokubun) over 6 years ago
- Assignee set to k0kubun (Takashi Kokubun)
Updated by k0kubun (Takashi Kokubun) over 6 years ago
- Status changed from Open to Closed
Applied in changeset trunk|r62230.
mjit.c: prefer using --jit-cc=clang if clang
is defined. This is basically for OpenBSD.
Failure on using the compiler which is
not used for Ruby compilation is not supported.
[Bug #14440]