aboutsummaryrefslogtreecommitdiffstats
path: root/configure.ac
Commit message (Collapse)AuthorAgeFilesLines
* configure.ac: rule out old Sun C++卜部昌平2020-08-221-0/+14
| | | | | 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.
* protect CFLAGS from being smashed by AC_PROG_CC卜部昌平2020-08-221-0/+6
| | | | | | | | 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.
* configure.ac: try GCC-provided ld卜部昌平2020-08-211-1/+1
| | | | | | | | | | | 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.
* AC_PROG_CXXCPP: remove卜部昌平2020-08-211-1/+0
| | | | Caused CI failures on environments without sane C++ compilers.
* configure.ac: move program_transform_name卜部昌平2020-08-211-14/+13
| | | | | | | | | 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.
* configure.ac: use compiler-provided toolchains卜部昌平2020-08-211-71/+91
| | | | | | | | | 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.
* Share the size for sigaltstack between configure.ac and signal.cNobuyoshi Nakada2020-07-221-2/+3
|
* configure.ac: Bump the size of sigaltstackJake Zimmerman2020-07-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Bail out when unsupported coroutine targetNobuyoshi Nakada2020-07-091-4/+7
|
* Fix build error on Apple silicon macOSWatson2020-07-081-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 ```
* No GITPULLOPTIONS by defaultNobuyoshi Nakada2020-06-041-1/+1
| | | | | To honor the environment variable, keep GITPULLOPTIONS unset by default, and appended the option to VCSUP.
* Check that BASERUBY is at least Ruby 2.2 in configureJeremy Evans2020-05-281-1/+1
| | | | | | | | | | | | | | BASERUBY needs to be at least Ruby 2.2 since 46acd0075d80c2f886498f089fde1e9d795d50c4. 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]
* Allow Dir.home to work for non-login procs when $HOME not setAlan D. Salewski2020-05-231-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Search pkg-config with ac_tool_prefix [Bug #16909]Nobuyoshi Nakada2020-05-231-2/+5
| | | | | Should prefer a prefixed version over the bare pkg-config for cross compiling.
* Revert "Search pkg-config by AC_CHECK_TOOL [Bug #16909]"Nobuyoshi Nakada2020-05-231-1/+1
| | | | | This reverts commit 6006ab8cf93a0e06d9d65213eff3117965c9bd0c. AC_CHECK_TOOL does not have REJECT argument.
* Search pkg-config by AC_CHECK_TOOL [Bug #16909]Nobuyoshi Nakada2020-05-231-1/+1
| | | | | It should use AC_CHECK_TOOL to automatically search for a prefixed version and not just the bare pkg-config.
* BASERUBY have to be 1.9 or later at least [Bug #16845]Nobuyoshi Nakada2020-05-111-5/+3
| | | | Many tools under tool directory haven't worked with ruby 1.8.
* Fallback MAKE to makeNobuyoshi Nakada2020-05-111-1/+1
|
* Pass MAKE value to configure for non-default name caseNobuyoshi Nakada2020-05-111-1/+1
| | | | GNU make does not export it by default.
* Optimize sin/cosNobuyoshi Nakada2020-05-031-0/+2
| | | | | | | | | 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.
* configure.ac: Automatically add -D__ANDROID_API=ver on AndroidYusuke Endoh2020-04-221-0/+24
|
* Don't require sub-word atomicsAndreas Schwab2020-04-111-2/+2
| | | | | | | | | 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.
* configure: suppress SunPro warning卜部昌平2020-04-101-0/+7
| | | | | | | | 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.
* configure: suppress icc warnings卜部昌平2020-04-101-1/+1
| | | | | | | | | | | 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.
* configure: always check for __builtin_unreachable卜部昌平2020-04-101-1/+1
| | | | | Non-gcc compilers tend to have this intrinsic these days (e.g. icc). Better check it regardless of $GCC.
* configure.ac: Skip C++ compiler of Sun OpenStudioYusuke Endoh2020-04-091-0/+5
| | | | | It fails to compile ext/-test-/cxxanyargs/cxxanyargs.cpp. Need work to support it. Contribution is welcome.
* Merge pull request #2991 from shyouhei/ruby.h卜部昌平2020-04-081-3/+10
| | | Split ruby.h
* Use toodir also in configure.acNobuyoshi Nakada2020-04-051-2/+4
|
* Added tooldir variableNobuyoshi Nakada2020-04-051-1/+1
|
* ucontext doesn't exist in a musl-libc env; use native assemblyPaul Jordan2020-04-011-2/+2
|
* Make file names and variable names consistentTakashi Kokubun2020-03-231-3/+3
|
* Moved MJIT_WITHOUT_TABS default to configure.acNobuyoshi Nakada2020-03-241-0/+4
| | | | And then the environment variable.
* Prefer alignas() over _Alignas()Yusuke Endoh2020-02-201-3/+8
| | | | | to allow Intel C++ compiler to read ruby.h. This is similar to 9930481a239fa7182429f3c3942ea033fb9b0320
* support C++ std::nullptr_t卜部昌平2020-01-311-0/+11
| | | | | | | 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.
* avoid undefined behaviour when n==0卜部昌平2020-01-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* modify MJIT_CC only on RUBY_DEBUG=ciKoichi Sasada2020-01-031-1/+2
| | | | Modify MJIT_CC (27fae1d4ad) only on CI environment.
* disable ccache if $CC is in /usr/lib/ccache/$CC.Koichi Sasada2020-01-031-0/+5
| | | | | | | | | | | | | 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.
* Use __func__ as rb_cv_function_name_string on OpenBSDJeremy Evans2019-12-281-9/+12
| | | | | | | | | | | | | | 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.
* add several __has_something macro卜部昌平2019-12-261-0/+2
| | | | | | | 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().
* Allow more than one major version number in target_osMatt Valentine-House2019-12-131-1/+1
|
* support cross-compilation.Koichi Sasada2019-12-111-0/+1
| | | | | | | | 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.
* Fixed the inverted conditionNobuyoshi Nakada2019-12-031-1/+1
|
* Wrap statements in AS_IF properlyNobuyoshi Nakada2019-12-031-1/+2
|
* Disable _FORTIFY_SOURCE on mingw for nowNobuyoshi Nakada2019-12-021-0/+11
| | | | It causes a link error due to some `__*_chk` functions on mingw.
* Improve string literal concatenation for C++11Mark Abraham2019-11-061-2/+2
| | | | | | | | | | 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.
* Check for nonnull attribute in configureNobuyoshi Nakada2019-10-291-0/+5
|
* Revert "Check for nonnull attribute in configure"卜部昌平2019-10-291-5/+0
| | | | | | This reverts commit 54eb51d72bc43f90b595f0d7ffb5069ebf1a56d9. Windows build failure. See also https://github.com/ruby/ruby/runs/278718805
* Check for nonnull attribute in configureNobuyoshi Nakada2019-10-291-0/+5
|
* show BASERUBY version at configure.Koichi Sasada2019-10-201-0/+3
|
* oops卜部昌平2019-09-101-1/+1
| | | | Silly typo.