From bb38539479e126ef641746bd5262fc8b248a829f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Chris=20Hasi=C5=84ski?= Date: Tue, 17 Feb 2026 10:44:43 +0100 Subject: [PATCH] Hide Go runtime symbols to allow coexistence with other Charm gems --- ext/bubblezone/extconf.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ext/bubblezone/extconf.rb b/ext/bubblezone/extconf.rb index 525ef52..a7e9125 100644 --- a/ext/bubblezone/extconf.rb +++ b/ext/bubblezone/extconf.rb @@ -42,16 +42,20 @@ def detect_platform ERROR end +go_lib_path = File.join(go_lib_dir, "libbubblezone.a") + $LDFLAGS << " -L#{go_lib_dir}" $INCFLAGS << " -I#{go_lib_dir}" -$LOCAL_LIBS << " #{go_lib_dir}/libbubblezone.a" - case RbConfig::CONFIG["host_os"] when /darwin/ + $LDFLAGS << " -Wl,-load_hidden,#{go_lib_path}" + $LDFLAGS << " -Wl,-exported_symbol,_Init_bubblezone" $LDFLAGS << " -framework CoreFoundation -framework Security -framework SystemConfiguration" $LDFLAGS << " -lresolv" when /linux/ + $LOCAL_LIBS << " #{go_lib_path}" + $LDFLAGS << " -Wl,--exclude-libs,ALL" $LDFLAGS << " -lpthread -lm -ldl" $LDFLAGS << " -lresolv" if find_library("resolv", "res_query") end