user/dotnet8-stage0: enable mono #319
8 changed files with 113 additions and 183 deletions
|
@ -1,16 +1,12 @@
|
|||
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
|
||||
# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
|
||||
# Contributor: Keith Maxwell <keith.maxwell@gmail.com>
|
||||
# Contributor: wener <wenermail@gmail.com>
|
||||
|
||||
# Maintainer: wener <wenermail@gmail.com>
|
||||
pkgname=grpc
|
||||
# This version is used in gitlab-foss 15.2.2.
|
||||
pkgver=1.42.0
|
||||
pkgrel=3
|
||||
pkgver=1.58.0
|
||||
pkgrel=0
|
||||
pkgdesc="The C based gRPC"
|
||||
url="https://grpc.io/"
|
||||
# will fix later
|
||||
#arch="all"
|
||||
arch="all"
|
||||
# BSD-3-Clause: third_party/upb, third_party/address_sorting
|
||||
# MIT: third_party/upb/third_party/utf8_range
|
||||
license="Apache-2.0 AND BSD-3-Clause AND MIT"
|
||||
|
@ -24,23 +20,22 @@ _pythondepends="
|
|||
python3-dev
|
||||
py3-setuptools
|
||||
"
|
||||
# XXX: should also depend on ruby-google-protobuf=3.18
|
||||
_rubydepends="
|
||||
$pkgname=$pkgver-r$pkgrel
|
||||
ruby3.0-etc
|
||||
ruby3.0-google-protobuf>=3.19
|
||||
"
|
||||
makedepends="
|
||||
abseil-cpp
|
||||
abseil-cpp-dev
|
||||
autoconf
|
||||
automake
|
||||
benchmark-dev
|
||||
c-ares-dev
|
||||
chrpath
|
||||
cmake
|
||||
libstdc++
|
||||
libtool
|
||||
linux-headers
|
||||
openssl-dev
|
||||
openssl-dev>3
|
||||
protobuf-dev
|
||||
re2-dev
|
||||
ruby3.0-dev
|
||||
|
@ -57,22 +52,29 @@ subpackages="
|
|||
$pkgname-cpp
|
||||
$pkgname-plugins
|
||||
$pkgname-doc
|
||||
py3-grpcio-pyc
|
||||
py3-grpcio:grpcio
|
||||
ruby3.0-grpc:_ruby
|
||||
libaddress_sorting:lib
|
||||
libgpr:lib
|
||||
libgrpc:lib
|
||||
libgrpc_authorization_provider:lib
|
||||
libgrpc_unsecure:lib
|
||||
libupb:lib
|
||||
"
|
||||
_googletest_rev=0e402173c97aea7a00749e825b194bfede4f2e45
|
||||
|
||||
# ruby-dont-strip-library.patch: abuild will dot the strip
|
||||
source="https://github.com/grpc/grpc/archive/v$pkgver/grpc-v$pkgver.tar.gz
|
||||
googletest-$_googletest_rev.tar.gz::https://github.com/google/googletest/archive/$_googletest_rev.tar.gz
|
||||
fix-compiler-error.patch
|
||||
minimal-fix-for-invalid-implicit-absl-string_view-nu.patch
|
||||
01-chttp2-maybe-uninitialized.patch
|
||||
ruby-use-shared-libs.patch
|
||||
ruby-dont-strip-library.patch
|
||||
find-dependency.patch
|
||||
ruby-fix-protoc-path.patch
|
||||
ruby-use-shared-libs.patch
|
||||
ruby-use-system-certs.patch
|
||||
makefile-use-system-abseil.patch
|
||||
makefile-add-wrap-memcpy-flags.patch
|
||||
"
|
||||
options="!check" # sometimes hang indefinitely on builders
|
||||
options="net !check" # sometimes hang indefinitely on builders
|
||||
|
||||
prepare() {
|
||||
rm -r third_party/googletest
|
||||
|
@ -109,11 +111,11 @@ prepare() {
|
|||
}
|
||||
|
||||
build() {
|
||||
cmake -B _build \
|
||||
-DCMAKE_BUILD_TYPE=MinSizeRel \
|
||||
export CFLAGS="$CFLAGS -flto=auto -DNDEBUG -O2"
|
||||
export CXXFLAGS="$CXXFLAGS -flto=auto -DNDEBUG -O2"
|
||||
cmake -B _build -G Ninja \
|
||||
-DCMAKE_BUILD_TYPE=None \
|
||||
-DCMAKE_INSTALL_PREFIX=/usr \
|
||||
-DCMAKE_CXX_FLAGS="$CXXFLAGS -w" \
|
||||
-DCMAKE_C_FLAGS="$CFLAGS -w" \
|
||||
-DCMAKE_CXX_STANDARD=17 \
|
||||
-DBUILD_SHARED_LIBS=True \
|
||||
-DgRPC_INSTALL=ON \
|
||||
|
@ -122,25 +124,24 @@ build() {
|
|||
-DgRPC_SSL_PROVIDER=package \
|
||||
-DgRPC_ZLIB_PROVIDER=package \
|
||||
-DgRPC_ABSL_PROVIDER=package \
|
||||
-DgRPC_BENCHMARK_PROVIDER=package \
|
||||
-DgRPC_RE2_PROVIDER=package \
|
||||
-DgRPC_BACKWARDS_COMPATIBILITY_MODE=OFF \
|
||||
-DgRPC_BUILD_TESTS="$(want_check && echo ON || echo OFF)" \
|
||||
-G Ninja
|
||||
-DgRPC_BUILD_TESTS="$(want_check && echo ON || echo OFF)"
|
||||
cmake --build _build
|
||||
|
||||
# XXX: Fails to build and I don't need it here, so screw it.
|
||||
#GRPC_PYTHON_CFLAGS="-std=c++17" \
|
||||
#GRPC_PYTHON_DISABLE_LIBC_COMPATIBILITY=1 \
|
||||
#GRPC_PYTHON_BUILD_SYSTEM_CARES=1 \
|
||||
#GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=1 \
|
||||
#GRPC_PYTHON_BUILD_SYSTEM_ZLIB=1 \
|
||||
#GRPC_PYTHON_BUILD_SYSTEM_RE2=1 \
|
||||
#GRPC_PYTHON_BUILD_SYSTEM_ABSL=1 \
|
||||
#python3 setup.py build
|
||||
GRPC_PYTHON_CFLAGS="-std=c++17" \
|
||||
GRPC_PYTHON_DISABLE_LIBC_COMPATIBILITY=1 \
|
||||
GRPC_PYTHON_BUILD_SYSTEM_CARES=1 \
|
||||
GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=1 \
|
||||
GRPC_PYTHON_BUILD_SYSTEM_ZLIB=1 \
|
||||
GRPC_PYTHON_BUILD_SYSTEM_RE2=1 \
|
||||
GRPC_PYTHON_BUILD_SYSTEM_ABSL=1 \
|
||||
python3 setup.py build
|
||||
|
||||
# grpcio-tools
|
||||
#cd tools/distrib/python
|
||||
#python3 make_grpcio_tools.py
|
||||
cd tools/distrib/python
|
||||
python3 make_grpcio_tools.py
|
||||
|
||||
cd "$builddir"
|
||||
gem build grpc.gemspec
|
||||
|
@ -174,6 +175,7 @@ check() {
|
|||
|
||||
package() {
|
||||
DESTDIR="$pkgdir" cmake --install _build
|
||||
python3 setup.py install --skip-build --root="$pkgdir"
|
||||
|
||||
cd doc
|
||||
find ./ -type f -print -exec install -Dm644 {} "$pkgdir"/usr/share/doc/grpc/{} \;
|
||||
|
@ -213,8 +215,8 @@ cli() {
|
|||
grpcio() {
|
||||
pkgdesc="gRPC Python HTTP/2-based RPC framework"
|
||||
depends="py3-six"
|
||||
cd "$builddir"
|
||||
python3 setup.py install --skip-build --prefix=/usr --root="$subpkgdir"
|
||||
|
||||
amove usr/lib/python3*
|
||||
}
|
||||
|
||||
_ruby() {
|
||||
|
@ -250,16 +252,20 @@ _ruby() {
|
|||
spec/
|
||||
}
|
||||
|
||||
lib() {
|
||||
pkgdesc="$pkgdesc ($subpkgname library)"
|
||||
depends="$pkgname=$pkgver-r$pkgrel"
|
||||
|
||||
amove usr/lib/$subpkgname.so.*
|
||||
}
|
||||
|
||||
sha512sums="
|
||||
39f37a41d1df6015dc36344f1b5e634be7f0edbc99723de73de8b81cdab6aa3e09cef6b3c6c9ecb2c9c9db9b8454474b2ac7fbe49fe23d17a6c78f999b459ce5 grpc-v1.42.0.tar.gz
|
||||
fb2fd211a22dd777cf4df39a9dd72e5c8014f1546a89d3910b006503aac80a74d5797705e02911e9c07316ed973f71110b94cc0e86225f648d4ff91773748a43 grpc-v1.58.0.tar.gz
|
||||
5c5eaf6ff9f3c1bca025b7ef0234ba97232ba85b43e6354a92f49b7208f5c47581ebaf18bf58618498e5d264f2620c2b6676e81bb0f7df77112b96ba271ececf googletest-0e402173c97aea7a00749e825b194bfede4f2e45.tar.gz
|
||||
ce7b72169b22e6e92f31b74cacf6edf6395aeb7c70fd42d7e9eaa188395b4e6e4b3acad5edfbe75c8304b049049cee76ce5ceaaeed824bffb7defc103ef23580 fix-compiler-error.patch
|
||||
95a88beb681616a9d793c3118c8e25473d9a8cb29733db38edc8b7af205ffea964dc27dc48d268f735f27fee84782be3eda0b7f398c2e568116e679febe563b7 minimal-fix-for-invalid-implicit-absl-string_view-nu.patch
|
||||
7fa146ce86ddd4f160bb1ca9ff01cb7aca6b2b8c9aa50e4fa6b84504b9117b104be0d1e31ccb452d846549dfe1e9012ceccfcdc1f2357ed567621d71fb8b08c5 01-chttp2-maybe-uninitialized.patch
|
||||
0bf65cca05b6d41c8259a5a59573e16a3f40913aa1c1a185b7dcd295d4ae7f1cedbbd465fcff33d6f8d8ee8735a77f744708a097a32a4598b9bfc4ecaf9414df ruby-use-shared-libs.patch
|
||||
0a2560d22df71abbeea33a37f0cb42a811b244af25284d7fb564cb8ea0b944d23acf6601413bdb2613bcb87011340334489f1b40ab2f9024db013adde0d094e8 ruby-dont-strip-library.patch
|
||||
6702e39c6a3c065fe4ff5ae48898057135c09bf6851e35fc958cf95ee5d77e9dd34e8c34d978efe60682384e46c4c4b2e51156d546b06a0eb1feed89adcc024b find-dependency.patch
|
||||
4ea72d2acd8bee9c9022a4412aa0af0477faca7b0810d14decb3ad5d4da044247f51189512323bfee855b9b260a7f82b812310391451e5d8ee718297800d7a73 ruby-fix-protoc-path.patch
|
||||
7123bf1bbc48ceb303ce1e9820ea45a06dabd25e20e3c1c116ef68e629e80f229cf20314c415d74f0c5c1725f23a00b446656e0cffba3dcd3cc766ae29d8fb2f ruby-use-shared-libs.patch
|
||||
631af4b9ac29c1ebabb2c88394ea2993e36cec1beda38195e1587dbd9d3c8c9eef75a17d2326d3cd2e682de551401216075ba08fdc501c098b8092d718ded381 ruby-use-system-certs.patch
|
||||
3c7e8e9a6c6009278569dccdf3e79fabdb266336b894a7fe65f2a57d3cfbef72364c331ec46d9e3a05bb0deaeb841194a39d6f77d98f9e9ce609de0636f675bd makefile-use-system-abseil.patch
|
||||
66b709cd1fb291ab140ec87e584db13d15c308c0ea9f2ee0fa10ddb00cf33641f559235b1445137ff071dfbda9d7279bd482411fbf2f33dacbc5b14cd7f9ffa5 makefile-add-wrap-memcpy-flags.patch
|
||||
89e260934da83eb45fa6b73884cba1b1c30f99c0eb883a726e2d36ee4788246f4c6fa1b201077038af956bcb58e625f83bedba4f186c711785ec240373ce4fc5 makefile-use-system-abseil.patch
|
||||
"
|
||||
|
|
13
user/grpc/find-dependency.patch
Normal file
13
user/grpc/find-dependency.patch
Normal file
|
@ -0,0 +1,13 @@
|
|||
without this find_dependency() doesn't exist
|
||||
--
|
||||
diff --git a/cmake/gRPCConfig.cmake.in b/cmake/gRPCConfig.cmake.in
|
||||
index 98d8c6d..5500ca2 100644
|
||||
--- a/cmake/gRPCConfig.cmake.in
|
||||
+++ b/cmake/gRPCConfig.cmake.in
|
||||
@@ -1,5 +1,6 @@
|
||||
# Module path
|
||||
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/modules)
|
||||
+include(CMakeFindDependencyMacro)
|
||||
|
||||
# Depend packages
|
||||
@_gRPC_FIND_ZLIB@
|
|
@ -1,23 +0,0 @@
|
|||
Patch-Source: https://github.com/grpc/grpc/pull/28196
|
||||
--
|
||||
From 3991a4c0bcf57e5058a93c4c8255cc80cd0482ca Mon Sep 17 00:00:00 2001
|
||||
From: Runming Wu <runmingwu@gmail.com>
|
||||
Date: Tue, 23 Nov 2021 12:10:43 -0800
|
||||
Subject: [PATCH] Fix compiler error for certain gcc version.
|
||||
|
||||
---
|
||||
src/core/ext/xds/xds_api.h | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/src/core/ext/xds/xds_api.h b/src/core/ext/xds/xds_api.h
|
||||
index 643febdf2203..f25a21f8f831 100644
|
||||
--- a/src/core/ext/xds/xds_api.h
|
||||
+++ b/src/core/ext/xds/xds_api.h
|
||||
@@ -55,6 +55,7 @@ class XdsApi {
|
||||
static const char* kEdsTypeUrl;
|
||||
|
||||
struct Duration {
|
||||
+ Duration() {}
|
||||
int64_t seconds = 0;
|
||||
int32_t nanos = 0;
|
||||
bool operator==(const Duration& other) const {
|
|
@ -1,15 +0,0 @@
|
|||
diff --git a/Makefile b/Makefile
|
||||
index 6c9f22d..6f21708 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -1672,7 +1672,7 @@ $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE): $(LIBGRPC_
|
||||
ifeq ($(SYSTEM),Darwin)
|
||||
$(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libaddress_sorting.a $(OPENSSL_MERGE_LIBS) $(LDLIBS_SECURE) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(RE2_MERGE_LIBS) $(UPB_MERGE_LIBS) $(GRPC_ABSEIL_MERGE_LIBS) $(LDLIBS)
|
||||
else
|
||||
- $(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc.so.20 -o $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libaddress_sorting.a $(OPENSSL_MERGE_LIBS) $(LDLIBS_SECURE) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(RE2_MERGE_LIBS) $(UPB_MERGE_LIBS) $(GRPC_ABSEIL_MERGE_LIBS) $(LDLIBS)
|
||||
+ $(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc.so.20 -Wl,-wrap,memcpy -o $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libaddress_sorting.a $(OPENSSL_MERGE_LIBS) $(LDLIBS_SECURE) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(RE2_MERGE_LIBS) $(UPB_MERGE_LIBS) $(GRPC_ABSEIL_MERGE_LIBS) $(LDLIBS)
|
||||
$(Q) ln -sf $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).so.20
|
||||
$(Q) ln -sf $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).so
|
||||
endif
|
||||
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -576,8 +576,8 @@
|
||||
@@ -575,8 +575,8 @@
|
||||
|
||||
# Setup abseil dependency
|
||||
|
||||
|
@ -8,15 +8,15 @@
|
|||
-GRPC_ABSEIL_MERGE_LIBS = $(LIBDIR)/$(CONFIG)/libgrpc_abseil.a
|
||||
+GRPC_ABSEIL_DEP = -labsl_base -labsl_int128 -labsl_strings -labsl_time -labsl_bad_optional_access -labsl_throw_delegate -labsl_str_format_internal
|
||||
+GRPC_ABSEIL_MERGE_LIBS = -labsl_base -labsl_int128 -labsl_strings -labsl_time -labsl_bad_optional_access -labsl_throw_delegate -labsl_str_format_internal
|
||||
ifeq ($(HOST_IS_X86_64),true)
|
||||
ABSL_RANDOM_HWAES_FLAGS = -maes
|
||||
else
|
||||
@@ -2675,7 +2675,7 @@
|
||||
|
||||
# Setup re2 dependency
|
||||
|
||||
@@ -2809,7 +2809,7 @@
|
||||
third_party/abseil-cpp/absl/types/bad_variant_access.cc \
|
||||
|
||||
|
||||
-LIBGRPC_ABSEIL_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(LIBGRPC_ABSEIL_SRC))))
|
||||
+LIBGRPC_ABSEIL_OBJS =
|
||||
|
||||
$(LIBGRPC_ABSEIL_OBJS): CPPFLAGS += -g $(ABSL_RANDOM_HWAES_FLAGS) -Ithird_party/abseil-cpp
|
||||
$(LIBGRPC_ABSEIL_OBJS): CPPFLAGS += -g -Ithird_party/abseil-cpp
|
||||
|
||||
|
|
|
@ -1,45 +0,0 @@
|
|||
Patch-Source: https://src.fedoraproject.org/rpms/grpc/blob/f36/f/0001-Minimal-fix-for-invalid-implicit-absl-string_view-nu.patch
|
||||
--
|
||||
From 39d8f1440941ab56fe4bfa45ce4bd6177165f919 Mon Sep 17 00:00:00 2001
|
||||
From: "Benjamin A. Beasley" <code@musicinmybrain.net>
|
||||
Date: Sun, 16 Jan 2022 09:47:21 -0500
|
||||
Subject: [PATCH] Minimal fix for invalid implicit absl::string_view(nullptr_t)
|
||||
|
||||
---
|
||||
.../client_channel/lb_policy/xds/xds_cluster_resolver.cc | 2 +-
|
||||
test/core/security/evaluate_args_test.cc | 6 +++---
|
||||
2 files changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc b/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc
|
||||
index ff936b9100..a55d811527 100644
|
||||
--- a/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc
|
||||
+++ b/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc
|
||||
@@ -139,7 +139,7 @@ class XdsClusterResolverLb : public LoadBalancingPolicy {
|
||||
// to use for LRS load reporting. Caller must ensure that config_ is set
|
||||
// before calling.
|
||||
std::pair<absl::string_view, absl::string_view> GetLrsClusterKey() const {
|
||||
- if (!parent_->is_xds_uri_) return {parent_->server_name_, nullptr};
|
||||
+ if (!parent_->is_xds_uri_) return {parent_->server_name_, absl::string_view()};
|
||||
return {
|
||||
parent_->config_->discovery_mechanisms()[index_].cluster_name,
|
||||
parent_->config_->discovery_mechanisms()[index_].eds_service_name};
|
||||
diff --git a/test/core/security/evaluate_args_test.cc b/test/core/security/evaluate_args_test.cc
|
||||
index a8df9b3003..82fc26cd9d 100644
|
||||
--- a/test/core/security/evaluate_args_test.cc
|
||||
+++ b/test/core/security/evaluate_args_test.cc
|
||||
@@ -32,9 +32,9 @@ class EvaluateArgsTest : public ::testing::Test {
|
||||
|
||||
TEST_F(EvaluateArgsTest, EmptyMetadata) {
|
||||
EvaluateArgs args = util_.MakeEvaluateArgs();
|
||||
- EXPECT_EQ(args.GetPath(), nullptr);
|
||||
- EXPECT_EQ(args.GetMethod(), nullptr);
|
||||
- EXPECT_EQ(args.GetHost(), nullptr);
|
||||
+ EXPECT_EQ(args.GetPath(), std::string_view());
|
||||
+ EXPECT_EQ(args.GetMethod(), std::string_view());
|
||||
+ EXPECT_EQ(args.GetHost(), std::string_view());
|
||||
EXPECT_THAT(args.GetHeaders(), ::testing::ElementsAre());
|
||||
EXPECT_EQ(args.GetHeaderValue("some_key", nullptr), absl::nullopt);
|
||||
}
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
From: Jakub Jirutka <jakub@jirutka.cz>
|
||||
Date: Wed, 24 Aug 2022 21:20:22 +0200
|
||||
Subject: [PATCH] Don't strip the built library
|
||||
|
||||
abuild does it.
|
||||
|
||||
--- a/src/ruby/ext/grpc/extconf.rb
|
||||
+++ b/src/ruby/ext/grpc/extconf.rb
|
||||
@@ -94,21 +94,3 @@
|
||||
output = File.join('grpc', 'grpc_c')
|
||||
puts 'Generating Makefile for ' + output
|
||||
create_makefile(output)
|
||||
-
|
||||
-strip_tool = RbConfig::CONFIG['STRIP']
|
||||
-strip_tool += ' -x' if darwin
|
||||
-
|
||||
-if grpc_config == 'opt'
|
||||
- File.open('Makefile.new', 'w') do |o|
|
||||
- o.puts 'hijack: all strip'
|
||||
- o.puts
|
||||
- File.foreach('Makefile') do |i|
|
||||
- o.puts i
|
||||
- end
|
||||
- o.puts
|
||||
- o.puts 'strip: $(DLLIB)'
|
||||
- o.puts "\t$(ECHO) Stripping $(DLLIB)"
|
||||
- o.puts "\t$(Q) #{strip_tool} $(DLLIB)"
|
||||
- end
|
||||
- File.rename('Makefile.new', 'Makefile')
|
||||
-end
|
|
@ -6,52 +6,76 @@ Subject: [PATCH] Link with shared libraries, don't embed anything
|
|||
- Don't build and statically link libgrpc, link shared libgrpc.
|
||||
- Don't statically link libgcc and libstdc++.
|
||||
|
||||
diff --git a/src/ruby/ext/grpc/extconf.rb b/src/ruby/ext/grpc/extconf.rb
|
||||
index 98a8876..808ecfe 100644
|
||||
--- a/src/ruby/ext/grpc/extconf.rb
|
||||
+++ b/src/ruby/ext/grpc/extconf.rb
|
||||
@@ -45,9 +45,9 @@
|
||||
ENV['ARFLAGS'] = '-o'
|
||||
@@ -69,11 +69,11 @@ if apple_toolchain && !cross_compiling
|
||||
end
|
||||
|
||||
-ENV['EMBED_OPENSSL'] = 'true'
|
||||
-ENV['EMBED_ZLIB'] = 'true'
|
||||
-ENV['EMBED_CARES'] = 'true'
|
||||
# Don't embed on TruffleRuby (constant-time crypto is unsafe with Sulong, slow build times)
|
||||
-ENV['EMBED_OPENSSL'] = (RUBY_ENGINE != 'truffleruby').to_s
|
||||
+ENV['EMBED_OPENSSL'] = 'false'
|
||||
# Don't embed on TruffleRuby (the system zlib is already linked for the zlib C extension, slow build times)
|
||||
-ENV['EMBED_ZLIB'] = (RUBY_ENGINE != 'truffleruby').to_s
|
||||
+ENV['EMBED_ZLIB'] = 'false'
|
||||
|
||||
-ENV['EMBED_CARES'] = 'true'
|
||||
+ENV['EMBED_CARES'] = 'false'
|
||||
|
||||
ENV['ARCH_FLAGS'] = RbConfig::CONFIG['ARCH_FLAG']
|
||||
if darwin && !cross_compiling
|
||||
@@ -65,23 +65,15 @@
|
||||
output_dir = File.expand_path(RbConfig::CONFIG['topdir'])
|
||||
grpc_lib_dir = File.join(output_dir, 'libs', grpc_config)
|
||||
ENV['BUILDDIR'] = output_dir
|
||||
+$LDFLAGS << ' -L' + ENV.fetch('TOPDIR', '.')
|
||||
if apple_toolchain && !cross_compiling
|
||||
@@ -97,32 +97,7 @@
|
||||
strip_tool = RbConfig::CONFIG['STRIP']
|
||||
strip_tool += ' -x' if apple_toolchain
|
||||
|
||||
-unless windows
|
||||
- puts 'Building internal gRPC into ' + grpc_lib_dir
|
||||
- nproc = 4
|
||||
- nproc = Etc.nprocessors * 2 if Etc.respond_to? :nprocessors
|
||||
- nproc = Etc.nprocessors if Etc.respond_to? :nprocessors
|
||||
- nproc_override = ENV['GRPC_RUBY_BUILD_PROCS']
|
||||
- unless nproc_override.nil? or nproc_override.size == 0
|
||||
- nproc = nproc_override
|
||||
- puts "Overriding make parallelism to #{nproc}"
|
||||
- end
|
||||
- make = bsd ? 'gmake' : 'make'
|
||||
- system("#{make} -j#{nproc} -C #{grpc_root} #{grpc_lib_dir}/libgrpc.a CONFIG=#{grpc_config} Q=")
|
||||
- cmd = "#{make} -j#{nproc} -C #{grpc_root} #{grpc_lib_dir}/libgrpc.a CONFIG=#{grpc_config} Q="
|
||||
- puts "Building grpc native library: #{cmd}"
|
||||
- system(cmd)
|
||||
- exit 1 unless $? == 0
|
||||
-end
|
||||
-
|
||||
$CFLAGS << ' -I' + File.join(grpc_root, 'include')
|
||||
- if grpc_config == 'opt'
|
||||
- rm_obj_cmd = "rm -rf #{File.join(output_dir, 'objs')}"
|
||||
- puts "Removing grpc object files: #{rm_obj_cmd}"
|
||||
- system(rm_obj_cmd)
|
||||
- exit 1 unless $? == 0
|
||||
- strip_cmd = "#{strip_tool} #{grpc_lib_dir}/*.a"
|
||||
- puts "Stripping grpc native library: #{strip_cmd}"
|
||||
- system(strip_cmd)
|
||||
- exit 1 unless $? == 0
|
||||
- end
|
||||
-end
|
||||
+$LDFLAGS << ' -L' + ENV.fetch('TOPDIR', '.')
|
||||
|
||||
ext_export_file = File.join(grpc_root, 'src', 'ruby', 'ext', 'grpc', 'ext-export')
|
||||
$CFLAGS << ' -DGRPC_RUBY_WINDOWS_UCRT' if windows_ucrt
|
||||
$CFLAGS << ' -I' + File.join(grpc_root, 'include')
|
||||
@@ -118,7 +103,7 @@ ext_export_file += '-truffleruby' if RUBY_ENGINE == 'truffleruby'
|
||||
$LDFLAGS << ' -Wl,--version-script="' + ext_export_file + '.gcc"' if linux
|
||||
$LDFLAGS << ' -Wl,-exported_symbols_list,"' + ext_export_file + '.clang"' if darwin
|
||||
$LDFLAGS << ' -Wl,-exported_symbols_list,"' + ext_export_file + '.clang"' if apple_toolchain
|
||||
|
||||
-$LDFLAGS << ' ' + File.join(grpc_lib_dir, 'libgrpc.a') unless windows
|
||||
+$LDFLAGS << ' -Wl,-wrap,memcpy -lgrpc' unless windows
|
||||
if grpc_config == 'gcov'
|
||||
$CFLAGS << ' -O0 -fprofile-arcs -ftest-coverage'
|
||||
$LDFLAGS << ' -fprofile-arcs -ftest-coverage -rdynamic'
|
||||
@@ -92,7 +84,6 @@
|
||||
@@ -129,10 +114,6 @@ if grpc_config == 'dbg'
|
||||
end
|
||||
|
||||
$LDFLAGS << ' -Wl,-wrap,memcpy' if linux
|
||||
-$LDFLAGS << ' -static-libgcc -static-libstdc++' if linux
|
||||
-# Do not statically link standard libraries on TruffleRuby as this does not work when compiling to bitcode
|
||||
-if linux && RUBY_ENGINE != 'truffleruby'
|
||||
- $LDFLAGS << ' -static-libgcc -static-libstdc++'
|
||||
-end
|
||||
$LDFLAGS << ' -static' if windows
|
||||
|
||||
$CFLAGS << ' -std=c99 '
|
||||
$CFLAGS << ' -std=c11 '
|
||||
|
|
Loading…
Reference in a new issue