Work around XCode 14 issue with some native gems
What does this Merge Request do and why?
XCode 14 causes the Ruby interpreter to drop the
-Wl,-undefined,dynamic_lookup
flags in the DLDFLAGS
, which are
passed in the final step to link a shared library of a native gems.
While this flag is still supported, the following warning causes the
configure
step to omit these flags:
ld: warning: -undefined dynamic_lookup may not work with chained fixups
This breaks some native gems, such as pg_query
, thrift
, and
ffi-yajl
, which can no longer find the symbols they need:
linking shared-object pg_query/pg_query.bundle
Undefined symbols for architecture arm64:
"Init_pg_query", referenced from:
-exported_symbol[s_list] command line option
(maybe you meant: _Init_pg_query)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Until https://bugs.ruby-lang.org/issues/19005 is resolved, restore these flags so that macOS users with XCode 14 can continue to function.
A reinstall of the Ruby interpreter is necessary to ensure
RbConfig::CONFIG['DLDFLAGS']
contains these flags.
Merge Request checklist
-
This change is backward compatible. If not, please include steps to communicate to our users. -
Tests added for new functionality. If not, please raise Issue to follow-up. -
Documentation added/updated, if needed. -
gdk doctor
test added, if needed. -
Add the ~highlight
label if this MR should be included in theCHANGELOG.md
.
Edited by Stan Hu