aboutsummaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2019-12-28 00:25:11 -0800
committerJeremy Evans <code@jeremyevans.net>2019-12-28 14:13:05 -0800
commita04c53596735f563a09d628530a2adae7ba26c7a (patch)
tree635c1db4c7ae9f4828cdd944d442fe45c2d76e9c /configure.ac
parentbb5b8ace8d7e517ac3686497a819a2a52d32b342 (diff)
downloadruby-a04c53596735f563a09d628530a2adae7ba26c7a.tar.gz
Use __func__ as rb_cv_function_name_string on OpenBSD
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.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac21
1 files changed, 12 insertions, 9 deletions
diff --git a/configure.ac b/configure.ac
index f9e8573d45..e8d9aa6d5e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1525,15 +1525,18 @@ AC_SUBST(MATHN, $mathn)
AC_CACHE_CHECK(for function name string predefined identifier,
rb_cv_function_name_string,
- [rb_cv_function_name_string=no
- RUBY_WERROR_FLAG([
- for func in __func__ __FUNCTION__; do
- AC_TRY_LINK([@%:@include <stdio.h>],
- [puts($func);],
- [rb_cv_function_name_string=$func
- break])
- done
- ])]
+ [AS_CASE(["$target_os"],[openbsd*],[
+ rb_cv_function_name_string=__func__
+ ],[
+ rb_cv_function_name_string=no
+ RUBY_WERROR_FLAG([
+ for func in __func__ __FUNCTION__; do
+ AC_TRY_LINK([@%:@include <stdio.h>],
+ [puts($func);],
+ [rb_cv_function_name_string=$func
+ break])
+ done
+ ])])]
)
AS_IF([test "$rb_cv_function_name_string" != no], [
AC_DEFINE_UNQUOTED(RUBY_FUNCTION_NAME_STRING, [$rb_cv_function_name_string])