Skip to content

Commit

Permalink
Revert "darwin: resolve rb symbols from ext by -flat_namespace to s…
Browse files Browse the repository at this point in the history
…ee libruby transitively"

This reverts commit c5eefb7.

Flat namespace breaks gems with C extention if its symbols conflict
with ohter libraries.
  • Loading branch information
nurse committed Dec 24, 2022
1 parent b9332ac commit 3fb1d49
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions configure.ac
Expand Up @@ -3053,9 +3053,14 @@ AC_SUBST(EXTOBJS)
: ${LDFLAGS=""}
: ${LIBPATHENV=DYLD_FALLBACK_LIBRARY_PATH}
: ${PRELOADENV=DYLD_INSERT_LIBRARIES}
# When building exts as bundles, a mach-o bundle needs to know its loader
# program to bind symbols from the ruby executable
EXTDLDFLAGS="-bundle_loader '\$(BUILTRUBY)' -Wl,-flat_namespace"
AS_IF([test x"$enable_shared" = xyes], [
# Resolve symbols from libruby.dylib when --enable-shared
EXTDLDFLAGS='$(LIBRUBYARG_SHARED)'
], [test "x$EXTSTATIC" = x], [
# When building exts as bundles, a mach-o bundle needs to know its loader
# program to bind symbols from the ruby executable
EXTDLDFLAGS="-bundle_loader '\$(BUILTRUBY)'"
])
rb_cv_dlopen=yes],
[aix*], [ : ${LDSHARED='$(CC)'}
AS_IF([test "$GCC" = yes], [
Expand Down Expand Up @@ -3349,7 +3354,7 @@ AS_IF([test x"$cross_compiling" = xyes], [
AC_SUBST(XRUBY_RUBYLIBDIR)
AC_SUBST(XRUBY_RUBYHDRDIR)
PREP='$(arch)-fake.rb'
AS_CASE(["$target_os"], [darwin*], [
AS_CASE(["$enable_shared:$EXTSTATIC:$target_os"], [no::darwin*], [
# darwin target requires miniruby for linking ext bundles
PREP="$PREP"' miniruby$(EXEEXT)'
])
Expand Down

0 comments on commit 3fb1d49

Please sign in to comment.