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

310 Коммитов

Автор SHA1 Сообщение Дата
Nobuyoshi Nakada c736714de1
Clear unexpanded `mjit_std_cflag` 2021-01-27 15:00:19 +09:00
Nobuyoshi Nakada 0d5a4d6d49
Disable fast-math
As `RUBY_TRY_CFLAGS` restores `CFLAGS`, appending to the variable
in its block has no effect.
2021-01-27 14:50:27 +09:00
Yusuke Endoh 62283f7a7a coroutine/emscripten/: Experimentally support emscripten fiber API 2021-01-23 18:56:06 +09:00
Yusuke Endoh f12c33b611 configure.ac: Add some compiler options for emscripten
"-lc" and "-s ALLOW_MEMORY_GROWTH=1" are needed
2021-01-23 16:07:41 +09:00
Yusuke Endoh 1dfddac393 configure.ac: Stop -fstack-protector on emscripten build 2021-01-23 10:11:50 +09:00
Nobuyoshi Nakada 07b4b1b1cb
Support coroutine on universal binary 2021-01-22 23:41:52 +09:00
Nobuyoshi Nakada c3244a3574
Do not set target_alias if unset 2021-01-22 22:29:17 +09:00
Nobuyoshi Nakada c8121b2e3d
Adjust CPU name as arm64-darwin
config.sub replaces arm64 with aarch64.
2021-01-22 18:37:31 +09:00
Nobuyoshi Nakada 48bb0329eb
Revert AC_PROG_CC_C99 for -std=gnu99 option to gcc 4.8 2021-01-18 16:22:17 +09:00
Nobuyoshi Nakada c32375883a
Update for autoconf 2.70 2021-01-18 16:22:17 +09:00
Nobuyoshi Nakada a3851d97ed
Removed unused AC_CHECKING 2021-01-18 15:33:10 +09:00
Kazuhiro NISHIYAMA 6abf393e8f
OpenBSD has getentropy, but no sys/random.h
https://man.openbsd.org/getentropy

Try to fix https://rubyci.s3.amazonaws.com/openbsd-current/ruby-master/log/20210118T023008Z.fail.html.gz
```
compiling random.c
random.c:53:11: fatal error: 'sys/random.h' file not found
# include <sys/random.h>
          ^~~~~~~~~~~~~~
1 error generated.
```
2021-01-18 12:43:05 +09:00
David CARLIER 54c91185c9 random generator update for Mac proposal
using getentropy for seeding, reading 256 bytes at a time to avoid
 the EIO errno since this is the maximum.
2021-01-17 18:48:48 +09:00
Yusuke Endoh b9c1b3f8d8 configure.ac: disable using __builtin_setjmp on ARM Android
A patch from Tee KOBAYASHI <xtkoba+ruby@gmail.com>. [Bug #17511]
2021-01-05 13:59:03 +09:00
Yusuke Endoh 449ef72cb9 configure.ac: Stop auto-detection of __ANDROID_API__ when cross-compiling
A patch from Tee KOBAYASHI <xtkoba+ruby@gmail.com>. [Bug #17491]
2021-01-05 10:16:05 +09:00
TAKANO Mitsuhiro 78677f105d
Disable DTrace in FreeBSD (#3999)
The latest ruby cannot compile with FreeBSD Dtrace enabled.
2020-12-25 12:06:46 +09:00
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