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

111 Коммитов

Автор SHA1 Сообщение Дата
ko1 0b19e15a12 rename configure option `--disable-mjit` to `--disable-mjit-support`
* configure.ac: rename configure option `--disable-mjit` to
  `--disable-mjit-support` because `--disable-mjit` is ambiguous that
  runtime MJIT default enable option or supporting MJIT features.
  `ENABLE_MJIT` is also renamed to `MJIT_SUPPORT`

* Makefile.in: catch up this fix.

* common.mk: ditto.

* test/ruby/test_jit.rb: ditto.

* win32/Makefile.sub: catch up this fix on mswin.

* tool/mkconfig.rb: fix to pass `MJIT_SUPPORT` key.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65217 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-20 08:00:42 +00:00
ko1 b710785f1a add disabling MJIT features option.
* configure.ac: introduce new configure option `--enable-mjit` and
  `--disable-mjit`. Default is "enable".
  `--disable-mjit` disables all of MJIT features so that `ruby --jit`
  can't enable MJIT.
  This option affect a macro `USE_MJIT`.
  This change remove `--enable/disable-install-mjit-header` option.

* Makefile.in: introduce the `ENABLE_MJIT` variable.

* common.mk: use `ENABLE_MJIT` option.

* internal.h: respect `USE_MJIT`. Same as other *.c, *.h.

* test/ruby/test_jit.rb: check `ENABLE_MJIT` key of rbconfg.rb.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65204 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-20 06:53:00 +00:00
naruse 595056135f Support Mach-O on backtrace with DWARF
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65202 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-20 06:35:25 +00:00
k0kubun 6e11415b9c configure.ac: add --disable-install-mjit-header
and substitute INSTALL_MJIT_HEADER. This would be convenient as a workaround
for user if we found a platform that can't compile Ruby after Ruby 2.6.0 release.

common.mk: Install MJIT header only when INSTALL_MJIT_HEADER
Makefile.in: ditto
win32/Makefile.sub: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65171 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-19 12:31:02 +00:00
shyouhei 88a7271de4 configure.ac: do not overwrite -std=
Set -std=gnu99 only when no such compiler flag(s) are set in any
compiler-related environment variables.  This enables users to
specify something more modern, say, -std=c11.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65154 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-18 09:21:05 +00:00
shyouhei 9ab13f3837 detect clang++
Given $CC is clang-* in this case branch the sed should
match against clang, not gcc.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65082 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-15 04:05:32 +00:00
nobu 9067330c6d Pass cflags given to configure to mjit
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65081 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-15 00:11:45 +00:00
nobu f2427a436f Define PRIdPTR etc
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65064 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-13 16:21:07 +00:00
odaira 67fcbf9328 * configure.ac: do not use __builtin_longjmp on ppc64* Linux
because it causes a segmentation fault with MJIT

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64983 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-09 20:06:36 +00:00
nobu b68f2a4bba Use cd -P
Setting PWD in the process does not let `cd` traverse symlinks in
/bin/sh on macOS.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64906 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-03 06:48:35 +00:00
shyouhei 1af6418742 support --with-arch=x86_64h
Recent apple machines describe themselves being x86_64h.  That
architecture is somehow supported by their C compiler and at least
by recent clang.  However config.sub does not know that fact so
making universal binary targeting it is rejected by the program.

Why not skip the check by config.sub.  [fix GH-1971]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64905 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-03 04:49:34 +00:00
shyouhei 55702df221 move GCC version check from marshal.c to configure.ac
I think it should be done in configure


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64862 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-09-27 04:33:11 +00:00
nobu c61adf51a3 configure.ac: prepend the wrapper after CPP is set
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64809 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-09-21 13:52:03 +00:00
nobu 7e9ee35fb8 Remove -Wno-parentheses flag.
[Fix GH-1958]

From: Jun Aruga <jaruga@redhat.com>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64806 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-09-21 10:19:10 +00:00
nobu d00199a139 darwin-cc: hide ld warnings
* tool/darwin-cc: ld in Apple's recent Xcode warns text-based stub
  files, which are probably caused by Apple's broken package.
  hide such (and architecture deprecation) warnings during
  configuration to pass TRY_LDFLAGS.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64802 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-09-21 07:19:13 +00:00
nobu e76eebd79b Ignore Xcode linker warnings
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64793 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-09-20 14:30:21 +00:00
nobu cff6bdfcba Make qsort_r() flavor detecting work if qsort_r() is a macro
On FreeBSD we're going to switch to the GNU-ish version of qsort_r().
POSIX is also considering standardizing that one. To prevent faulty
calls, we have a macro in place to throw a compiler error if a BSD-style
qsort_r() call is performed on a patched system. Such an approach tends
to be permitted by POSIX.

The configure check we have in Ruby would fail if qsort_r() is a
function macro. Add parentheses around it to prevent macro expansion and
force the declaration of a prototype.

[Fix GH-1954]

From: Ed Schouten <ed@nuxi.nl>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64732 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-09-13 11:00:55 +00:00
nobu f677ba8871 deduce versioned tools from CC
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64694 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-09-12 07:01:59 +00:00
kazu c09fc47a9f Fix a typo
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64664 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-09-09 10:51:48 +00:00
nobu 8e9a8c043e util.c: qsort_s in C11
* configure.ac: macro for C11 to use qsort_s.

* util.c (ruby_qsort): fix for C11 qsort_s.  the comparison function
  for MSVCRT qsort_s is compatible with BSD qsort_r, but not with C11
  qsort_s, in spite of its name.
  note that mingw defines __STDC_VERSION__ but uses qsort_s in MSVCRT,
  so the MSVCRT block needs to preced the C11 block.
  [ruby-core:88899] [Bug #15091]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64661 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-09-09 07:49:04 +00:00
nobu c8ccdbfe1e configure.ac: -fstack-protector-strong
* configure.ac: use -fstack-protector-strong if available instead of
  -fstack-protector conditionally.  [ruby-core:88788] [Misc #15053]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64614 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-09-02 03:49:31 +00:00
nobu 68f9d7b444 random.c: SecRandomCopyBytes
* random.c (fill_random_bytes_syscall): use SecRandomCopyBytes in
  Security framework on macOS 10.7 or later.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64596 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-31 09:56:24 +00:00
nobu 762f44cf49 configure.ac: printf prifix for int64_t
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64551 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-27 05:39:09 +00:00
normal 0a77fd04b7 thread_pthread.c: use eventfd instead of pipe on Linux
Based on r64478, any regular user creating more than 1024 pipes
on Linux will end up with tiny pipes with only a single page
capacity.  So avoid wasting user resources and use lighter
eventfd on Linux.

[ruby-core:88563] [Misc #15011]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64527 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-24 19:19:01 +00:00
nobu 1961c786aa configure.ac: LIBPATHENV on macOS
* configure.ac (LIBPATHENV): use DYLD_FALLBACK_LIBRARY_PATH instead of
  DYLD_LIBRARY_PATH on macOS, to honor runtime paths embedded in the
  binaries.  [ruby-core:88487] [Bug #14992]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64392 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-16 09:46:20 +00:00
normal 3dd6288d73 thread_pthread: use POSIX timer or thread to get rid of races
This closes race condition where GVL is uncontended and a thread
receives a signal immediately before calling the blocking
function when releasing GVL:

	1) check interrupts
	2) release GVL
	3) blocking function

If signal fires after 1) but before 3), that thread may never
wake up if GVL is uncontended

We also need to wakeup the ubf_list unconditionally on
gvl_yield; because two threads can be yielding to each other
while waiting on IO#close while waiting on threads in IO#read or
IO#gets.

[ruby-core:88360] [Misc #14937]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64353 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-13 21:34:24 +00:00
k0kubun 0ab6266c9d Makefile.in: drop MJIT_DLDFLAGS_NOCOMPRESS
which is obsoleted by r64331

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64335 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-13 11:02:37 +00:00
naruse 0efd00bf4f Re-apply wrongly reverted r64330
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64333 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-13 07:55:43 +00:00
naruse bcf8f79d6d support compressed debug_line
re-commit r64328
https://blogs.oracle.com/solaris/elf_section_compression-v2
https://gnu.wildebeest.org/blog/mjw/2016/01/13/elf-libelf-compressed-sections-and-elfutils/

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64331 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-13 06:20:12 +00:00
nobu 2132fb3316 configure.ac: use linker_flag to LIBRUBY_DLDFLAGS
* configure.ac: use a feature flag `linker_flag`, than checking if the
  compiler is `GCC`.

* configure.ac: append to LIBRUBY_DLDFLAGS once after initialized with
  DLDFLAGS.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64330 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-13 06:09:57 +00:00
naruse 843589a726 Revert "support compressed debug_line"
This reverts commit r64328

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64329 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-13 06:05:39 +00:00
naruse a20a2b0044 support compressed debug_line
https://blogs.oracle.com/solaris/elf_section_compression-v2
https://gnu.wildebeest.org/blog/mjw/2016/01/13/elf-libelf-compressed-sections-and-elfutils/

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64328 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-13 02:56:06 +00:00
k0kubun 25c79f446d configure.ac: use the correct argument
for --compress-debug-sections. I thought "no" is the correct one because
configure.ac has `AS_IF([test "x$compress_debug_sections" != xno]`, but
it wasn't the case.

This commit is needed to resolve errors like:
/usr/bin/x86_64-linux-gnu-ld: invalid --compress-debug-sections option: `no'
collect2: error: ld returned 1 exit status

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64326 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-12 15:16:00 +00:00
k0kubun 422f4e3e1b configure.ac: MJIT_DLDFLAGS_NOCOMPRESS
is configured now, to force -Wl,--compress-debug-sections=no
for MJIT only when the option is used in MJIT_DLDFLAGS.

This needs to be done in configure.ac to resolve build failure like
https://travis-ci.org/ruby/ruby/builds/415120662.

Makefile.in: define it in mjit_config.h

mjit_worker.c: replace hard-coded flag to MJIT_DLDFLAGS_NOCOMPRESS

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64325 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-12 15:13:06 +00:00
nobu 8b46df7947 upgrade the default WINNT version
* configure.ac: set the default target Windows NT version to 0x0600,
  as well as mswin version since r50051.  Windows XP has ended years
  ago.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64294 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-11 13:28:40 +00:00
normal 44fc3d08eb unrevert r63852 but keep SIGCHLD path disabled for win32
Reading win32/win32.c waitpid implementation, maybe waitpid(-1, ...)
on that platform will never conflict with mjit use of waitpid.

In any case, I've added WAITPID_USE_SIGCHLD macro to vm_core.h
so it can be easy for Linux/BSD users to test (hopefully!)
win32-compatible code.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63855 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-05 03:02:33 +00:00
naruse df4a126d65 Revert r63758 and related commits
The change is unstable on Windows. Please re-commit it when it correctly
supports Windows.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63852 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-04 15:08:56 +00:00
nobu ef01bbcf70 configure.ac: [DOC] refine help messages
cflags, cppflags, and cxxflags are additional flags to auto
configured flags, and ignored when the their respective autoconf
default variables are given.
[ci skip]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63832 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-03 00:49:32 +00:00
nobu 7b230cfe28 use sigsetjmp on macOS
SIGCHLD is used internally since r63758, the signal masks need to
be restored.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63803 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-30 11:56:54 +00:00
normal 054a412d54 hijack SIGCHLD handler for internal use
Use a global SIGCHLD handler to guard all callers of rb_waitpid.
To work safely with multi-threaded programs, we introduce a
VM-wide waitpid_lock to be acquired BEFORE fork/vfork spawns the
process.  This is to be combined with the new ruby_waitpid_locked
function used by mjit.c in a non-Ruby thread.

Ruby-level SIGCHLD handlers registered with Signal.trap(:CHLD)
continues to work as before and there should be no regressions
in any existing use cases.

Splitting the wait queues for PID > 0 and groups (PID <= 0)
ensures we favor PID > 0 callers.

The disabling of SIGCHLD in rb_f_system is longer necessary,
as we use deferred signal handling and no longer make ANY
blocking waitpid syscalls in other threads which could "beat"
the waitpid call made by rb_f_system.

We prevent SIGCHLD from firing in normal Ruby Threads and only
enable it in the timer-thread, to prevent spurious wakeups
from in test/-ext-/gvl/test_last_thread.rb with MJIT enabled.

I've tried to guard as much of the code for RUBY_SIGCHLD==0
using C "if" statements rather than CPP "#if" so to reduce
the likelyhood of portability problems as the compiler will
see more code.

We also work to suppress false-positives from
Process.wait(-1, Process::WNOHANG) to quiets warnings from
spec/ruby/core/process/wait2_spec.rb with MJIT enabled.

Lastly, we must implement rb_grantpt for ext/pty.  We need a
MJIT-compatible way of supporting grantpt(3) which may spawn
the `pt_chown' binary and call waitpid(2) on it.

[ruby-core:87605] [Ruby trunk Bug#14867]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63758 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-27 03:14:30 +00:00
nobu 64a189d207 remove DISABLE_RUBYGEMS from config files
* configure.ac: removed DISABLE_RUBYGEMS macro from config.h, not
  to rebuild everything when the flag changed.

* configure.ac, win32/configure.bat: make USE_RUBYGEMS lowercase.

* tool/mkconfig.rb: remove RUBYGEMS stuff from rbconfig.rb, not to
  reconfigure and rebuild all extension libraries.

* Makefile.in (CPPFLAGS): enable/disable Rubygems by USE_RUBYGEMS.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63718 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-22 04:13:02 +00:00
nobu a03ea378e7 prefer clock_gettime
* configure.ac: clock_gettime or gettimeofday must exist.

* process.c (rb_clock_gettime): prefer clock_gettime over
  gettimeofday, as the latter is obsolete in SUSv4.

* random.c (fill_random_seed): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63663 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-14 13:10:25 +00:00
ngoto a667fe79ea configure.ac: move the checks of _XOPEN_SOURCE on Solaris
* configure.ac (solaris*): Move the checks of _XOPEN_SOURCE to the
  location before r63443, to cover non-GCC compilers on Solaris.
  This partly reverts r63443.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63444 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-16 11:06:30 +00:00
ngoto 88cb22e979 configure.ac: move checks of -std=gnu99 and _XOPEN_SOURCE on Solaris
* configure.ac (ansi_options): On Solaris, "-std=gnu99" should be
  appended to CPPFLAGS instead of warnflags and strict_warnflags,
  because the flag affects existance of functions and macros.

* configure.ac (solaris*): Check _XOPEN_SOURCE just after checking
  "-std=gnu99" on Solaris. Because _XOPEN_SOURCE also affects existance
  of many functions and macros, it is good to define it earlier.
  The check is simplified to use AC_TRY_COMPILE with RUBY_WERROR_FLAG.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63443 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-16 04:11:20 +00:00
ngoto 52b29a3314 configure.ac: revert r63438
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63442 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-16 03:57:50 +00:00
ngoto 577002efac Change logic to check _XOPEN_SOURCE on Solaris
* configure.ac: Change logic to check _XOPEN_SOURCE on Solaris.
  With _XOPEN_SOURCE, "-std=gnu99" may also be added to CPPFLAGS.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63438 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-15 20:48:23 +00:00
nobu f50051ad5f configure.ac: maybe with jemalloc
* configure.ac (--with-jemalloc): accept `maybe` (other than `yes`
  and `no`), check for jemalloc and use it if possible.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63433 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-15 08:08:24 +00:00
shyouhei a95369b33d -Wno-cast-function-type
GCC 8.1+ introduced this warning in -Weverything.  It does
shed some lights on something, but rather annoying than
useful ATM.  Might be a subject to revert this option in a
future.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63429 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-15 04:35:58 +00:00
ngoto 3d1e34c1ce configure.ac: remove ineffective check on Solaris with GCC
* configure.ac (solaris): Remove ineffective check for -std=iso9899:1999
  on Solaris with GCC. The "-std=iso9899:1999" was replaced by
  "-std=gnu99" by the commit r54895. The check is no longer effective
  after that, and two years have passed without error reports.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63401 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-11 17:21:37 +00:00
knu de2bfd3d9c Remove the teeny part from the shared library name on macOS
This will prevent macOS users from having to rebuild all extension
libraries every time they upgrade ruby to a new teeny release.

Before:
- libruby.2.6.0.dylib
- libruby.2.6.dylib -> libruby.2.6.0.dylib
- libruby.dylib -> libruby.2.6.0.dylib

After:
- libruby.2.6.dylib
- libruby.dylib -> libruby.2.6.dylib

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63300 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-29 11:15:41 +00:00