mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
[Bug #19005] dynamic_lookup linker option in external libraries
The warning against `-undefined dynamic_lookup` is just a warning yet, and many gems seem to pay no attention to warnings. Until it fails actually, keep it as a migration path, except for standard extension libraries and bundled extension gems.
This commit is contained in:
parent
9188c5dd6d
commit
99735a8b29
2 changed files with 18 additions and 5 deletions
22
configure.ac
22
configure.ac
|
@ -2773,14 +2773,26 @@ AS_IF([test "$with_dln_a_out" != yes], [
|
|||
AS_IF([test "$rb_cv_dlopen" = yes], [
|
||||
AS_CASE(["$target_os"],
|
||||
[darwin*], [
|
||||
AC_SUBST(ADDITIONAL_DLDFLAGS, "")
|
||||
for flag in \
|
||||
"-multiply_defined suppress" \
|
||||
"-undefined dynamic_lookup" \
|
||||
; do
|
||||
test "x${linker_flag}" = x || flag="${linker_flag}`echo ${flag} | tr ' ' ,`"
|
||||
RUBY_TRY_LDFLAGS([$flag], [], [flag=])
|
||||
AS_IF([test "x$flag" != x], [
|
||||
RUBY_APPEND_OPTIONS(DLDFLAGS, [$flag])
|
||||
])
|
||||
test "x${linker_flag}" = x || flag="${linker_flag}`echo ${flag} | tr ' ' ,`"
|
||||
RUBY_TRY_LDFLAGS([$flag], [], [$flag=])
|
||||
AS_IF([test x"$flag" = x], [continue])
|
||||
|
||||
AC_MSG_CHECKING([whether $flag is accepted for bundle])
|
||||
: > conftest.c
|
||||
AS_IF([${LDSHARED/'$(CC)'/$CC} -o conftest.bundle $flag conftest.c >/dev/null 2>conftest.err &&
|
||||
test ! -s conftest.err], [
|
||||
AC_MSG_RESULT([yes])
|
||||
RUBY_APPEND_OPTIONS(DLDFLAGS, [$flag])
|
||||
], [
|
||||
AC_MSG_RESULT([no])
|
||||
RUBY_APPEND_OPTIONS(ADDITIONAL_DLDFLAGS, [$flag])
|
||||
])
|
||||
rm -fr conftest.*
|
||||
done
|
||||
])
|
||||
])
|
||||
|
|
|
@ -2557,6 +2557,7 @@ site-install-rb: install-rb
|
|||
$INCFLAGS << " -I$(hdrdir)/ruby/backward" unless $extmk
|
||||
$INCFLAGS << " -I$(hdrdir) -I$(srcdir)"
|
||||
$DLDFLAGS = with_config("dldflags", arg_config("DLDFLAGS", config["DLDFLAGS"])).dup
|
||||
config_string("ADDITIONAL_DLDFLAGS") {|flags| $DLDFLAGS << " " << flags} unless $extmk
|
||||
$LIBEXT = config['LIBEXT'].dup
|
||||
$OBJEXT = config["OBJEXT"].dup
|
||||
$EXEEXT = config["EXEEXT"].dup
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue