diff --git a/ext/sqlite3/extconf.rb b/ext/sqlite3/extconf.rb index 4cf52c17..6c13dfc9 100644 --- a/ext/sqlite3/extconf.rb +++ b/ext/sqlite3/extconf.rb @@ -87,6 +87,13 @@ def configure_packaged_libraries end flags.each { |flag| append_ldflags(flag) } + + # See https://github.com/rake-compiler/rake-compiler-dock/issues/87 for more info. + if cross_build? && + darwin? && + RbConfig::CONFIG["ruby_version"] >= "3.2" + append_ldflags("-Wl,-flat_namespace") + end end end @@ -172,6 +179,10 @@ def download minimal_recipe.download end + def darwin? + RbConfig::CONFIG["target_os"].include?("darwin") + end + def print_help print(<<~TEXT) USAGE: ruby #{$PROGRAM_NAME} [options]