| 1 |
--- a/src/ruby/ext/grpc/extconf.rb |
| 2 |
+++ b/src/ruby/ext/grpc/extconf.rb |
| 3 |
@@ -96,22 +96,6 @@ output_dir = File.expand_path(RbConfig:: |
| 4 |
grpc_lib_dir = File.join(output_dir, 'libs', grpc_config) |
| 5 |
ENV['BUILDDIR'] = output_dir |
| 6 |
|
| 7 |
-unless windows |
| 8 |
- puts 'Building internal gRPC into ' + grpc_lib_dir |
| 9 |
- nproc = 4 |
| 10 |
- nproc = Etc.nprocessors if Etc.respond_to? :nprocessors |
| 11 |
- nproc_override = ENV['GRPC_RUBY_BUILD_PROCS'] |
| 12 |
- unless nproc_override.nil? or nproc_override.size == 0 |
| 13 |
- nproc = nproc_override |
| 14 |
- puts "Overriding make parallelism to #{nproc}" |
| 15 |
- end |
| 16 |
- make = bsd ? 'gmake' : 'make' |
| 17 |
- cmd = "#{make} -j#{nproc} -C #{grpc_root} #{grpc_lib_dir}/libgrpc.a CONFIG=#{grpc_config} Q=" |
| 18 |
- puts "Building grpc native library: #{cmd}" |
| 19 |
- system(cmd) |
| 20 |
- exit 1 unless $? == 0 |
| 21 |
-end |
| 22 |
- |
| 23 |
$CFLAGS << ' -DGRPC_RUBY_WINDOWS_UCRT' if windows_ucrt |
| 24 |
$CFLAGS << ' -I' + File.join(grpc_root, 'include') |
| 25 |
|
| 26 |
@@ -120,7 +104,7 @@ ext_export_file += '-truffleruby' if RUB |
| 27 |
$LDFLAGS << ' -Wl,--version-script="' + ext_export_file + '.gcc"' if linux |
| 28 |
$LDFLAGS << ' -Wl,-exported_symbols_list,"' + ext_export_file + '.clang"' if apple_toolchain |
| 29 |
|
| 30 |
-$LDFLAGS << ' ' + File.join(grpc_lib_dir, 'libgrpc.a') unless windows |
| 31 |
+$LDFLAGS << ' ' + '-Wl,-wrap,memcpy -lgrpc' unless windows |
| 32 |
if grpc_config == 'gcov' |
| 33 |
$CFLAGS << ' -O0 -fprofile-arcs -ftest-coverage' |
| 34 |
$LDFLAGS << ' -fprofile-arcs -ftest-coverage -rdynamic' |