Commit graph

546 commits

Author SHA1 Message Date
Nobuyoshi Nakada
7cf90f99f5
Refix PAGE_SIZE
* honor actually used headers
* include sys/user.h only when `PAGE_SIZE` is not defined
2021-05-14 09:33:20 +09:00
John Hawthorn
0aa4ca1477 Fix compilation with jemalloc on macos
On darwin we avoid including sys/user.h to avoid a conflict. Previously
we still ended up with PAGE_SIZE being defined because the headers for
system malloc define it. However, when compiling with jemalloc nothing
would define PAGE_SIZE.

This commit changes configure.ac so that we never use the PAGE_SIZE
constant on darwin and to always use the sysconf fallback.
2021-05-13 11:14:30 -04:00
Nobuyoshi Nakada
2d67027448 Removed missing/dup2.c
This function should be always available, as POSIX-compliant or
Windows platform are required since 1.9.  Also the code in this
file is MT-unsafe.
2021-05-10 15:59:23 +09:00
Nobuyoshi Nakada
a1fdc5f71c
Check only whether PAGE_SIZE is compile-time const 2021-05-06 11:30:37 +09:00
Nobuyoshi Nakada
921d8ac99d
Get rid of including sys/user.h on macOS
LIST_HEAD in ccan/list conflicts with sys/queue.h.

```
./ccan/list/list.h:75:9: warning: 'LIST_HEAD' macro redefined [-Wmacro-redefined]
        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/queue.h:465:9: note: previous definition is here
        ^
```
2021-05-06 09:39:47 +09:00
Peter Zhu
23a98237df Fix PAGE_SIZE macro detection in autoconf
The current fix for PAGE_SIZE macro detection in autoconf does not work
correctly. I see the following output with running configure on Linux:

```
checking PAGE_SIZE is defined... no
```

Linux has PAGE_SIZE macro. This is happening because the macro exists in
sys/user.h and not in the malloc headers.
2021-05-05 15:31:30 -04:00
Nobuyoshi Nakada
3d5b6ddff8
Fix compilation on M1 Mac
As PAGE_SIZE may not be a preprocessor constant, dispatch at
runtime in that case.
2021-05-05 23:54:36 +09:00
Yusuke Endoh
e71c9ca529 configure.ac: check if __builtin_expect is available or not
include/ruby/internal/has/builtin.h uses HAVE_BUILTIN___BUILTIN_EXPECT
for icc but previously it was not defined.

This is a follow up of 8b32de2ec9 and this
will fix the following failures:

20210505T030003Z.fail.html.gz
```
  1) Failure:
TestMkmf::TestConvertible#test_typeof_builtin [/home/chkbuild/chkbuild/tmp/build/20210505T030003Z/ruby/test/mkmf/test_convertible.rb:9]:
convertible_int: checking for convertible type of short... -------------------- short

--------------------

convertible_int: checking for convertible type of int... -------------------- int

--------------------

convertible_int: checking for convertible type of long... -------------------- long

--------------------

convertible_int: checking for convertible type of signed short... -------------------- failed

"icc -std=gnu99 -o conftest -I. -I/home/chkbuild/chkbuild/tmp/build/20210505T030003Z/ruby/.ext/include/x86_64-linux -I/home/chkbuild/chkbuild/tmp/build/20210505T030003Z/ruby/include -I./test    -O3 -ggdb -Wall -Wextra -Wdeprecated-declarations -Wimplicit-function-declaration -Wimplicit-int -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-unused-parameter -Wunused-variable -diag-disable=175,188,1684,2259,2312 -Wextra-tokens -Wundef conftest.c  -L. -L/home/chkbuild/chkbuild/tmp/build/20210505T030003Z/ruby -Wl,-rpath,/home/chkbuild/chkbuild/tmp/build/20210505T030003Z/ruby -L. -fstack-protector-strong -rdynamic -Wl,-export-dynamic     -Wl,-rpath,/home/chkbuild/chkbuild/tmp/build/20210505T030003Z/lib -L/home/chkbuild/chkbuild/tmp/build/20210505T030003Z/lib -lruby-static -lz -lpthread -lrt -lrt -ldl -lcrypt -lm   -lm   -lc"
In file included from /home/chkbuild/chkbuild/tmp/build/20210505T030003Z/ruby/include/ruby/defines.h(72),
                 from /home/chkbuild/chkbuild/tmp/build/20210505T030003Z/ruby/include/ruby/ruby.h(23),
                 from /home/chkbuild/chkbuild/tmp/build/20210505T030003Z/ruby/include/ruby.h(39),
                 from conftest.c(1):
/home/chkbuild/chkbuild/tmp/build/20210505T030003Z/ruby/include/ruby/backward/2/assume.h(34): warning #193: zero used for undefined preprocessing identifier "HAVE_BUILTIN___BUILTIN_EXPECT"
  #if RBIMPL_HAS_BUILTIN(__builtin_expect)

...
```
2021-05-05 12:58:12 +09:00
Nobuyoshi Nakada
5bde2e61db Workaround for gcc-4 bug
False positive `-Wundef` in `#elif` after `#if defined`.
2021-05-05 10:10:59 +09:00
Benoit Daloze
8b32de2ec9 Add -Werror=undef to default warnflags for core
* See [Feature #17752]
* For external extensions it's transformed to just warn and not error (-Wundef)
  like other other -Werror in warnflags.
2021-05-04 14:56:55 +02:00
Nobuyoshi Nakada
1f56238032
Remove comments in tool/m4 from the generated configure 2021-04-17 19:14:21 +09:00
Nobuyoshi Nakada
17c3014bb7
Prefer positive condition to double negative
Autoconf 2.70 seems to omit the check for the given CC,
`AC_COMPILE_IFELSE` does not know which is the cause of the
failure.
2021-04-17 19:08:53 +09:00
Nobuyoshi Nakada
a5688b5ce6
Support non-standard struct stat [Bug #17793]
On 32-bit Android:
* `st_dev`/`st_rdev` are not `dev_t`
* `st_mode` is not `mode_t`
2021-04-12 15:32:49 +09:00
Nobuyoshi Nakada
4a6c7f8696 configure: always check for atomic/sync builtins [Bug #17787]
Non-gcc compilers tend to have this intrinsic these days, e.g. xlc
has `__sync` builtins.
2021-04-10 16:05:01 +09:00
Nobuyoshi Nakada
8b7cab70eb configure: try -fdeclspec option by linking [Bug #17787]
A workaround for `-f` option of AIX xlc compiler which works only
on linking.
2021-04-10 16:05:01 +09:00
Kazuhiro NISHIYAMA
9713acd731
Fix coroutine_type variable name 2021-03-30 20:58:34 +09:00
Samuel Williams
b507f65d44 Support for native riscv64 coroutines. 2021-03-30 19:23:17 +13:00
Nobuyoshi Nakada
1f08b0d18d
Removed dln_a_out
a.out format is considered extinct nowadays.
2021-03-24 20:13:55 +09:00
Yusuke Endoh
1c6f5ca4d4 configure.ac: enable FORCE_FILESYSTEM for Emscripten 2021-03-20 03:04:55 +09:00
Rick Mark
dc7044eb48
Remove unneeded dependencies on macOS [Feature #17730] 2021-03-19 15:27:42 +09:00
Nobuyoshi Nakada
4ea96f1d4f
Use CommonRandom if available 2021-03-19 15:23:03 +09:00
Yusuke Endoh
e79b42c9b2 configure.ac: don't use pthread_sigmask in emscripten 2021-03-19 12:32:33 +09:00
Yusuke Endoh
d97ed004e8 configure.ac: avoid spaces in a LDFLAGS option
Seems like it confuses "make ruby" for emscripten.
2021-03-19 12:30:59 +09:00
卜部昌平
f9e4378299
get rid of aclocal (#4280) 2021-03-17 18:52:53 +09:00
Nobuyoshi Nakada
ea39955e23
Removed a duplicate setting for mingw 2021-03-12 15:51:29 +09:00
Nobuyoshi Nakada
4c80b9d063
Fix coroutine_type variable name 2021-03-10 22:13:06 +09:00
Nobuyoshi Nakada
f0b3700ddc
Given argument does not need to cache 2021-03-09 23:05:24 +09:00
Nobuyoshi Nakada
5f821ee977
Recheck ucontext functions to make reconfig stable 2021-03-09 20:36:15 +09:00
Peter Zhu
0bd1bc559f Don't use mmap on platforms that have large OS page sizes 2021-03-02 10:04:49 -08:00
Peter Zhu
1e13548953 Use mmap for allocating heap pages 2021-02-25 11:01:50 -08:00
Aaron Patterson
08d5db4064
Reverting PR #4221
It seems this breaks tests on Solaris, so I'm reverting it until we
figure out the right fix.

  20210224T210007Z.fail.html.gz
2021-02-24 13:44:10 -08:00
Peter Zhu
785f5eb8f0 Use mmap for allocating heap pages 2021-02-24 12:25:30 -08:00
David Carlier
dfd029c962 supports for stack protection for haiku. 2021-02-15 17:16:14 +09:00
Andrew Aladjev
3c593f28ed
Fixed default coroutine selection for musl. 2021-02-09 18:48:03 +13:00
Nobuyoshi Nakada
0acc05caf7
Add -fdeclspec to CFLAGS instead of CC 2021-02-05 12:34:17 +09:00
Nobuyoshi Nakada
49918b3984
MSys is a variant of Cygwin 2021-01-31 14:27:15 +09:00
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 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