[前][次][番号順一覧][スレッド一覧]

ruby-changes:59545

From: Jeremy <ko1@a...>
Date: Sun, 29 Dec 2019 07:13:25 +0900 (JST)
Subject: [ruby-changes:59545] a04c535967 (master): Use __func__ as rb_cv_function_name_string on OpenBSD

https://git.ruby-lang.org/ruby.git/commit/?id=a04c535967

From a04c53596735f563a09d628530a2adae7ba26c7a Mon Sep 17 00:00:00 2001
From: Jeremy Evans <code@j...>
Date: Sat, 28 Dec 2019 00:25:11 -0800
Subject: 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.

diff --git a/configure.ac b/configure.ac
index f9e8573..e8d9aa6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1525,15 +1525,18 @@ AC_SUBST(MATHN, $mathn) https://github.com/ruby/ruby/blob/trunk/configure.ac#L1525
 
 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])
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]