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

394 Коммитов

Автор SHA1 Сообщение Дата
Yusuke Endoh c64a067d05 configure.ac: Make it possible to build on Android Termux
The recent Termux's clang predefines `__ANDROID_API__` as a fixed number
24. However, when it is lower to the current device version, some
functions that "configure" detemines available are not declared
correctly in the header files.

This change forces to overwrite the predefined `__ANDROID_API__` macro
with the current device version.

ref: https://github.com/termux/termux-packages/issues/6176
2020-12-25 00:06:16 +09:00
Naohisa Goto 84eebb3c9e On Solaris, _XOPEN_SOURCE should be undefined for C++ sources. 2020-12-21 23:42:34 +09:00
卜部昌平 ccc828f499 configure.ac: avoid squashing CXX=g++
We are discussing this issue at [Bug #17337] but in the meantime, leave
this questionable autoconf glitch as-is to save sassc and eventmachine.
2020-12-16 08:47:49 +09:00
Zoltán Mizsei 9542321584
Haiku: disable stack-protector 2020-12-15 23:12:31 +09:00
Zoltán Mizsei 4d43ac2fb9
Add Haiku to the context support list 2020-12-15 23:12:28 +09:00
Nobuyoshi Nakada 4d2ad8d737
Removed obsolete autoconf checks
Use regular `AC_CHECK_MEMBERS` instead of:
* `AC_STRUCT_ST_BLKSIZE`
* `AC_STRUCT_ST_BLOCKS`
* `AC_STRUCT_ST_RDEV`
2020-12-12 17:23:44 +09:00
Nobuyoshi Nakada 0df67a4695 Signal handler type should be void 2020-12-12 17:02:42 +09:00
Nobuyoshi Nakada 21c5726418 Omit checks for C89 standard or later
Now we require C99, these features available of course.

* prototypes
* stdarg prototypes
* token pasting
* stringization
* string literal concatenation
2020-12-12 17:02:42 +09:00
Yusuke Endoh 8c5ec10038 Link zlib always if available
Major Linux distribution packages including Debian, Ubuntu, and Fedora
use `--compress-debug-sections=no` to build ruby, and then extract and
compress debug symbols as separate files. However, the configure option
makes ruby not link zlib, thus the generated binary cannot uncompress
the compressed separate debug symbol files, and fails to show C level
backtrace when a critical error like segfault occurs.

This change makes ruby always link zlib if it is available so that it
can show C level backtrace correctly.

Related: Debian packages require https://github.com/ruby/ruby/pull/3627
to load debug symbol files.
2020-12-11 14:08:23 +09:00
Masaki Matsushita 5d8bcc4870 Revert getaddrinfo_a()
getaddrinfo_a() gets stuck after fork().
To avoid this, we need 1 second sleep to wait for internal
worker threads of getaddrinfo_a() to be finished, but that is unacceptable.

[Bug #17220] [Feature #17134] [Feature #17187]
2020-12-07 13:33:53 +09:00
Masaki Matsushita 94d49ed31c Add a hook before fork() for getaddrinfo_a()
We need stop worker threads in getaddrinfo_a() before fork().
This change adds a hook before fork() that cancel all outstanding requests
and wait for all ongoing requests. Then, it waits for all worker
threads to be finished.

Fixes [Bug #17220]
2020-12-04 23:31:51 +09:00
Yusuke Endoh 5d8fe1267d configure.ac: Check x86intrin.h only when the target CPU is x86
The check output a warning on M1 Mac mini

http://rubyci.s3.amazonaws.com/osx1100arm/ruby-master/log/20201127T074507Z.log.html.gz
```
checking x86intrin.h usability... no
checking x86intrin.h presence... yes
configure: WARNING: x86intrin.h: present but cannot be compiled
configure: WARNING: x86intrin.h:     check for missing prerequisite headers?
configure: WARNING: x86intrin.h: see the Autoconf documentation
configure: WARNING: x86intrin.h:     section "Present But Cannot Be Compiled"
configure: WARNING: x86intrin.h: proceeding with the compiler's result
checking for x86intrin.h... no
```
2020-11-27 19:53:21 +09:00
Nobuyoshi Nakada 2939c57ca7
Check if _FORTIFY_SOURCE really works
i686-pc-cygwin gcc 6.4.0 seems broken around ssp.h, when compiling
with both of optimization and _FORTIFY_SOURCE.
2020-11-23 17:56:23 +09:00
Nobuyoshi Nakada 43a9a974e2
[Bug #17021] Make host_* values consistent with target_* 2020-11-21 23:21:52 +09:00
Sergei Trofimovich fcc88da5eb configure.ac: fix for upcoming autoconf-2.70
The failure initially noticed on `autoconf-2.69d` (soon to become 2.70):

```
$ ./configure
./configure: line 8720: syntax error near unexpected token `fi'
./configure: line 8720: `fi'
```

Before the change generated `./configure ` snippet looked like:

```
    if ! $CC -E -xc - <<SRC >/dev/null
then :

	#if defined __APPLE_CC__ && defined __clang_major__ && __clang_major__ < 3
	#error premature clang
	#endif
SRC
	as_fn_error $? "clang version 3.0 or later is required" "$LINENO" 5
fi
```

Note the newline that breaks here-document syntax.

After the change the snippet does not use here-document.

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
2020-11-17 09:41:59 +09:00
Nobuyoshi Nakada b958e2add8 Removed canonicalization for mathn 2020-11-10 11:14:15 +09:00
Nobuyoshi Nakada ed01cc8fdc
No longer need libtool
As debug_counter.c has had a global symbol since cdc614cd0a,
ranlib should no longer complain that it has no symbols.
2020-10-06 23:46:24 +09:00
Nobuyoshi Nakada 67ae1d441d
Do not use clang on cygwin
Its `__has_declspec_attribute()` is not reliable.  For instance,
while `__has_declspec_attribute(noalias)` is true but 'noalias'
attribute is warned as unknown.
2020-09-28 13:42:04 +09:00
卜部昌平 e9fb2bc873 RBIMPL_ALIGNOF: do not use __alignof__
It is reported that on a system of i386 System V ABI, GCC returns 8 for
__alignof__(double).  OTOH the ABI defines alignments of double to be 4,
and ISO/IEC 9899:2011 reads that _Alignof(double) shall return 4 on such
machine.  What we want in ruby is 4 instead of 8 there.  We cannot use
__alignof__.

Additionally, both old GCC / old clang return 8 for _Alignof(double) on
such platforms.  They are their bugs, and already fixed in recent
versions.  But we have to support older compilers for a while.  Shall
check sanity of _Alignof.
2020-09-25 11:38:33 +09:00
卜部昌平 fe875be01a rb_cv_have_alignas: not used any longer
Availability of `alignas` is checked in include/ruby/internal/stdalign.h
now.  That does not need this configure check.  Also as commented in the
header, we see `_Alignas` being inadequate for our purpose.
2020-09-25 11:38:33 +09:00
Masaki Matsushita 0ac185be40 Fix compile-time check for copy_file_range(2)
* close fds properly
* define USE_COPY_FILE_RANGE if HAVE_COPY_FILE_RANGE is defined
* avoid errors on cross-compiling environments
2020-09-12 16:27:14 +09:00
Masaki Matsushita 012785ef35 Check copy_file_range(2) is actually supported.
see also: https://gitlab.com/gitlab-org/gitlab/-/issues/218999#note_363225872
2020-09-12 16:07:35 +09:00
卜部昌平 50b18e8129 configure: detect that there is no g++
AC_PROG_CXX checks for several C++ compilers INCLUDING g++.  When none
of them were found it sets the CXX variable to be g++.  This doesn't
make any sense.  Absense of g++ has already been made sure.

Because we don't want insanity (that's the whole reason we test the
environment using autoconf), we need to swipe such insane variable out.
2020-09-03 15:14:09 +09:00
Jeremy Evans be9dbe1c3e Fix pthread_setname_np arguments on NetBSD
The previous attempt to fix this in
b87df1bf24 reversed the argument
order instead of just fixing the quote escaping.

From Takahiro Kambe.

Fixes [Bug #15178]
2020-09-01 07:16:31 -07:00
卜部昌平 b01d852c2a congigure.ac: favour gcc on Linux
Requested by Naruse.
2020-09-01 11:05:10 +09:00
卜部昌平 21b3bc10d3 DEPRECATED_TYPE: is deprecated
Nobody uses this macro any longer.
2020-08-27 15:02:52 +09:00
卜部昌平 2ddc67ffb6 configure.ac: suppress more Sun C warnings.
They are rather annoying than being useful to us.
2020-08-22 14:12:12 +09:00
卜部昌平 d916a4c897 configure.ac: more checks on STRIP
STRIP now depends on compilers, not on OS.  Previous check against
$target_os does no longer work.
2020-08-22 09:49:08 +09:00
卜部昌平 914b2208ab configure.ac: rule out old Sun C++
CI failures observed for old Sun C++.  We don't want to hustle, as newer
versions are okay.  Just check the sanity and rule out insane compilers.
2020-08-22 00:45:39 +09:00
卜部昌平 954afd1bc5 protect CFLAGS from being smashed by AC_PROG_CC
AC_PROG_CC_C99 calls AC_PROC_CC, which calls _AC_PROG_CC_G, which sets
default CFLAGS, whose contents are not customisable.  We don't welcome
this behaviour.

The exact same thing happens for CXXFLAGS in AC_PROG_CXX.
2020-08-22 00:45:39 +09:00
卜部昌平 3eb76e747e configure.ac: try GCC-provided ld
In case of cross-compilation, GCC might provide its own linker.  Its
behaviour seems slightly different from that of gcc(1).  This is not a
big deal for normal situations, but the difference can cause libtool to
go mad.

We ship bundled libffi for windows users, and libffi uses libtool.  If
we use cross-compiler version of gcc instead of its ld conterpart, we
fail to compile fiddle.  That should not be what we want.
2020-08-21 16:01:46 +09:00
卜部昌平 73b6bc5790 AC_PROG_CXXCPP: remove
Caused CI failures on environments without sane C++ compilers.
2020-08-21 11:47:18 +09:00
卜部昌平 7341b1a53d configure.ac: move program_transform_name
Historically `$program_transform_name` has been put in front of
`AC_CANONICAL_TARGET`.  Previous commit changes it, which affects the
name of generated ruby binary when cross-compiling.  I _guess_ the
historical behaviour is a bug (name of ruby binary shall honour --target
configure option I think), but anyways here I preserve that questionable
way.
2020-08-21 11:04:54 +09:00
卜部昌平 2c96e04868 configure.ac: use compiler-provided toolchains
These days as link-time optimisations spread accross compilers, they
tend to ship their own version of ld, ar, etc.  Why not detect such
things if any.  Users can select compilers by ./configure --with-gcc=
whatever, or select individual tool by e.g. ./configure NM=whatever.

The added AC_ARG_VAR macros enrich ./configure --help output.
2020-08-21 11:04:54 +09:00
Nobuyoshi Nakada 50aac2ffd5
Share the size for sigaltstack between configure.ac and signal.c 2020-07-22 21:28:23 +09:00
Jake Zimmerman 8b0dc77a62 configure.ac: Bump the size of sigaltstack
The RubyVM uses C macro defines to feature detect whether
`backtrace(2)` support is available, and if so it includes C level backtraces
when the RubyVM itself crashes.

But on my machine, C level backtraces from `vm_dump.c` didn't work when
using a version of Ruby buillt on the machine, but worked fine when using a
version of Ruby built on another machine and copied to my machine.

The default autoconf test for backtraces uses a sigaltstack size that is
too small, so the SIGSEGV signal handler itself causes a SIGSEGV).
I noticed that signal.c uses a larger sigaltstack size:

https://github.com/ruby/ruby/blob/v2_6_5/signal.c#L568

The specific variables it looks at:

- `HAVE_BACKTRACE`

  this is a macro defined by autoconf because there is a line in the
  configure script like `AC_CHECK_FUNCS(backtrace)` (see the autoconf
  docs for more).

- `BROKEN_BACKTRACE`

  this comes from a custom program that Ruby's configure script runs to
  attempt to figure out whether actually using backtrace(2) in a real
  program works. You can see the autoconf program here.

  <https://github.com/ruby/ruby/blob/v2_6_5/configure.ac#L2817-L2863>

It uses sigaltstack and SA_ONSTACK to create a seperate stack for
handling signals.

The problem was: SIGSTKSZ (which comes from a system header!) was not
suggesting a large enough stack size. When checking on an Ubuntu 16.04
box, we found that SIGSTKSZ was 8192 and MINSIGSTKSZ was 2048.
2020-07-22 20:46:36 +09:00
Nobuyoshi Nakada a0a5eec0e7
Bail out when unsupported coroutine target 2020-07-09 13:53:20 +09:00
Watson 23655e6de5 Fix build error on Apple silicon macOS
This patch will fix following build error on macOS 11.0 + Xcode 12 beta.

```
$ ./configure
$ make V=1
	BASERUBY = /Users/watson/.rbenv/shims/ruby --disable=gems
	CC = clang -fdeclspec
	LD = ld
	LDSHARED = clang -fdeclspec -dynamiclib
	CFLAGS = -O3 -ggdb3 -Wall -Wextra -Werror=deprecated-declarations -Werror=division-by-zero -Werror=implicit-function-declaration -Werror=implicit-int -Werror=misleading-indentation -Werror=pointer-arith -Werror=shorten-64-to-32 -Werror=write-strings -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Werror=extra-tokens -std=gnu99  -pipe
	XCFLAGS = -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fno-strict-overflow -DRUBY_DEVEL=1 -fvisibility=hidden -DRUBY_EXPORT -fPIE -DCANONICALIZATION_FOR_MATHN -I. -I.ext/include/arm64-darwin20 -I./include -I. -I./enc/unicode/12.1.0
	CPPFLAGS = -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT
	DLDFLAGS = -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress -fstack-protector-strong -Wl,-pie -framework Security -framework Foundation
	SOLIBS = -lpthread -ldl -lobjc
	LANG = ja_JP.UTF-8
	LC_ALL =
	LC_CTYPE =
	MFLAGS =
Apple clang version 12.0.0 (clang-1200.0.22.19)
Target: arm64-apple-darwin20.0.0
Thread model: posix
InstalledDir: /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
clang -fdeclspec -O3 -ggdb3 -Wall -Wextra -Werror=deprecated-declarations -Werror=division-by-zero -Werror=implicit-function-declaration -Werror=implicit-int -Werror=misleading-indentation -Werror=pointer-arith -Werror=shorten-64-to-32 -Werror=write-strings -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Werror=extra-tokens -std=gnu99  -pipe  -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fno-strict-overflow -DRUBY_DEVEL=1 -fvisibility=hidden -DRUBY_EXPORT -fPIE -DCANONICALIZATION_FOR_MATHN -I. -I.ext/include/arm64-darwin20 -I./include -I. -I./enc/unicode/12.1.0 -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT    -o cont.o -c cont.c
In file included from cont.c:19:
./coroutine/ucontext/Context.h:32:5: error: 'getcontext' is deprecated: first deprecated in macOS 10.6 [-Werror,-Wdeprecated-declarations]
    getcontext(&context->state);
    ^
/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ucontext.h:37:6: note: 'getcontext' has been
      explicitly marked deprecated here
int  getcontext(ucontext_t *) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_6, __IPHONE_2_0, __IPHONE_2_0) __WATCHOS_PROHIBITED __TVOS_PROHIBITED;
     ^
In file included from cont.c:19:
./coroutine/ucontext/Context.h:51:5: error: 'makecontext' is deprecated: first deprecated in macOS 10.6 [-Werror,-Wdeprecated-declarations]
    makecontext(&context->state, (void(*)(void))coroutine_trampoline, 2, (void*)start, (void*)context);
    ^
/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ucontext.h:38:6: note: 'makecontext' has been
      explicitly marked deprecated here
void makecontext(ucontext_t *, void (*)(), int, ...) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_6, __IPHONE_2_0, __IPHONE_2_0) __WATCHOS_PROHI...
     ^
In file included from cont.c:19:
./coroutine/ucontext/Context.h:59:5: error: 'swapcontext' is deprecated: first deprecated in macOS 10.6 [-Werror,-Wdeprecated-declarations]
    swapcontext(&current->state, &target->state);
    ^
/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ucontext.h:40:6: note: 'swapcontext' has been
      explicitly marked deprecated here
int  swapcontext(ucontext_t * __restrict, const ucontext_t * __restrict) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_6, __IPHONE_2_0, __IPHONE_...
     ^
3 errors generated.
make: *** [cont.o] Error 1
```
2020-07-08 22:56:49 +09:00
Nobuyoshi Nakada 047471c529
No GITPULLOPTIONS by default
To honor the environment variable, keep GITPULLOPTIONS unset by
default, and appended the option to VCSUP.
2020-06-04 13:16:24 +09:00
Jeremy Evans 9a3371be8f Check that BASERUBY is at least Ruby 2.2 in configure
BASERUBY needs to be at least Ruby 2.2 since
46acd0075d.

I think it's better to explicitly fail early as soon as BASERUBY
is used in this case, versus trying to debug later failures.

This modifies things to check both implicitly use of ruby in the
PATH as BASERUBY, and explicitly specified older versions of ruby
when using --with-baseruby.

Fixes [Bug #16668]
2020-05-28 07:57:29 -07:00
Alan D. Salewski c15cddd1d5 Allow Dir.home to work for non-login procs when $HOME not set
Allow the 'Dir.home' method to reliably locate the user's home directory when
all three of the following are true at the same time:

    1. Ruby is running on a Unix-like OS
    2. The $HOME environment variable is not set
    3. The process is not a descendant of login(1) (or a work-alike)

The prior behavior was that the lookup could only work for login-descended
processes.

This is accomplished by looking up the user's record in the password database
by uid (getpwuid_r(3)) as a fallback to the lookup by name (getpwname_r(3))
which is still attempted first (based on the name, if any, returned by
getlogin_r(3)).

If getlogin_r(3), getpwnam_r(3), and/or getpwuid_r(3) is not available at
compile time, will fallback on using their respective non-*_r() variants:
getlogin(3), getpwnam(3), and/or getpwuid(3).

The rationale for attempting to do the lookup by name prior to doing it by uid
is to accommodate the possibility of multiple login names (each with its own
record in the password database, so each with a potentially different home
directory) being mapped to the same uid (as is explicitly allowed for by
POSIX; see getlogin(3posix)).

Preserves the existing behavior for login-descended processes, and adds the
new capability of having Dir.home being able to find the user's home directory
for non-login-descended processes.

Fixes [Bug #16787]

Related discussion:
    https://bugs.ruby-lang.org/issues/16787
    https://github.com/ruby/ruby/pull/3034
2020-05-23 23:16:28 +09:00
Nobuyoshi Nakada 39cb19303c
Search pkg-config with ac_tool_prefix [Bug #16909]
Should prefer a prefixed version over the bare pkg-config for
cross compiling.
2020-05-23 22:04:11 +09:00
Nobuyoshi Nakada b722182e47
Revert "Search pkg-config by AC_CHECK_TOOL [Bug #16909]"
This reverts commit 6006ab8cf9.
AC_CHECK_TOOL does not have REJECT argument.
2020-05-23 21:20:34 +09:00
Nobuyoshi Nakada 6006ab8cf9
Search pkg-config by AC_CHECK_TOOL [Bug #16909]
It should use AC_CHECK_TOOL to automatically search for a prefixed
version and not just the bare pkg-config.
2020-05-23 19:52:14 +09:00
Nobuyoshi Nakada c89c3801b9
BASERUBY have to be 1.9 or later at least [Bug #16845]
Many tools under tool directory haven't worked with ruby 1.8.
2020-05-11 03:19:36 +09:00
Nobuyoshi Nakada a1e1fdca09
Fallback MAKE to make 2020-05-11 00:40:14 +09:00
Nobuyoshi Nakada 3fa4fd4780
Pass MAKE value to configure for non-default name case
GNU make does not export it by default.
2020-05-11 00:18:06 +09:00
Nobuyoshi Nakada e49ecaed57
Optimize sin/cos
GCC/Clang can optimize to calculate `sin(x)` and `cos(x)` at once,
when the both are closely called on the same argument.

Similar optimization is possible for `__sinpi(x)` and `__cospi(x)`
if available, which calculate arguments in radian, i.e.
`sin(x*M_PI)` and `cos(x*M_PI)` respectively.
2020-05-03 15:29:51 +09:00
Yusuke Endoh 92afac8f33 configure.ac: Automatically add -D__ANDROID_API=ver on Android 2020-04-22 02:31:37 +09:00
Andreas Schwab abe2e7de4d Don't require sub-word atomics
On some architectures (like RISC-V) sub-word atomics are only available
when linking against -latomic, but the configure script doesn't do that,
causing the atomic checks to fail and the resulting ruby binary is
non-functional.  Ruby does not use sub-word atomic operations, rb_atomic_t
is defined to unsigned int, so use unsigned int when checking for atomic
operations.
2020-04-11 11:19:50 +09:00
卜部昌平 d69c532685 configure: suppress SunPro warning
To this date there is no way for Oracle developer Studio to suppress
warnings about unreachable codes (12.6 manual says it implemented
__builtin_unreachable "as a no-op to C++. It might be added to C.")

There is no way but globally kill the warning.
2020-04-10 16:17:30 +09:00
卜部昌平 75802bcff1 configure: suppress icc warnings
Every time a pointer to/from VALUE conversion happens, these two
warnings are issued:

- warning #1684: conversion from pointer to same-sized integral type (potential portability problem)
- warning #2312: pointer cast involving 64-bit pointed-to type

Thank you, but we are well aware of the "potential portability problem".
Let us ignore them all.
2020-04-10 16:17:30 +09:00
卜部昌平 e43237b115 configure: always check for __builtin_unreachable
Non-gcc compilers tend to have this intrinsic these days (e.g. icc).
Better check it regardless of $GCC.
2020-04-10 16:17:30 +09:00
Yusuke Endoh cdd613b299 configure.ac: Skip C++ compiler of Sun OpenStudio
It fails to compile ext/-test-/cxxanyargs/cxxanyargs.cpp.
Need work to support it.  Contribution is welcome.
2020-04-09 08:55:46 +09:00
卜部昌平 9e6e39c351
Merge pull request #2991 from shyouhei/ruby.h
Split ruby.h
2020-04-08 13:28:13 +09:00
Nobuyoshi Nakada 4f938ffa35
Use toodir also in configure.ac 2020-04-05 10:56:28 +09:00
Nobuyoshi Nakada 21d0b40de2 Added tooldir variable 2020-04-05 09:26:57 +09:00
Paul Jordan 519a69b55c ucontext doesn't exist in a musl-libc env; use native assembly 2020-04-01 15:49:02 +13:00
Takashi Kokubun 5b3157a511
Make file names and variable names consistent 2020-03-23 22:33:01 -07:00
Nobuyoshi Nakada 6ab3664635
Moved MJIT_WITHOUT_TABS default to configure.ac
And then the environment variable.
2020-03-24 13:46:00 +09:00
Yusuke Endoh df26d36e5b Prefer alignas() over _Alignas()
to allow Intel C++ compiler to read ruby.h.
This is similar to 9930481a23
2020-02-20 22:36:53 +09:00
卜部昌平 cdd75d4e7f support C++ std::nullptr_t
C++ keyword `nullptr` represents a null pointer (note also that NULL is
an integer in C++ due to its design flaw).  Its type is `std::nullptr_t`,
defined in <cstddef> standard header.  Why not support it when the
backend implementation can take a null pointer as an argument.
2020-01-31 13:01:52 +09:00
卜部昌平 13064fe5db avoid undefined behaviour when n==0
ISO/IEC 9899:1999 section 6.5.7 states that "If the value of the right
operand is negative or is greater than or equal to the width of the
promoted left operand, the behavior is undefined".  So we have to take
care of such situations.

This has not been a problem because contemporary C compilers are
extraordinary smart to compile the series of shifts into a single
ROTLQ/ROTRQ machine instruction.  In contrast to what C says those
instructions have fully defined behaviour for all possible inputs.
Hence it has been quite difficult to observe the undefined-ness of such
situations.  But undefined is undefined.  We should not rely on such
target-specific assumptions.

We are fixing the situation by carefully avoiding shifts with out-of-
range values.  At least GCC since 4.6.3 and Clang since 8.0 can issue
the exact same instructions like before the changeset.

Also in case of Intel processors, there supposedly be intrinsics named
_rotr/_rotl that do exactly what we need.  They, in practice, are absent
on Clang before 9.x so we cannot blindly use.  But we can at least save
MSVC.

See also:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57157
https://bugs.llvm.org/show_bug.cgi?id=17332
2020-01-10 21:17:15 +09:00
Koichi Sasada 6f5ee1f092 modify MJIT_CC only on RUBY_DEBUG=ci
Modify MJIT_CC (27fae1d4ad) only on CI environment.
2020-01-03 04:39:34 +09:00
Koichi Sasada 27fae1d4ad disable ccache if $CC is in /usr/lib/ccache/$CC.
MJIT with ccache has a problem on docker environment, so
we need to use original CC (/usr/bin/gcc, for example).
Ubuntu system provides /usr/lib/ccache/gcc and so on to use
gcc with ccache. It is easy to setup ccache by adding
/usr/lib/ccache to $PATH. However we need to use /usr/bin/gcc
(and so on) for MJIT_CC. We can specify MJIT_CC option at
configure, but specifying them is troublesome.

This patch choose original $CC (/usr/bin/gcc, for example)
if $CC is /usr/lib/ccache/$CC.
2020-01-03 02:07:21 +09:00
Jeremy Evans a04c535967 Use __func__ as rb_cv_function_name_string on OpenBSD
The use of RUBY_WERROR_FLAG causes this test to fail on OpenBSD
platforms that use the binutils linker (ld.bfd) instead of the
llvm linker (ld.lld), due to warnings added to the binutils linker
in OpenBSD.

Removing the RUBY_WERROR_FLAG would probably also fix it, but that
would affect other platforms.

This should also be backported to Ruby 2.7.

Analysis and similar fix recommended by George Koehler.
2019-12-28 14:13:05 -08:00
卜部昌平 0958e19ffb add several __has_something macro
With these macros implemented we can write codes just like we can assume
the compiler being clang.  MSC_VERSION_SINCE is defined to implement
those macros, but turned out to be handy for other places.  The -fdeclspec
compiler flag is necessary for clang to properly handle __has_declspec().
2019-12-26 20:45:12 +09:00
Matt Valentine-House 1140625cd3
Allow more than one major version number in target_os 2019-12-13 08:58:42 +09:00
Koichi Sasada 40026a408d support cross-compilation.
On cross-compilation, compiled binary can no be created because
compiled binary should be created by same interpreter (on cross-
compilation, host ruby is used to build ruby (BASERUBY)).
So that cross-compilation system loads required scripts in text.
It is same as miniruby.
2019-12-11 11:24:42 +09:00
Nobuyoshi Nakada e42d9d8df8
Fixed the inverted condition 2019-12-03 14:51:14 +09:00
Nobuyoshi Nakada 9165fcdfa3
Wrap statements in AS_IF properly 2019-12-03 14:46:54 +09:00
Nobuyoshi Nakada a7b9f085ff
Disable _FORTIFY_SOURCE on mingw for now
It causes a link error due to some `__*_chk` functions on mingw.
2019-12-02 13:20:00 +09:00
Mark Abraham 07f2062c8f Improve string literal concatenation for C++11
Downstream C++ projects that compile with C++11 or newer and include
the generated config.h file issue compiler warnings. Both C and C++
compilers do string-literal token pasting regardless of whitespace
between the tokens to paste. C++ compilers since C++11 require such
spaces, to avoid ambiguity with the new style of string literals
introduced then. This change fixes such projects without affecting
core Ruby.
2019-11-06 00:31:52 +09:00
Nobuyoshi Nakada ad4da86669
Check for nonnull attribute in configure 2019-10-29 16:38:15 +09:00
卜部昌平 9195ed18ca Revert "Check for nonnull attribute in configure"
This reverts commit 54eb51d72b.

Windows build failure. See also https://github.com/ruby/ruby/runs/278718805
2019-10-29 16:05:39 +09:00
Nobuyoshi Nakada 54eb51d72b
Check for nonnull attribute in configure 2019-10-29 12:12:07 +09:00
Koichi Sasada 9e07dfd253 show BASERUBY version at configure. 2019-10-20 16:16:54 +09:00
卜部昌平 487d290044 oops
Silly typo.
2019-09-10 16:04:17 +09:00
卜部昌平 20e428ec40 fix CentOS 6 compile error
See also https://rubyci.org/logs/rubyci.s3.amazonaws.com/centos6/ruby-master/log/20190910T003005Z.fail.html.gz
2019-09-10 12:25:36 +09:00
Jeremy Evans 8d3db4f26c Default to cc/c++ instead of gcc/g++ on OpenBSD 2019-09-09 18:11:52 -07:00
Nobuyoshi Nakada 733aa2f8b5
Stop setting same flags as cflags to cxxflags 2019-09-06 18:43:41 +09:00
Nobuyoshi Nakada dd26c9f333
Check clang++ as CXX when CXX is bare clang without suffix 2019-09-06 18:43:41 +09:00
Kazuhiro NISHIYAMA 76abd79629
Fix the appropriate C++ compiler in OS X selection
Merge space and slash to character class and add missing `CXX=` before `=g++-4.2`
at 5e10cb04e8
2019-08-27 10:43:37 +09:00
Nobuyoshi Nakada 5e10cb04e8
Refined the appropriate C++ compiler in OS X selection
Allows CC to be prefixed another path or command, e.g., ccache.
2019-08-26 11:07:34 +09:00
Yusuke Endoh 365e5b38a9 configure.ac: Improve icc_version guessing for non-icc environment
icc_version was wrongly defined as "__ICC" on non-icc C compiler, which
caused a warning:

```
./configure: line 8211: test: __ICC: integer expression expected
```

This change adds a sed commend to delete "__ICC".
2019-08-25 23:08:13 +09:00
Yusuke Endoh 11f7c30fa7 configure.ac: fix the guess of icc_version
The icc_version guessing was accidentally disabled because of
61885c9b7ca8ccdaf53d7c365fbb86bad3294d88; `AC_PROG_CC_C99` changes
CC like "icc -std=c99", and `AS_CASE(["x$CC"], [xicc],` does not match.

The variable `icc_version` is eventually defined, so the `AS_CASE` is
not needed.  This change removes the `AS_CASE`.
2019-08-25 22:16:26 +09:00
Nobuyoshi Nakada 19b0161b85
Check whether syscall(2) is deprecated by actual warnings 2019-08-20 02:14:28 +09:00
Nobuyoshi Nakada 588b74e8d8
Check for minimum required OSX version earlier 2019-08-20 02:14:28 +09:00
Nobuyoshi Nakada 9ee770a2ce
Bail out if unsupported old MacOSX is required 2019-08-20 02:14:28 +09:00
Nobuyoshi Nakada af2c8d2836
Fixed the check for OSX version
Should compare minimum required version, and with the particular
macro defined for each version.  Also made the error messages
consistent.
2019-08-20 02:14:28 +09:00
David CARLIER 6dd9736c3a crash report on mac little update
displaying vm info as Linux and FreeBSD.
checking libproc as it is present only from 10.5 version.

https://github.com/ruby/ruby/pull/2384
2019-08-19 17:36:28 +09:00
David CARLIER 28267cea08 NetBSD native support of explicit_bzero's like feature (#2145) 2019-08-17 14:17:30 +09:00
Nobuyoshi Nakada 03958a0c0d
Relaxed target_os matching
When target_alias is not empty, `-gnu` suffixed is not stripped.

[Bug #16015]
2019-07-23 18:22:25 +09:00
Samuel Williams 7291fef55c
Improve build process and coroutine implementation selection. 2019-07-18 20:54:54 +12:00
Lars Kanis 68e5804022
Add coroutine context switch for i386-mingw32
It's essentially a translation of Context.asm from Intel
to AT&T syntax.
2019-07-07 21:33:47 +12:00
Jeremy Evans 11c311e36f Use realpath(3) instead of custom realpath implementation if available
This approach is simpler than the previous approach which tries to
emulate realpath(3).  It also performs much better on both Linux and
OpenBSD on the included benchmarks.

By using realpath(3), we can better integrate with system security
features such as OpenBSD's unveil(2) system call.

This does not use realpath(3) on Windows even if it exists, as the
approach for checking for absolute paths does not work for drive
letters.  This can be fixed without too much difficultly, though until
Windows defines realpath(3), there is no need to do so.

For File.realdirpath, where the last element of the path is not
required to exist, fallback to the previous approach, as realpath(3)
on most operating systems requires the whole path be valid (per POSIX),
and the operating systems where this isn't true either plan to conform
to POSIX or may change to conform to POSIX in the future.

glibc realpath(3) does not handle /path/to/file.rb/../other_file.rb
paths, returning ENOTDIR in that case.  Fallback to the previous code
if realpath(3) returns ENOTDIR.

glibc doesn't like realpath(3) usage for paths like /dev/fd/5,
returning ENOENT even though the path may appear to exist in the
filesystem.  If ENOENT is returned and the path exists, then fall
back to the default approach.
2019-07-01 11:46:30 -07:00
Jeremy Evans 81fe82be4e Enable native fiber coroutines on i386-openbsd 2019-07-01 11:44:12 -07:00
Jeremy Evans 7172ab0ec5 Use native coroutine implementation on OpenBSD-amd64
When using native fibers, do not load ucontext, as it isn't needed.
2019-06-26 16:23:11 -07:00
Jeremy Evans d004989ac6 Do not attempt to use ucontext for fibers on OpenBSD
OpenBSD does not support ucontext.

There may be a more generic way to handle this, using the result
of AC_CHECK_HEADERS(ucontext.h).
2019-06-26 07:53:54 -07:00
Samuel Williams acb67472c7 Restore updated implementation of arm32 coroutine code, but prefer ucontext. 2019-06-26 22:02:28 +12:00
Yusuke Endoh 28eeaed8a9 Revert "coroutine/arm32/Context.S: save/restore the registers via stack"
This reverts commit 6df1814c08.

It caused a SEGV again:
https://rubyci.org/logs/rubyci.s3.amazonaws.com/scw-9d6766/ruby-master/log/20190626T051707Z.fail.html.gz
2019-06-26 17:23:00 +09:00
Samuel Williams 6c6bf9ffcb Add `ucontext` coroutine implementation for generic fallback. 2019-06-26 20:19:53 +12:00
Yusuke Endoh 6df1814c08 coroutine/arm32/Context.S: save/restore the registers via stack
Retry of 518adcca0a and dbe232e24e
2019-06-26 14:08:10 +09:00
Yusuke Endoh 730aeb2523 Revert 518adcca0a and dbe232e24e
518adcca0a: "Try using arm32 implementation for fibers."
dbe232e24e: "Order of arguments might be incorrect in arm32 coroutine implementation."

It seems to cause SEGV consistently on Ubuntu armv7l eabihf:

https://rubyci.org/logs/rubyci.s3.amazonaws.com/scw-9d6766/ruby-master/log/20190625T081710Z.fail.html.gz
https://rubyci.org/logs/rubyci.s3.amazonaws.com/scw-9d6766/ruby-master/log/20190625T111708Z.fail.html.gz
2019-06-25 23:32:26 +09:00
Samuel Williams 518adcca0a Try using arm32 implementation for fibers. 2019-06-24 19:09:27 +12:00
Samuel Williams 0e6396d2ac Try using arm64 implementation for fibers. 2019-06-24 15:13:17 +12:00
Samuel Williams abdbfebad1 Use spaces for indentation in `configure.ac`. 2019-06-24 15:13:17 +12:00
Samuel Williams d17344cfc5 Remove IA64 support. 2019-06-19 23:30:04 +12:00
Nobuyoshi Nakada c7477c3e1f
Moved Makefile.in under template 2019-06-07 09:09:58 +09:00
Nobuyoshi Nakada 200c840b95
Revert "Moved Makefile.in under template"
This reverts commits:
* 6f9d5fafe0
* bb3c89b643

And remove the dependency of Makefile on Makefile.in
transitionally.
2019-06-07 09:03:25 +09:00
Nobuyoshi Nakada 6f9d5fafe0
Moved Makefile.in under template 2019-06-07 08:44:37 +09:00
Nobuyoshi Nakada d046fe9262
configure.ac: utilize wide columns for summary 2019-06-06 12:03:19 +09:00
Nobuyoshi Nakada 65ce14e7b5
Added --with-rdoc option
New option to direct formats of RDoc to install.
2019-05-25 17:20:31 +09:00
Nobuyoshi Nakada 4fae3c3fb0
Show doc list to install
Show document format list to install, not only enabled or disable.
2019-05-25 17:16:07 +09:00
Nobuyoshi Nakada 9a4d39b95e
No longer svn & git-svn are used 2019-05-10 15:22:54 +09:00
Kazuhiro NISHIYAMA 87cf45a512
Fix a typo 2019-04-23 16:50:15 +09:00
nobu 23a8183bea Check stx_btime in struct statx
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67131 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-02-24 11:57:18 +00:00
glass 8b8285e253 configure.ac: remove check for broken memmem
the bug of memmem(3) was fixed in glibc 2.1 released in 1999.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67129 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-02-24 05:27:33 +00:00
glass dc700cf903 configure.ac: skip check of statx() on AIX
Linux and AIX have statx() with different prototype.

Linux: int statx(int, const char*, int, unsigned int, struct statx*)
AIX: int statx(char, struct stat*, int, int)

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67128 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-02-23 04:42:48 +00:00
nobu 15a98ab428 Try statx syscall
* file.c (rb_file_s_birthtime): export for pathname to check if
  birthtime is supported.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67097 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-02-20 06:54:23 +00:00
glass 88798f0787 file.c: enable File.birthtime on Linux
enable File.birthtime on Linux if statx(2) is available.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67088 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-02-19 05:44:53 +00:00
glass 1a8583de72 random.c: use getrandom() if available.
getrandom() is supported by glibc 2.25 or later.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67043 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-02-10 08:21:33 +00:00
nobu 74f94b3e6e configure.ac: check finite,isinf,isnan as macros first
[ruby-core:91487] [Bug #15595]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67036 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-02-08 07:22:55 +00:00
nobu cc7dedfb4d configure.ac: separate -std=gnu99 condition
Also necessary on mingw, cygwin, darwin and netbsd.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67002 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-02-04 08:17:44 +00:00
glass 2210709b79 io.c: use fcopyfile(3) in IO.copy_stream if available
fixed r66930.

* io.c (nogvl_copy_stream_func): use fcopyfile(3) in IO.copy_stream if available

* configure.ac: check copyfile.h and fcopyfile(3)

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66934 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-28 05:04:17 +00:00
glass 774c60955a Revert "io.c: use fcopyfile(3) in IO.copy_stream if available"
This reverts commit bd670062c4.
It fails on rubyspec.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66933 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-27 21:46:06 +00:00
glass bd670062c4 io.c: use fcopyfile(3) in IO.copy_stream if available
* io.c (nogvl_copy_stream_func): use fcopyfile(3) in IO.copy_stream if available

* configure.ac: check copyfile.h and fcopyfile(3)

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66930 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-27 20:55:26 +00:00
nobu bac705529d fix typo in r66836, missing '/'s
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66901 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-22 01:56:26 +00:00
glass 12afc11fcd * io.c: use copy_file_range() if defined
* configure.ac: check copy_file_range()

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66895 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-21 10:11:04 +00:00
nobu c4e832bf6f configure.ac: fix build_os name
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66864 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-18 06:13:10 +00:00
nobu 3859b77be1 configure.ac: use MINIRUBY as BOOTSTRAPRUBY on msys
Msys shell may not be able to run a command with a drive letter?

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66863 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-18 05:14:59 +00:00
nobu 3c55a0b942 configure.ac: use BASERUBY as BOOTSTRAPRUBY if available
MINIRUBY may not be stable enough to run btest, in developing.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66859 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-18 01:55:25 +00:00
nobu 74477ec2b3 Strip warnflags
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66836 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-16 02:09:48 +00:00
nobu 923d03e10c Fixed a typo, missing `$`
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66833 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-16 00:48:42 +00:00
nobu bb44d9ecf0 configure: refuse to build with jemalloc when header is missing
[ruby-core:90964] [Bug #15520]

Freom: Misty De Meo <mistydemeo@github.com>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66779 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-10 14:44:11 +00:00
k0kubun ec336fb40e configure.ac: Require C99
We already added AC_PROG_CC_C99 in r66605.
This commit stops warning C99 features.

[Misc #15347] [close https://github.com/ruby/ruby/pull/2064]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66771 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-10 08:04:35 +00:00
k0kubun 61885c9b7c configure.ac: try to fix addr2line build failure
https://rubyci.org/logs/rubyci.s3.amazonaws.com/debian8/ruby-trunk/log/20181228T063002Z.fail.html.gz
https://rubyci.org/logs/rubyci.s3.amazonaws.com/scw-9d6766/ruby-trunk/log/20181228T081706Z.fail.html.gz
https://rubyci.org/logs/rubyci.s3.amazonaws.com/gentoo/ruby-trunk/log/20181228T063002Z.fail.html.gz
https://rubyci.org/logs/rubyci.s3.amazonaws.com/centos6/ruby-trunk/log/20181228T063003Z.fail.html.gz
https://rubyci.org/logs/rubyci.s3.amazonaws.com/centos7/ruby-trunk/log/20181228T080003Z.fail.html.gz
https://rubyci.org/logs/rubyci.s3.amazonaws.com/opensuseleap/ruby-trunk/log/20181228T080002Z.fail.html.gz
https://rubyci.org/logs/rubyci.s3.amazonaws.com/rhel_zlinux/ruby-trunk/log/20181228T063303Z.fail.html.gz
https://rubyci.org/logs/rubyci.s3.amazonaws.com/icc-x64/ruby-trunk/log/20181228T090003Z.fail.html.gz

I suspect r66598 triggered something.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66605 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-28 09:23:27 +00:00
ko1 da8830e3de fix r66599 to sucess install. please refix this patch @nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66600 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-28 03:09:29 +00:00
nobu 8422725408 Moved version numbers
* Define major and minor version numbers only in the public
  include/ruby/version.h header, as the API version numbers.

* Define only teeny version number in the private version.h
  header.

* RUBY_VERSION moved to version.c.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66599 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-28 02:12:34 +00:00
nobu 1095705c42 Check if restrict keyword is supported
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66598 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-28 01:56:20 +00:00
odaira 3a5cc345f8 Native coroutine implementation for ppc64le Linux
* configure.ac: enable fiber coroutine for powerpc64le-linux

* coroutine/ppc64le/Context.S: coroutine_transfer implementation

* coroutine/ppc64le/Context.h: coroutine implementation

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66315 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-10 23:22:56 +00:00
naruse 2f18a95c4e fix r66311
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66312 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-10 15:48:45 +00:00
naruse 7405bbda27 Define HAVE_STMT_AND_DECL_IN_EXPR and use it [Bug #15293]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66311 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-10 13:58:36 +00:00
ko1 3e1f06da5d fix C90 error.
* configure.ac (check broken_backtrace code): fix decl. position
  error because of `-Werror=declaration-after-statement`.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66226 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-05 16:15:09 +00:00
odaira d612c44dad Enable MJIT on AIX
* configure.ac: disable using __builtin_setjmp to avoid errors when execution
  globally jumps out of JITted code. Specify -std=gnu99 to JIT compilation
  to avoid errors regarding the "restrict" keyword in the precompiled header.
  Specify -shared in addition to -Wl,-G when building shared libraries
  to make mjit_build_dir.so expose the MJIT_BUILD_DIR symbol.  Use LDR_PRELOAD
  to load mjit_build_dir.so.

* mjit_worker.c: do not specify -nodefaultlibs or -nostdlibs because on AIX
  JITted code internally refers to the memcpy function.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66202 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-04 22:19:09 +00:00
ko1 66e9bfd4be use __builtin_setjmp on mingw64 [Bug #15348].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66087 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-29 06:37:01 +00:00
shyouhei 0b899a25f5 Remove HEAP_ALIGN_LOG setting in configure.ac for OpenBSD/MirOS
The ruby setting was renamed to HEAP_PAGE_ALIGN_LOG, but the
configure.in (now configure.ac) file was not updated, so the
setting had no effect.  The configure setting is unnecessary
after OpenBSD 5.2 and MirOS has been discontinued (with the last
release being over 10 years ago), so it is better to just remove
the related configure setting.

Fix [Bug #13438]
From: Jeremy Evans <code@jeremyevans.net>



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66086 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-29 06:16:31 +00:00
samuel 4b0a256e9b Enable msys2 to check build status.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65944 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-24 02:31:06 +00:00
normal b009de13bf configure.ac: support 32-bit builds on x86-64 systems
Because RAM is still expensive :<

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65921 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-22 08:46:44 +00:00
odaira e7d919d265 * configure.ac: On AIX, LDFLAGS must be after -L../.. in TRY_LINK,
not to refer to a system-installed libruby-static.a
  when configuring the ext libraries

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65908 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-21 22:44:24 +00:00