summaryrefslogtreecommitdiff
path: root/lib/mkmf.rb
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2021-10-03 16:35:10 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2021-10-03 18:23:39 +0900
commitea64e742f5feddbdfb6526cd0a54a9986097a34d (patch)
treea767443410656381a98a744740c1a2ddf47ac817 /lib/mkmf.rb
parentb91b3000bdb4e62fc059de709dbf9eb805c08d70 (diff)
Revert "mkmf.rb: try linking at try_var" [Bug #18235]
This reverts commit 524513be399e81bb170ec88aa0d501f33cbde8c3, which can return false positive by existing but unusable symbol, including functions.
Diffstat (limited to 'lib/mkmf.rb')
-rw-r--r--lib/mkmf.rb10
1 files changed, 1 insertions, 9 deletions
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index cab9a3f646..79dd3f7172 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -821,21 +821,13 @@ SRC
# You should use +have_var+ rather than +try_var+.
def try_var(var, headers = nil, opt = "", &b)
headers = cpp_include(headers)
- try_compile(<<"SRC", opt, &b) or
+ try_compile(<<"SRC", opt, &b)
#{headers}
/*top*/
extern int t(void);
#{MAIN_DOES_NOTHING 't'}
int t(void) { const volatile void *volatile p; p = &(&#{var})[0]; return !p; }
SRC
- try_link(<<"SRC", opt, &b)
-#{headers}
-/*top*/
-extern int t(void);
-#{MAIN_DOES_NOTHING 't'}
-extern int #{var};
-int t(void) { const volatile void *volatile p; p = &(&#{var})[0]; return !p; }
-SRC
end
# Returns whether or not the +src+ can be preprocessed with the C