aboutsummaryrefslogtreecommitdiffhomepage
path: root/ruby/ext/google/protobuf_c/extconf.rb
diff options
context:
space:
mode:
Diffstat (limited to 'ruby/ext/google/protobuf_c/extconf.rb')
-rw-r--r--ruby/ext/google/protobuf_c/extconf.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/ruby/ext/google/protobuf_c/extconf.rb b/ruby/ext/google/protobuf_c/extconf.rb
index b368dcc6..0886e607 100644
--- a/ruby/ext/google/protobuf_c/extconf.rb
+++ b/ruby/ext/google/protobuf_c/extconf.rb
@@ -4,7 +4,14 @@ require 'mkmf'
$CFLAGS += " -std=c99 -O3 -DNDEBUG"
+
+if RUBY_PLATFORM =~ /linux/
+ # Instruct the linker to point memcpy calls at our __wrap_memcpy wrapper.
+ $LDFLAGS += " -Wl,-wrap,memcpy"
+end
+
$objs = ["protobuf.o", "defs.o", "storage.o", "message.o",
- "repeated_field.o", "map.o", "encode_decode.o", "upb.o"]
+ "repeated_field.o", "map.o", "encode_decode.o", "upb.o",
+ "wrap_memcpy.o"]
create_makefile("google/protobuf_c")