Skip to content

Commit

Permalink
Hide ruby native extension symbols on FreeBSD
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dankm committed Oct 27, 2022
1 parent 240986d commit 4cb59f2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ruby/ext/google/protobuf_c/extconf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 4cb59f2

Please sign in to comment.