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

394 Коммитов

Автор SHA1 Сообщение Дата
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
shyouhei 9930481a23 Prefer alignof() over _Alignof()
to allow C++ programs include <ruby.h>. [Bug #14668]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63123 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-09 02:40:12 +00:00
nobu c3da162596 Honor --silent option
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63072 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-03 08:29:51 +00:00
nobu 98e9444b5f configure.ac: string literal concatenation
* configure.ac: bail out if string literal concatenation is not
  available, as it is used everywhere now.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62933 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-27 01:09:14 +00:00
nobu 2936d4b378 configure.ac: named blocks
* configure.ac: turned section block comments into named blocks.
  http://c16e.com/1603281120/

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62910 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-24 14:28:45 +00:00
nobu dd543cd478 configure.ac: DLDFLAGS without arch flags
* configure.ac (DLDFLAGS): copy LDFLAGS before adding arch flags.
  multiple arch flags on universal binary make mjit_header.h
  failed.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62770 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-16 01:48:02 +00:00
nobu ec45161c51 configure.ac: fix rb_cv_gcc_compiler_cas
* configure.ac (rb_cv_gcc_compiler_cas): do not use one variable
  for multiple AC_CACHE_CHECK.  in one check, select by different
  values.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62765 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-15 15:20:08 +00:00
nobu 999b58c1ff configure.ac: basic libs
* configure.ac: basic libraries like -lm are necessary for some
  extension libraries on some platforms.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62749 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-14 14:07:00 +00:00
nobu 2dafe8df55 configure.ac: --disable-mathn option
* Makefile.in, win32/Makefile.sub: move CANONICALIZATION_FOR_MATHN
  from config.h which affects all extension libraries to XCFLAGS
  for the core only.

* configure.ac: added --disable-mathn option.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62705 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-09 04:24:48 +00:00
nobu 3bc92b8eac mjit_config.h: MJIT_LDSHARED
* configure.in (MJIT_LDSHARED): define based on LDSHARED with
  replacing CC with MJIT_CC.

* Makefile.in, win32/Makefile.sub (mjit_config.h): instead of the
  default LDSHARED, use MJIT_LDSHARED to link mjit shared objects.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62644 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-03 05:09:32 +00:00
nobu bb3db69e2a configure.ac: library options to MAINLIBS
* configure.ac (MAINLIBS): moved library options for main program
  and static libruby, and append MAINLIBS to LIBRUBYARG_STATIC, as
  these libraries are not needed for linking to shared libruby.
  [ruby-core:85882] [Bug #14422]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62627 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-02 01:37:53 +00:00
nobu 96cda9bb77 configure.ac: fix up r59130
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62625 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-02 00:37:28 +00:00
nobu f6ff45ceb3 MJIT specific flags
Passing options to configure like as `configure MJIT_OPTFLAGS=-O
MJIT_DEBUGFLAGS=-g` overrides options to be used to compile JIT
code, separately from the default options to be used for ruby
itself.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62623 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-01 22:49:26 +00:00
nobu 0f0c32f24e mjit.c: no va_copy
* mjit.c (form_args): do not use va_copy, which cannot detect
  appropriate way to simulate when cross compiling.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62463 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-18 05:10:52 +00:00
nobu 673ae0e3c9 configure.ac: check clockid_t with necessary headers
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62446 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-17 05:22:56 +00:00
mame 50700c4d3c thread_pthread.c: Use `getpagesize()` when `pthread_attr_getguardsize` is unavailable
This is also for emscripten.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62409 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-15 01:59:16 +00:00
mame 8df47f8c8d configure.ac: Use `pthread_create` to determine if pthread is available
Instead of `pthread_kill`.  This is because emscripten supports
`pthread_create` but not `pthread_kill`.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62408 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-15 01:59:15 +00:00
nobu 4b8719c1cd MJIT header for multiarch
* configure.ac: MJIT_HEADER_INSTALL_DIR to rubyarchhdrdir to
  support multiarch.

* Makefile.in (MJIT_HEADER_INSTALL_DIR): configured by multiarch.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62320 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-08 15:19:32 +00:00
nobu 427b2ac250 configure.ac: removed unnecessary pushdef/popdef
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62247 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-06 08:00:17 +00:00
shyouhei eb537609ba deal with aclocal(1)
This commit updates files so that aclocal.m4 generated by aclocal(1)
works well with our configure.ac

	* ac_checking.m4: merged back to configure.ac because
	  aclocal(1) cannot handle this macro.

	* ruby_append_options.m4: no longer used.

	* ruby_check_va_copy.m4: define using AC_DEFUN so that
	  aclocal(1) can find this macro.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62243 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-06 02:08:13 +00:00
shyouhei 779c18bf23 va_copy is a C99ism
Should provide appropriate fallback implementation.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62220 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-05 04:07:25 +00:00
nobu 29c9dc3162 common.mk: rb_mjit_header.h
* common.mk (rb_mjit_header.h): moved from Makefile.in and
  win32/Makefile.sub.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62202 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-04 13:43:06 +00:00
kazu ef83b306e2 Fix duplicated HAVE_NAN
And remove redundant `HAVE_*` macros,
and use `USE_RB_*` macros instead.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62067 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-27 04:14:26 +00:00
shyouhei ec43478f34 set AC_CONFIG_MACRO_DIRS [close GH-1793]
We do not use aclocal(1) by default. But in case users do so,
AC_CONFIG_MACRO_DIRS help them reconstruct the same contents as
this commit includes.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61982 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-20 07:05:26 +00:00
shyouhei 0664a6377a refactor split configure.ac into files
This does not (yet) change anything. The generated configure file
is the identical to previous one (except several empty lines added
and deleted).

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61981 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-20 07:05:25 +00:00
shyouhei 782236e3bd add missing/nan.c
instead of scattering #ifdef HAVE_NANF here and there define our
own nan() unless defined elsewhere.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61971 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-20 03:16:59 +00:00
shyouhei de9d264026 there is no guarantee that mode_t is as wide as int
POSIX only defines mode_t to be "an integer typea", and in fact
MacOS defines it to be uint16_t.  We didn't have NUM2USHORT before
so it did not make sense but now that we have it.  Why not check
apptopriately.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61950 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-19 09:12:06 +00:00
shyouhei 3ca0948f68 INFINITY is float. That of double is HUGE_VAL.
It seems HUGE_VAL is already used. Why not eliminate INTINITY.
NAN is also float. That of double is called nan(). This is also
fixed.

Signed-off-by: Urabe, Shyouhei <shyouhei@ruby-lang.org>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61938 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-19 01:45:36 +00:00
shyouhei 414c09015c -Wmissing-noreturn
This is the -Wsuggest-attribute=noreturn equivalent option for clang.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61912 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-18 09:44:36 +00:00
shyouhei 7edb0a275c -Wno-overlength-strings
as per https://bugs.ruby-lang.org/projects/ruby-trunk/wiki/Assumptions
we are officially giving up 509 characters limit of C string
literal length.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61874 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-16 08:35:33 +00:00
shyouhei bca40b8b56 sorry, this hunk was a garbage. [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61834 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-15 04:36:08 +00:00
shyouhei df9a70900a __builtin_alloca_with_align for optimal memory access
ALLOCA_N takes type arugment.  It is natural that the returned
value to be used as an array of type, thus type-aligned.
Luckily GCC has a builtin to tell compiler such alignment info.
This should generate beter instructions.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61830 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-15 02:35:19 +00:00
shyouhei 39cfa67b4f __builtin_assume_aligned for *(foo *) casts
These casts are guarded. Must be safe to assume alignments.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61829 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-15 02:35:18 +00:00
shyouhei 21429b1488 __alignof__ to take alignment of a type
C11 and C++11 has this feature so why not use it when available.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61828 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-15 02:35:17 +00:00
shyouhei f089a52865 __attibute__((__aligned__)) for RSTRING_PTR()
For instance array.c:rb_ary_product() uses RSTRING_PTR() as an
array of int. So to avoid misaligned memory access RSTRING_PTR()
must at least be sizeof(int)-aligned.  However the type of
RSTRING_PTR() is char*, which of course can expect alignment as
much as 1.  This is a problem.

The reality is, there is no misaligned memory access because the
memory region behind RSTRING_PTR() is allocated using malloc().
Memory regions returned from malloc() are always aligned
appropriately.  So let's tell the compiler about this information.
It seems GCC, clang, and MSVC have such feature.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61827 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-15 02:35:16 +00:00
hsbt afcd060a92 Fix a typo.
configure.ac: delcares -> declares.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61803 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-13 11:10:08 +00:00
normal 043e1fd559 thread_pthread: remove checks for pthread_cond*_init
These were added for NaCL support in r36022, and we dropped NaCL
in r60374.

IMHO, any pthreads implementation without these basic functions
is not worth the time to support.

[ruby-core:84758] [Misc #14342]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61720 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-09 08:26:43 +00:00
normal e8f40bd8f8 thread_pthread: remove HAVE_PTHREAD_ATTR_INIT ifdefs
ifdefs make code confusing for my easily-confused mind :<
These were added for NaCL support in r36022, and we dropped NaCL
in r60374.  There are more #ifdefs to remove...

[ruby-core:84758] [Misc #14342]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61719 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-09 08:26:38 +00:00
nobu ecbb128273 fix fd mask detection on os x
This was broken in r59440 (3215b27a9a)
[Bug #14248]

From: Stefan Kaes <skaes@railsexpress.de>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61500 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-27 14:07:49 +00:00
naruse 4b798a3989 initialize should be outside
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61279 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-15 09:43:40 +00:00
naruse a32e3fee79 check icc version inside condition
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61276 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-15 07:58:02 +00:00
naruse 41b76e98a9 suppress icc warnings
* subscript out of range
* enumerated type mixed with another type

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61275 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-15 07:58:00 +00:00
naruse b7747df13e particular_werror_flags=no on ICC
fix r61261

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61263 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-14 18:33:33 +00:00
naruse dd25f5052f ICC doesn't support -Werror= but ignore
It cause warnings when ruby remove error= on compiling ext/*.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-14 16:47:28 +00:00
nobu 6875e3242f configure.ac: fixed a typo [Feature #4052]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60939 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-29 14:48:02 +00:00
nobu defcaf89dd file.c: File.lutime
* file.c (utime_internal): add File.lutime.  [Feature #4052]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60933 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-29 09:59:20 +00:00
nobu 8fc8587e05 sysconfdir on Windows
* ext/etc/etc.c (etc_sysconfdir): mentioned special case on
  Windows.  [ruby-core:43110] [Bug #6121]

* ext/etc/extconf.rb: define SYSCONFDIR only if sysconfdir is set
  in RbConfig::CONFIG and not empty.

* win32/Makefile.sub (config.status): sysconfdir is not used on
  Windows.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60402 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-24 13:48:08 +00:00
naruse 1333c0f0df Revert "sysconfdir on Windows"
This reverts commit r60279.
This breaks mswin build:
https://ci.appveyor.com/project/ruby/ruby/build/1.0.5571

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60399 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-24 11:15:20 +00:00
hsbt 0e2d2e6a79 Drop to support NaCl platform.
Because NaCl and PNaCl are already sunset status.
  see https://bugs.chromium.org/p/chromium/issues/detail?id=239656#c160

  configure.ac: Patch for this file was provided by @nobu.

  [Feature #14041][ruby-core:83497][fix GH-1726]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60374 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-23 05:56:25 +00:00
nobu e4ff51b05a sysconfdir on Windows
* ext/etc/etc.c (etc_sysconfdir): mentioned special case on
  Windows.  [ruby-core:43110] [Bug #6121]

* win32/Makefile.sub (config.status): sysconfdir is not used on
  Windows.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60279 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-21 14:19:23 +00:00
nobu 20685cdc85 Get rid of shadowing local variables
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60204 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-18 04:35:25 +00:00
nobu 90ab739ae4 configure.ac: fix SOEXT on Windows
* configure.ac (SOEXT): shoud be "dll" on Windows.
  [ruby-core:83208] [Bug #14002]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60190 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-16 05:00:21 +00:00
nobu ae0eea21bf fix missing variables in ruby.pc
* configure.ac (LIBRUBY_SO): get rid of referrence to
  LIBRUBY_SONAME which is not present in ruby.pc.

* template/ruby.pc.in (RUBY_API_VERSION, SOEXT): add new
  variables.  [ruby-core:83208] [Bug #14002]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60187 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-16 04:15:19 +00:00
nobu b625191054 configure.ac: fix SONAME
* configure.ac (RUBY_SO_NAME): revert $(RUBY_API_VERSION:.=) to
  $(MAJOR)$(MINOR), as a string in middle is not replaced.
  [ruby-core:83208] [Bug #14002]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60184 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-15 02:31:29 +00:00
nobu 8b182a7f7d configure.ac: link Foundation framework
* configure.ac (XLDFLAGS): link against Foundation framework and
  let __NSPlaceholderDictionary initialize, to get rid of crash
  after fork on macOS High Sierra.  [ruby-core:83239] [Bug #14009]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60182 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-14 15:55:14 +00:00
nobu c739150c1e configure.ac: LIBRUBY_SONAME
* configure.ac (LIBRUBY_SONAME): add new variable for the name of
  the library name with compatibility version.
  [ruby-core:83208] [Bug #14002]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60180 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-14 15:35:05 +00:00
nobu 7402c35c49 configure.ac: no _objc_msgSend trick
* configure.ac (XLDFLAGS): _objc_msgSend is no longer needed to
  link CoreFoundation, that framework is always used for CFString
  functions.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60177 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-14 01:59:47 +00:00
naruse 4f966c0a68 configure.ac: detect mandoc and set MANTYPE=doc
OpenBSD uses mandoc [Feature #13981] [ruby-core:83146]
Note: AC_PATH_PROGS_FEATURE_CHECK is autoconf 2.62 feature,
but current CRuby declares AC_PREREQ(2.67); it's safe to use.
Patched by kernigh (George Koehler)

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60129 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-06 11:17:38 +00:00
glass 7f2fd38be6 configure.ac: remove --enable-pthread option.
* configure.ac: remove --enable-pthread option.
  it was obsoleted in 2009.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60073 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-30 09:27:30 +00:00
glass d00c9d7e06 configure.ac: remove unused macro
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60070 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-30 06:45:24 +00:00
glass 9189cf5793 configure.ac: use m4_version_prereq
* configure.ac: use m4_version_prereq to check
  running autoconf version.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60068 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-30 06:30:44 +00:00
nobu 3133a5c971 configure.ac
* configure.ac: renamed configure.in.  [Feature #13946]

* Makefile.in, common.mk, ext/rbconfig/sizeof/depend: use
  configure.ac.

* README.ja.md, README.md: update document for configure.ac.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60062 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-29 13:21:17 +00:00