Hide ruby native extension symbols on FreeBSD

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.
pull/10832/head
Dan McGregor 2 years ago committed by Dan McGregor
parent 240986d66d
commit 4cb59f2691
  1. 2
      ruby/ext/google/protobuf_c/extconf.rb

@ -6,7 +6,7 @@ ext_name = "google/protobuf_c"
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"

Loading…
Cancel
Save