From 2a73e3bdfbad01be6b88c5cfaa84f5cfcb072126 Mon Sep 17 00:00:00 2001 From: dankm Date: Wed, 23 Nov 2022 09:32:03 -0800 Subject: [PATCH] Hide ruby native extension symbols on FreeBSD (#10832) They probably should be hidden on every ELF platform, but for now only do it on Darwin, Linux, and FreeBSD. This prevents some load-time errors that have been seen in GitLab's gitaly server, and in a few other places. Closes #10832 COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/10832 from dankm:hide-symbols 4cb59f26912813ba78d69cc37c00f52718ff546f PiperOrigin-RevId: 490522474 --- ruby/ext/google/protobuf_c/extconf.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ruby/ext/google/protobuf_c/extconf.rb b/ruby/ext/google/protobuf_c/extconf.rb index 5cc45337b8044..38bb8c970ae1b 100755 --- a/ruby/ext/google/protobuf_c/extconf.rb +++ b/ruby/ext/google/protobuf_c/extconf.rb @@ -6,7 +6,7 @@ dir_config(ext_name) -if RUBY_PLATFORM =~ /darwin/ || RUBY_PLATFORM =~ /linux/ +if RUBY_PLATFORM =~ /darwin/ || RUBY_PLATFORM =~ /linux/ || RUBY_PLATFORM =~ /freebsd/ $CFLAGS += " -std=gnu99 -O3 -DNDEBUG -fvisibility=hidden -Wall -Wsign-compare -Wno-declaration-after-statement" else $CFLAGS += " -std=gnu99 -O3 -DNDEBUG"