Accepting request 1139642 from devel:tools

OBS-URL: https://build.opensuse.org/request/show/1139642
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/grpc?expand=0&rev=70
This commit is contained in:
Ana Guerrero 2024-01-19 21:59:56 +00:00 committed by Git OBS Bridge
commit 5654d112e1
4 changed files with 124 additions and 16 deletions

View File

@ -0,0 +1,58 @@
From 316649c7bb8545571d9beb75dc2fb1abfbe6552f Mon Sep 17 00:00:00 2001
From: "easyaspi314 (Devin)" <easyaspi314@users.noreply.github.com>
Date: Tue, 7 Dec 2021 21:36:13 -0500
Subject: [PATCH] [ARM] Unaligned access fixes
- Use memcpy on ARMv6 and lower when unaligned access is supported
- GCC has an internal conflict on whether unaligned access is available
on ARMv6 so some parts do byteshift, some parts do not
- aligned(1) is better on everything else
- All this seems to be safe on even GCC 4.9.
- Leave out the alignment check if unaligned access is supported on ARM.
---
xxhash.h | 24 +++++++-----------------
1 file changed, 7 insertions(+), 17 deletions(-)
diff --git a/xxhash.h b/xxhash.h
index 08ab794..4cf3f0d 100644
--- a/xxhash.h
+++ b/xxhash.h
@@ -1402,28 +1402,18 @@ XXH3_128bits_reset_withSecretandSeed(XXH3_state_t* statePtr,
*/
#ifndef XXH_FORCE_MEMORY_ACCESS /* can be defined externally, on command line for example */
- /* prefer __packed__ structures (method 1) for gcc on armv7+ and mips */
-# if !defined(__clang__) && \
-( \
- (defined(__INTEL_COMPILER) && !defined(_WIN32)) || \
- ( \
- defined(__GNUC__) && ( \
- (defined(__ARM_ARCH) && __ARM_ARCH >= 7) || \
- ( \
- defined(__mips__) && \
- (__mips <= 5 || __mips_isa_rev < 6) && \
- (!defined(__mips16) || defined(__mips_mips16e2)) \
- ) \
- ) \
- ) \
-)
+ /* prefer __packed__ structures (method 1) for GCC
+ * < ARMv7 with unaligned access (e.g. Raspbian armhf) still uses byte shifting, so we use memcpy
+ * which for some reason does unaligned loads. */
+# if defined(__GNUC__) && !(defined(__ARM_ARCH) && __ARM_ARCH < 7 && defined(__ARM_FEATURE_UNALIGNED))
# define XXH_FORCE_MEMORY_ACCESS 1
# endif
#endif
#ifndef XXH_FORCE_ALIGN_CHECK /* can be defined externally */
-# if defined(__i386) || defined(__x86_64__) || defined(__aarch64__) \
- || defined(_M_IX86) || defined(_M_X64) || defined(_M_ARM64) /* visual */
+ /* don't check on x86, aarch64, or arm when unaligned access is available */
+# if defined(__i386) || defined(__x86_64__) || defined(__aarch64__) || defined(__ARM_FEATURE_UNALIGNED) \
+ || defined(_M_IX86) || defined(_M_X64) || defined(_M_ARM64) || defined(_M_ARM) /* visual */
# define XXH_FORCE_ALIGN_CHECK 0
# else
# define XXH_FORCE_ALIGN_CHECK 1
--
2.43.0

View File

@ -0,0 +1,43 @@
From 2d5f93345cacbd2a076e75e6ce33e7bf3a4b9cb0 Mon Sep 17 00:00:00 2001
From: Mattias Ellert <mattias.ellert@physics.uu.se>
Date: Tue, 30 Nov 2021 23:19:38 +0100
Subject: [PATCH] Fix compilation on RHEL 7 ppc64le (gcc 4.8)
---
xxhash.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/xxhash.h b/xxhash.h
index 4cf3f0d..b07de0c 100644
--- a/xxhash.h
+++ b/xxhash.h
@@ -4119,7 +4119,7 @@ XXH3_accumulate_512_vsx( void* XXH_RESTRICT acc,
const void* XXH_RESTRICT secret)
{
/* presumed aligned */
- unsigned long long* const xacc = (unsigned long long*) acc;
+ unsigned int* const xacc = (unsigned int*) acc;
xxh_u64x2 const* const xinput = (xxh_u64x2 const*) input; /* no alignment restriction */
xxh_u64x2 const* const xsecret = (xxh_u64x2 const*) secret; /* no alignment restriction */
xxh_u64x2 const v32 = { 32, 32 };
@@ -4135,7 +4135,7 @@ XXH3_accumulate_512_vsx( void* XXH_RESTRICT acc,
/* product = ((xxh_u64x2)data_key & 0xFFFFFFFF) * ((xxh_u64x2)shuffled & 0xFFFFFFFF); */
xxh_u64x2 const product = XXH_vec_mulo((xxh_u32x4)data_key, shuffled);
/* acc_vec = xacc[i]; */
- xxh_u64x2 acc_vec = vec_xl(0, xacc + 2 * i);
+ xxh_u64x2 acc_vec = (xxh_u64x2)vec_xl(0, xacc + 4 * i);
acc_vec += product;
/* swap high and low halves */
@@ -4145,7 +4145,7 @@ XXH3_accumulate_512_vsx( void* XXH_RESTRICT acc,
acc_vec += vec_xxpermdi(data_vec, data_vec, 2);
#endif
/* xacc[i] = acc_vec; */
- vec_xst(acc_vec, 0, xacc + 2 * i);
+ vec_xst((xxh_u32x4)acc_vec, 0, xacc + 4 * i);
}
}
--
2.43.0

View File

@ -1,3 +1,13 @@
-------------------------------------------------------------------
Thu Jan 18 07:58:43 UTC 2024 - John Paul Adrian Glaubitz <adrian.glaubitz@suse.com>
- Add ARM-Unaligned-access-fixes.patch to fix unaligned
access on ARM which causes issues on AArch64 kernels
- Add Fix-compilation-on-RHEL-7-ppc64le-gcc-4.8.patch
to fix FTBFS on ppc64le when using gcc-7 (boo#1208794)
- Revert changes made to RPATH handling
- Switch build compiler back to default on SLE-15
-------------------------------------------------------------------
Tue Nov 28 21:04:45 UTC 2023 - Jan Engelhardt <jengelh@inai.de>

View File

@ -1,7 +1,7 @@
#
# spec file for package grpc
#
# Copyright (c) 2023 SUSE LLC
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -28,14 +28,15 @@ Group: Development/Tools/Building
URL: https://grpc.io/
Source: https://github.com/grpc/grpc/archive/v%version.tar.gz
Source2: %name-rpmlintrc
# PATCH-FIX-UPSTREAM ARM-Unaligned-access-fixes.patch gh#Cyan4973/xxHash#651 easyaspi314@users.noreply.github.com
# Fix unaligned access on ARM
Patch1: ARM-Unaligned-access-fixes.patch
# PATCH-FIX-UPSTREAM Fix-compilation-on-RHEL-7-ppc64le-gcc-4.8.patch gh#Cyan4973/xxHash#651 mattias.ellert@physics.uu.se
# Fix build on ppc64le on RHEL-7 with gcc-4.8
Patch2: Fix-compilation-on-RHEL-7-ppc64le-gcc-4.8.patch
BuildRequires: abseil-cpp-devel
BuildRequires: cmake
BuildRequires: fdupes
%if 0%{?suse_version} < 1550
BuildRequires: gcc12-c++
%else
BuildRequires: gcc-c++
%endif
BuildRequires: opencensus-proto-source
BuildRequires: pkg-config
BuildRequires: pkgconfig(libcares) >= 1.19.1
@ -124,15 +125,13 @@ BuildArch: noarch
This subpackage contains source code of the gRPC reference implementation.
%prep
%autosetup -p1
%autosetup -N
pushd third_party/xxhash
%patch1 -p1
%patch2 -p1
popd
rm -Rf third_party/abseil-cpp/
%build
%if 0%{?suse_version} < 1550
export CC=gcc-12
export CXX=g++-12
%endif
%define _lto_cflags %nil
# protoc is invoked strangely; make it happy with this dir or it will assert()
mkdir -p third_party/protobuf/src
@ -149,9 +148,7 @@ export CXXFLAGS="$CFLAGS"
-DgRPC_SSL_PROVIDER=package \
-DZLIB_LIBRARY=%{_libdir}/libz.so \
-DgRPC_ZLIB_PROVIDER=package \
-DCMAKE_CXX_STANDARD=17 \
-DCMAKE_SKIP_RPATH=FALSE \
-DCMAKE_SKIP_INSTALL_RPATH=TRUE
-DCMAKE_CXX_STANDARD=17
%cmake_build
%install