diff options
| author | Martin Jansa <martin.jansa@gmail.com> | 2024-05-06 01:59:47 +0200 |
|---|---|---|
| committer | Khem Raj <raj.khem@gmail.com> | 2024-05-05 17:04:49 -0700 |
| commit | 5778e32eae201072c5dc37c9db67dc1848ffb9de (patch) | |
| tree | a46f116b278ca82d694c2a53cf2e68f872ef63b2 /meta-python/recipes-devtools/python | |
| parent | bd1b5cde348dbc20e3d332de69617a8a95fe5ff3 (diff) | |
| download | meta-openembedded-5778e32eae201072c5dc37c9db67dc1848ffb9de.tar.gz | |
python3-grpcio: Fix build with gcc-14
* crypto: use _Generic only if !defined(__cplusplus)
* fixes build with gcc-14 which has __builtin_addc and __builtin_subc
with gcc-13 it was already using the #else branch because of missing builtins
* fixes
https://github.com/grpc/grpc/issues/35945
http://errors.yoctoproject.org/Errors/Details/766916/
* _Generic was introduced in boringssl with:
https://boringssl.googlesource.com/boringssl/+/70ca6bc24be103dabd68e448cd3af29b929b771d%5E%21/#F4
* but e.g. third_party/boringssl-with-bazel/src/ssl/d1_both.cc includes
this internal.h and from the .cc extension gcc will process it as C++
where _Generic isn't available, causing:
In file included from third_party/boringssl-with-bazel/src/ssl/d1_both.cc:125:
third_party/boringssl-with-bazel/src/ssl/../crypto/internal.h: In function 'uint32_t CRYPTO_addc_u32(uint32_t, uint32_t, uint32_t, uint32_t*)':
third_party/boringssl-with-bazel/src/ssl/../crypto/internal.h:1159:7: error: expected primary-expression before 'unsigned'
1159 | unsigned: __builtin_addc, \
| ^~~~~~~~
third_party/boringssl-with-bazel/src/ssl/../crypto/internal.h:1166:10: note: in expansion of macro 'CRYPTO_GENERIC_ADDC'
1166 | return CRYPTO_GENERIC_ADDC(x, y, carry, out_carry);
| ^~~~~~~~~~~~~~~~~~~
third_party/boringssl-with-bazel/src/ssl/../crypto/internal.h:1160:7: error: expected primary-expression before 'unsigned'
1160 | unsigned long: __builtin_addcl, \
| ^~~~~~~~
third_party/boringssl-with-bazel/src/ssl/../crypto/internal.h:1166:10: note: in expansion of macro 'CRYPTO_GENERIC_ADDC'
1166 | return CRYPTO_GENERIC_ADDC(x, y, carry, out_carry);
| ^~~~~~~~~~~~~~~~~~~
third_party/boringssl-with-bazel/src/ssl/../crypto/internal.h:1161:7: error: expected primary-expression before 'unsigned'
1161 | unsigned long long: __builtin_addcll))((x), (y), (carry), (out_carry))
| ^~~~~~~~
third_party/boringssl-with-bazel/src/ssl/../crypto/internal.h:1166:10: note: in expansion of macro 'CRYPTO_GENERIC_ADDC'
1166 | return CRYPTO_GENERIC_ADDC(x, y, carry, out_carry);
| ^~~~~~~~~~~~~~~~~~~
third_party/boringssl-with-bazel/src/ssl/../crypto/internal.h:1158:4: error: '_Generic' was not declared in this scope
1158 | (_Generic((x), \
| ^~~~~~~~
third_party/boringssl-with-bazel/src/ssl/../crypto/internal.h:1166:10: note: in expansion of macro 'CRYPTO_GENERIC_ADDC'
1166 | return CRYPTO_GENERIC_ADDC(x, y, carry, out_carry);
| ^~~~~~~~~~~~~~~~~~~
Signed-off-by: Martin Jansa <martin.jansa@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-python/recipes-devtools/python')
| -rw-r--r-- | meta-python/recipes-devtools/python/python3-grpcio/0001-crypto-use-_Generic-only-if-defined-__cplusplus.patch | 74 | ||||
| -rw-r--r-- | meta-python/recipes-devtools/python/python3-grpcio_1.62.2.bb | 1 |
2 files changed, 75 insertions, 0 deletions
diff --git a/meta-python/recipes-devtools/python/python3-grpcio/0001-crypto-use-_Generic-only-if-defined-__cplusplus.patch b/meta-python/recipes-devtools/python/python3-grpcio/0001-crypto-use-_Generic-only-if-defined-__cplusplus.patch new file mode 100644 index 0000000000..d830d92284 --- /dev/null +++ b/meta-python/recipes-devtools/python/python3-grpcio/0001-crypto-use-_Generic-only-if-defined-__cplusplus.patch | |||
| @@ -0,0 +1,74 @@ | |||
| 1 | From 3359a87a71307336100b84e66b69bad385cd3cfc Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Martin Jansa <martin.jansa@gmail.com> | ||
| 3 | Date: Mon, 6 May 2024 01:36:39 +0200 | ||
| 4 | Subject: [PATCH] crypto: use _Generic only if !defined(__cplusplus) | ||
| 5 | |||
| 6 | * fixes build with gcc-14 which has __builtin_addc and __builtin_subc | ||
| 7 | with gcc-13 it was already using the #else branch because of missing builtins | ||
| 8 | |||
| 9 | * fixes | ||
| 10 | https://github.com/grpc/grpc/issues/35945 | ||
| 11 | |||
| 12 | * _Generic was introduced in boringssl with: | ||
| 13 | https://boringssl.googlesource.com/boringssl/+/70ca6bc24be103dabd68e448cd3af29b929b771d%5E%21/#F4 | ||
| 14 | |||
| 15 | * but e.g. third_party/boringssl-with-bazel/src/ssl/d1_both.cc includes | ||
| 16 | this internal.h and from the .cc extension gcc will process it as C++ | ||
| 17 | where _Generic isn't available, causing: | ||
| 18 | |||
| 19 | In file included from third_party/boringssl-with-bazel/src/ssl/d1_both.cc:125: | ||
| 20 | third_party/boringssl-with-bazel/src/ssl/../crypto/internal.h: In function 'uint32_t CRYPTO_addc_u32(uint32_t, uint32_t, uint32_t, uint32_t*)': | ||
| 21 | third_party/boringssl-with-bazel/src/ssl/../crypto/internal.h:1159:7: error: expected primary-expression before 'unsigned' | ||
| 22 | 1159 | unsigned: __builtin_addc, \ | ||
| 23 | | ^~~~~~~~ | ||
| 24 | third_party/boringssl-with-bazel/src/ssl/../crypto/internal.h:1166:10: note: in expansion of macro 'CRYPTO_GENERIC_ADDC' | ||
| 25 | 1166 | return CRYPTO_GENERIC_ADDC(x, y, carry, out_carry); | ||
| 26 | | ^~~~~~~~~~~~~~~~~~~ | ||
| 27 | third_party/boringssl-with-bazel/src/ssl/../crypto/internal.h:1160:7: error: expected primary-expression before 'unsigned' | ||
| 28 | 1160 | unsigned long: __builtin_addcl, \ | ||
| 29 | | ^~~~~~~~ | ||
| 30 | third_party/boringssl-with-bazel/src/ssl/../crypto/internal.h:1166:10: note: in expansion of macro 'CRYPTO_GENERIC_ADDC' | ||
| 31 | 1166 | return CRYPTO_GENERIC_ADDC(x, y, carry, out_carry); | ||
| 32 | | ^~~~~~~~~~~~~~~~~~~ | ||
| 33 | third_party/boringssl-with-bazel/src/ssl/../crypto/internal.h:1161:7: error: expected primary-expression before 'unsigned' | ||
| 34 | 1161 | unsigned long long: __builtin_addcll))((x), (y), (carry), (out_carry)) | ||
| 35 | | ^~~~~~~~ | ||
| 36 | third_party/boringssl-with-bazel/src/ssl/../crypto/internal.h:1166:10: note: in expansion of macro 'CRYPTO_GENERIC_ADDC' | ||
| 37 | 1166 | return CRYPTO_GENERIC_ADDC(x, y, carry, out_carry); | ||
| 38 | | ^~~~~~~~~~~~~~~~~~~ | ||
| 39 | third_party/boringssl-with-bazel/src/ssl/../crypto/internal.h:1158:4: error: '_Generic' was not declared in this scope | ||
| 40 | 1158 | (_Generic((x), \ | ||
| 41 | | ^~~~~~~~ | ||
| 42 | third_party/boringssl-with-bazel/src/ssl/../crypto/internal.h:1166:10: note: in expansion of macro 'CRYPTO_GENERIC_ADDC' | ||
| 43 | 1166 | return CRYPTO_GENERIC_ADDC(x, y, carry, out_carry); | ||
| 44 | | ^~~~~~~~~~~~~~~~~~~ | ||
| 45 | |||
| 46 | Signed-off-by: Martin Jansa <martin.jansa@gmail.com> | ||
| 47 | --- | ||
| 48 | Upstream-Status: Submitted [https://boringssl-review.googlesource.com/c/boringssl/+/68227 crypto: use _Generic only if !defined(__cplusplus)] | ||
| 49 | |||
| 50 | crypto/internal.h | 4 ++-- | ||
| 51 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
| 52 | |||
| 53 | diff --git a/crypto/internal.h b/crypto/internal.h | ||
| 54 | index a77102d76..30d6826dd 100644 | ||
| 55 | --- a/crypto/internal.h | ||
| 56 | +++ b/crypto/internal.h | ||
| 57 | @@ -1176,7 +1176,7 @@ static inline uint64_t CRYPTO_rotr_u64(uint64_t value, int shift) { | ||
| 58 | |||
| 59 | // CRYPTO_addc_* returns |x + y + carry|, and sets |*out_carry| to the carry | ||
| 60 | // bit. |carry| must be zero or one. | ||
| 61 | -#if OPENSSL_HAS_BUILTIN(__builtin_addc) | ||
| 62 | +#if OPENSSL_HAS_BUILTIN(__builtin_addc) && !defined(__cplusplus) | ||
| 63 | |||
| 64 | #define CRYPTO_GENERIC_ADDC(x, y, carry, out_carry) \ | ||
| 65 | (_Generic((x), \ | ||
| 66 | @@ -1228,7 +1228,7 @@ static inline uint64_t CRYPTO_addc_u64(uint64_t x, uint64_t y, uint64_t carry, | ||
| 67 | |||
| 68 | // CRYPTO_subc_* returns |x - y - borrow|, and sets |*out_borrow| to the borrow | ||
| 69 | // bit. |borrow| must be zero or one. | ||
| 70 | -#if OPENSSL_HAS_BUILTIN(__builtin_subc) | ||
| 71 | +#if OPENSSL_HAS_BUILTIN(__builtin_subc) && !defined(__cplusplus) | ||
| 72 | |||
| 73 | #define CRYPTO_GENERIC_SUBC(x, y, borrow, out_borrow) \ | ||
| 74 | (_Generic((x), \ | ||
diff --git a/meta-python/recipes-devtools/python/python3-grpcio_1.62.2.bb b/meta-python/recipes-devtools/python/python3-grpcio_1.62.2.bb index 3148f63761..3cee8ab10c 100644 --- a/meta-python/recipes-devtools/python/python3-grpcio_1.62.2.bb +++ b/meta-python/recipes-devtools/python/python3-grpcio_1.62.2.bb | |||
| @@ -9,6 +9,7 @@ DEPENDS += "python3-protobuf" | |||
| 9 | SRC_URI += "file://0001-Include-missing-cstdint-header.patch \ | 9 | SRC_URI += "file://0001-Include-missing-cstdint-header.patch \ |
| 10 | file://abseil-ppc-fixes.patch \ | 10 | file://abseil-ppc-fixes.patch \ |
| 11 | file://0001-zlib-Include-unistd.h-for-open-close-C-APIs.patch \ | 11 | file://0001-zlib-Include-unistd.h-for-open-close-C-APIs.patch \ |
| 12 | file://0001-crypto-use-_Generic-only-if-defined-__cplusplus.patch;patchdir=third_party/boringssl-with-bazel/src/ \ | ||
| 12 | " | 13 | " |
| 13 | SRC_URI[sha256sum] = "c77618071d96b7a8be2c10701a98537823b9c65ba256c0b9067e0594cdbd954d" | 14 | SRC_URI[sha256sum] = "c77618071d96b7a8be2c10701a98537823b9c65ba256c0b9067e0594cdbd954d" |
| 14 | 15 | ||
