Skip to content

Commit 2bbaff9

Browse files
authored
Merge pull request zcash#6879 from zcash/llvm-18
Migrate to LLVM 18
2 parents f2823bc + 3a6bd8a commit 2bbaff9

27 files changed

+239
-116
lines changed
File renamed without changes.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ Makefile
8383
# Rust
8484
.cargo/.configured-for-*
8585
.cargo/config
86+
.cargo/config.toml
8687
src/rust/gen/
8788
target/
8889

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ repository = "https://github.com/zcash/zcash"
1919
readme = "README.md"
2020
license = "MIT OR Apache-2.0"
2121
edition = "2018"
22-
rust-version = "1.69"
22+
rust-version = "1.78"
2323

2424
[package.metadata.vet]
2525
store = { path = "./qa/supply-chain" }

configure.ac

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,7 @@ DESIRED_WARNING_CXXFLAGS="\
354354
# same as fields
355355
# • `-Wno-string-conversion`: currently abused to `assert` on strings
356356
# • `-Wno-tautological-type-limit-compare`: I think isn’t portable because of numeric type sizing
357+
# • `-Wno-unsafe-buffer-usage`: Added in Clang 16, needs consideration
357358
DISABLED_WARNING_CXXFLAGS="\
358359
-Wno-c++20-compat -Wno-cast-align -Wno-cast-qual -Wno-comma -Wno-conditional-uninitialized \
359360
-Wno-covered-switch-default -Wno-ctad-maybe-unsupported \
@@ -370,11 +371,13 @@ DISABLED_WARNING_CXXFLAGS="\
370371
-Wno-redundant-parens -Wno-reorder-ctor -Wno-reserved-id-macro -Wno-reserved-identifier \
371372
-Wno-return-type -Wno-shadow -Wno-shadow-field -Wno-shadow-field-in-constructor \
372373
-Wno-shift-sign-overflow -Wno-shorten-64-to-32 -Wno-sign-compare -Wno-sign-conversion \
373-
-Wno-string-conversion -Wno-suggest-destructor-override -Wno-suggest-override -Wno-switch-enum \
374+
-Wno-string-conversion -Wno-suggest-destructor-override -Wno-suggest-override \
375+
-Wno-switch-default -Wno-switch-enum \
374376
-Wno-tautological-type-limit-compare -Wno-tautological-unsigned-enum-zero-compare \
375377
-Wno-tautological-unsigned-zero-compare -Wno-thread-safety-attributes \
376378
-Wno-thread-safety-negative -Wno-undef -Wno-undefined-func-template -Wno-uninitialized \
377379
-Wno-unreachable-code -Wno-unreachable-code-break -Wno-unreachable-code-return \
380+
-Wno-unsafe-buffer-usage \
378381
-Wno-unused-but-set-variable -Wno-unused-exception-parameter -Wno-unused-function \
379382
-Wno-unused-macros -Wno-unused-member-function -Wno-unused-parameter -Wno-unused-private-field \
380383
-Wno-unused-template -Wno-unused-variable -Wno-used-but-marked-unused -Wno-weak-vtables \
@@ -401,7 +404,7 @@ REENABLED_WARNING_CXXFLAGS="\
401404
-Wmicrosoft-comment-paste -Wmicrosoft-cpp-macro -Wmicrosoft-end-of-file -Wmicrosoft-enum-value \
402405
-Wmicrosoft-fixed-enum -Wmicrosoft-flexible-array -Wmicrosoft-redeclare-static \
403406
-Wnested-anon-types -Wnullability-extension -Wobjc-signed-char-bool-implicit-int-conversion \
404-
-Woverlength-strings -Wpre-c++2b-compat -Wretained-language-linkage \
407+
-Woverlength-strings -Wpre-c++20-compat -Wretained-language-linkage \
405408
-Wshadow-field-in-constructor-modified -Wshadow-ivar -Wsometimes-uninitialized \
406409
-Wstatic-self-init -Wundefined-internal-type -Wunneeded-member-function \
407410
-Wunreachable-code-fallthrough -Wunreachable-code-generic-assoc -Wunreachable-code-loop-increment"

contrib/devtools/update-clang-hashes.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
77
CLANG_PACKAGE="$SCRIPT_DIR/../../depends/packages/native_clang.mk"
88
LIBCXX_PACKAGE="$SCRIPT_DIR/../../depends/packages/libcxx.mk"
99

10-
CLANG_VERSION=$( grep -v _major_version $CLANG_PACKAGE | grep -oP "_version=\K.*" )
10+
CLANG_VERSION=$( grep -v _major_version $CLANG_PACKAGE | grep -oP "_default_version=\K.*" )
1111
LIBCXX_MSYS2_VERSION=$( grep -oP "_msys2_version=\K.*" $LIBCXX_PACKAGE )
1212

1313
update_clang_hash() {

depends/packages/libcxx.mk

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package=libcxx
22
$(package)_version=$(if $(native_clang_version_$(host_arch)_$(host_os)),$(native_clang_version_$(host_arch)_$(host_os)),$(if $(native_clang_version_$(host_os)),$(native_clang_version_$(host_os)),$(native_clang_default_version)))
3-
$(package)_msys2_version=15.0.7-3
3+
$(package)_msys2_version=18.1.4-1
44

55
ifneq ($(canonical_host),$(build))
66
ifneq ($(host_os),mingw32)
@@ -9,10 +9,10 @@ ifneq ($(host_os),mingw32)
99
$(package)_download_path=$(native_clang_download_path)
1010
$(package)_download_file_aarch64_linux=clang+llvm-$($(package)_version)-aarch64-linux-gnu.tar.xz
1111
$(package)_file_name_aarch64_linux=clang-llvm-$($(package)_version)-aarch64-linux-gnu.tar.xz
12-
$(package)_sha256_hash_aarch64_linux=8ca4d68cf103da8331ca3f35fe23d940c1b78fb7f0d4763c1c059e352f5d1bec
13-
$(package)_download_file_linux=clang+llvm-$($(package)_version)-x86_64-linux-gnu-ubuntu-18.04.tar.xz
14-
$(package)_file_name_linux=clang-llvm-$($(package)_version)-x86_64-linux-gnu-ubuntu-18.04.tar.xz
15-
$(package)_sha256_hash_linux=38bc7f5563642e73e69ac5626724e206d6d539fbef653541b34cae0ba9c3f036
12+
$(package)_sha256_hash_aarch64_linux=8c2f4d1606d24dc197a590acce39453abe7a302b9b92e762108f9b5a9701b1df
13+
$(package)_download_file_linux=clang+llvm-$($(package)_version)-x86_64-linux-gnu-ubuntu-22.04.tar.xz
14+
$(package)_file_name_linux=clang-llvm-$($(package)_version)-x86_64-linux-gnu-ubuntu-22.04.tar.xz
15+
$(package)_sha256_hash_linux=1607375b4aa2aec490b6db51846a04b265675a87e925bcf5825966401ff9b0b1
1616

1717
# Starting from LLVM 14.0.0, some Clang binary tarballs store libc++ in a
1818
# target-specific subdirectory.
@@ -30,7 +30,7 @@ else
3030
$(package)_download_path=https://repo.msys2.org/mingw/x86_64
3131
$(package)_download_file=mingw-w64-x86_64-libc++-$($(package)_msys2_version)-any.pkg.tar.zst
3232
$(package)_file_name=mingw-w64-x86_64-libcxx-$($(package)_msys2_version)-any.pkg.tar.zst
33-
$(package)_sha256_hash=8c14da21fa9622cc7450b22467452c6c933a03cee526cf8744faea3d4674035b
33+
$(package)_sha256_hash=45f8dcac0ed5ff68d202c9321375dbefb0a7e7aa1d1e1ed7299842759f9bc88b
3434

3535
define $(package)_stage_cmds
3636
mkdir -p $($(package)_staging_prefix_dir)/lib && \

depends/packages/libevent.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ endef
1515
# version as we do in configure. Due to quirks in libevents build system, this
1616
# is also required to enable support for ipv6. See #19375.
1717
define $(package)_set_vars
18-
$(package)_config_opts=--disable-shared --disable-openssl --disable-libevent-regress
18+
$(package)_config_opts=--disable-shared --disable-openssl --disable-libevent-regress --disable-samples
1919
$(package)_config_opts += --disable-dependency-tracking --enable-option-checking
2020
$(package)_config_opts_release=--disable-debug-mode
2121
$(package)_config_opts_linux=--with-pic

depends/packages/libsodium.mk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@ $(package)_download_path=https://download.libsodium.org/libsodium/releases/
44
$(package)_file_name=$(package)-$($(package)_version).tar.gz
55
$(package)_sha256_hash=018d79fe0a045cca07331d37bd0cb57b2e838c51bc48fd837a1472e50068bbea
66
$(package)_dependencies=
7-
$(package)_patches=1.0.15-pubkey-validation.diff 1.0.15-signature-validation.diff
7+
$(package)_patches=1.0.15-pubkey-validation.diff 1.0.15-signature-validation.diff 1321-aarch64-fix-compiler-attributes.patch
88
$(package)_config_opts=
99

1010
define $(package)_preprocess_cmds
1111
patch -p1 < $($(package)_patch_dir)/1.0.15-pubkey-validation.diff && \
1212
patch -p1 < $($(package)_patch_dir)/1.0.15-signature-validation.diff && \
13+
patch -p1 < $($(package)_patch_dir)/1321-aarch64-fix-compiler-attributes.patch && \
1314
cd $($(package)_build_subdir); DO_NOT_UPDATE_CONFIG_SCRIPTS=1 ./autogen.sh
1415
endef
1516

depends/packages/native_clang.mk

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,15 @@ package=native_clang
55
# - Manually fix the versions for packages that don't exist (the LLVM project
66
# doesn't uniformly cut binaries across releases).
77
# The Clang compiler should use the same LLVM version as the Rust compiler.
8-
$(package)_default_major_version=15
9-
$(package)_default_version=15.0.6
8+
$(package)_default_major_version=18
9+
$(package)_default_version=18.1.4
10+
# 2024-05-03: No Intel macOS packages are available for Clang 16, 17, or 18.
11+
$(package)_major_version_darwin=15
1012
$(package)_version_darwin=15.0.4
1113
# 2023-02-16: No FreeBSD packages are available for Clang 15.
1214
# 2023-04-07: Still the case.
15+
# 2024-05-03: No FreeBSD packages are available for Clang 17 or 18.
16+
# Clang 16 has FreeBSD 13 packages, but none for FreeBSD 12.
1317
$(package)_major_version_freebsd=14
1418
$(package)_version_freebsd=14.0.6
1519

@@ -23,7 +27,7 @@ $(package)_major_version=$(if $($(package)_major_version_$(host_arch)_$(host_os)
2327
$(package)_download_path_linux=https://github.com/llvm/llvm-project/releases/download/llvmorg-$($(package)_version)
2428
$(package)_download_file_linux=clang+llvm-$($(package)_version)-x86_64-linux-gnu-ubuntu-18.04.tar.xz
2529
$(package)_file_name_linux=clang-llvm-$($(package)_version)-x86_64-linux-gnu-ubuntu-18.04.tar.xz
26-
$(package)_sha256_hash_linux=38bc7f5563642e73e69ac5626724e206d6d539fbef653541b34cae0ba9c3f036
30+
$(package)_sha256_hash_linux=1607375b4aa2aec490b6db51846a04b265675a87e925bcf5825966401ff9b0b1
2731
$(package)_download_path_darwin=https://github.com/llvm/llvm-project/releases/download/llvmorg-$($(package)_version)
2832
$(package)_download_file_darwin=clang+llvm-$($(package)_version)-x86_64-apple-darwin.tar.xz
2933
$(package)_file_name_darwin=clang-llvm-$($(package)_version)-x86_64-apple-darwin.tar.xz
@@ -35,10 +39,10 @@ $(package)_sha256_hash_freebsd=b0a7b86dacb12afb8dd2ca99ea1b894d9cce84aab7711cb19
3539
$(package)_download_path_aarch64_linux=https://github.com/llvm/llvm-project/releases/download/llvmorg-$($(package)_version)
3640
$(package)_download_file_aarch64_linux=clang+llvm-$($(package)_version)-aarch64-linux-gnu.tar.xz
3741
$(package)_file_name_aarch64_linux=clang-llvm-$($(package)_version)-aarch64-linux-gnu.tar.xz
38-
$(package)_sha256_hash_aarch64_linux=8ca4d68cf103da8331ca3f35fe23d940c1b78fb7f0d4763c1c059e352f5d1bec
42+
$(package)_sha256_hash_aarch64_linux=8c2f4d1606d24dc197a590acce39453abe7a302b9b92e762108f9b5a9701b1df
3943

40-
ifneq (,$(wildcard /etc/arch-release))
41-
$(package)_dependencies=native_libtinfo
44+
ifeq ($(build_os),linux)
45+
$(package)_dependencies=native_libtinfo5
4246
endif
4347

4448
# Ensure we have clang native to the builder, not the target host

depends/packages/native_libtinfo.mk renamed to depends/packages/native_libtinfo5.mk

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
1-
package=native_tinfo
2-
$(package)_version=5.6.0
3-
$(package)_download_path_linux=http://ftp.debian.org/debian/pool/main/n/ncurses/
4-
$(package)_download_file_linux=libtinfo5_6.0+20161126-1+deb9u2_amd64.deb
5-
$(package)_file_name_linux=libtinfo5_6.0+20161126-1+deb9u2_amd64.deb
6-
$(package)_sha256_hash_linux=1d249a3193568b5ef785ad8993b9ba6d6fdca0eb359204c2355532b82d25e9f5
1+
package=native_libtinfo5
2+
$(package)_version=6.2
3+
4+
# We only enable this if build_os is linux.
5+
$(package)_download_path=http://ftp.debian.org/debian/pool/main/n/ncurses/
6+
$(package)_download_file=libtinfo5_$($(package)_version)+20201114-2+deb11u2_amd64.deb
7+
$(package)_file_name=libtinfo5-$($(package)_version).deb
8+
$(package)_sha256_hash=69e131ce3f790a892ca1b0ae3bfad8659daa2051495397eee1b627d9783a6797
79

810
define $(package)_extract_cmds
911
mkdir -p $($(package)_extract_dir) && \
1012
echo "$($(package)_sha256_hash) $($(package)_source)" > $($(package)_extract_dir)/.$($(package)_file_name).hash && \
1113
$(build_SHA256SUM) -c $($(package)_extract_dir)/.$($(package)_file_name).hash && \
1214
mkdir -p libtinfo5 && \
13-
ar x --output libtinfo5 $($(package)_source_dir)/$($(package)_file_name) && \
1415
cd libtinfo5 && \
16+
ar x $($(package)_source_dir)/$($(package)_file_name) && \
1517
tar xf data.tar.xz
1618
endef
1719

depends/packages/native_rust.mk

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@ package=native_rust
33
# ./contrib/devtools/update-rust-hashes.sh
44
# The Rust compiler should use the same LLVM version as the Clang compiler; you
55
# can check this with `rustc --version -v`.
6-
$(package)_version=1.69.0
6+
$(package)_version=1.78.0
77
$(package)_download_path=https://static.rust-lang.org/dist
88
$(package)_file_name_linux=rust-$($(package)_version)-x86_64-unknown-linux-gnu.tar.gz
9-
$(package)_sha256_hash_linux=2ca4a306047c0b8b4029c382910fcbc895badc29680e0332c9df990fd1c70d4f
9+
$(package)_sha256_hash_linux=1307747915e8bd925f4d5396ab2ae3d8d9c7fad564afbc358c081683d0f22e87
1010
$(package)_file_name_darwin=rust-$($(package)_version)-x86_64-apple-darwin.tar.gz
11-
$(package)_sha256_hash_darwin=9818dab2c3726d63dfbfde12c9273e62e484ef6d6f6e05a6431a3e089c335454
11+
$(package)_sha256_hash_darwin=6c91ed3bd90253961fcb4a2991b8b22e042e2aaa9aba9f389f1e17008171d898
1212
$(package)_file_name_freebsd=rust-$($(package)_version)-x86_64-unknown-freebsd.tar.gz
13-
$(package)_sha256_hash_freebsd=2985d98910b4a1dd336bfc7a1ac3b18082ed917cff097b4db6f0d6602016c289
13+
$(package)_sha256_hash_freebsd=b9cc84c60deb8da08a6c876426f8721758f4c7e7c553b4554385752ad37c63df
1414
$(package)_file_name_aarch64_linux=rust-$($(package)_version)-aarch64-unknown-linux-gnu.tar.gz
15-
$(package)_sha256_hash_aarch64_linux=88af5aa7a40c8f1b40416a1f27de8ffbe09c155d933f69d3e109c0ccee92353b
15+
$(package)_sha256_hash_aarch64_linux=131eda738cd977fff2c912e5838e8e9b9c260ecddc1247c0fe5473bf09c594af
1616

1717
# Mapping from GCC canonical hosts to Rust targets
1818
# If a mapping is not present, we assume they are identical, unless $host_os is
@@ -21,10 +21,10 @@ $(package)_rust_target_x86_64-pc-linux-gnu=x86_64-unknown-linux-gnu
2121
$(package)_rust_target_x86_64-w64-mingw32=x86_64-pc-windows-gnu
2222

2323
# Mapping from Rust targets to SHA-256 hashes
24-
$(package)_rust_std_sha256_hash_aarch64-unknown-linux-gnu=8f42b40c0a0658ee75ce758652c9821fac7db3fbd8d20f7fb2483ec2c57ee0ac
25-
$(package)_rust_std_sha256_hash_x86_64-apple-darwin=e44d71250dc5a238da0dc4784dad59d562862653adecd31ea52e0920b85c6a7c
26-
$(package)_rust_std_sha256_hash_x86_64-pc-windows-gnu=09ded4a4c27c16aff9c9911640b1bdf6e1172237ce540ed4dc3e166e9438f0d7
27-
$(package)_rust_std_sha256_hash_x86_64-unknown-freebsd=eed4b3f3358a8887b0f6a62e021469878a8990af9b94c2fe87d3c1b0220913bb
24+
$(package)_rust_std_sha256_hash_aarch64-unknown-linux-gnu=9ef30225a7c466758a1b3ba011cbd702f5038c875816cb1733d633002642e2f3
25+
$(package)_rust_std_sha256_hash_x86_64-apple-darwin=f91024e3b9a4fdb9bba5dfe8b028604bcd1ad621f0b8e8140a31bd677a0232c2
26+
$(package)_rust_std_sha256_hash_x86_64-pc-windows-gnu=5dfe7246685dad55fbdd93deffcdfcf11dea095383228a327769a209bfc145f4
27+
$(package)_rust_std_sha256_hash_x86_64-unknown-freebsd=82fd506f720c0e469fb72f5b532b42c109562a030c3ef2f4fd73dfb08c050929
2828

2929
define rust_target
3030
$(if $($(1)_rust_target_$(2)),$($(1)_rust_target_$(2)),$(if $(findstring darwin,$(3)),x86_64-apple-darwin,$(if $(findstring freebsd,$(3)),x86_64-unknown-freebsd,$(2))))

depends/packages/packages.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ zcash_packages := libsodium rustcxx utfcpp tl_expected
22
packages := boost libevent zeromq $(zcash_packages) googletest
33
native_packages := native_clang native_ccache native_cmake native_rust native_cxxbridge native_zstd
44

5-
ifneq (,$(wildcard /etc/arch-release))
6-
native_packages += native_libtinfo
5+
ifeq ($(build_os),linux)
6+
native_packages += native_libtinfo5
77
endif
88

99
wallet_packages=bdb
Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
From 8f453f41f8834e0fe47610f2a3e03e696ddb3450 Mon Sep 17 00:00:00 2001
2+
From: Frank Denis <github@pureftpd.org>
3+
Date: Fri, 20 Oct 2023 13:47:57 +0200
4+
Subject: [PATCH] aarch64: set compiler attributes *after* including
5+
<arm_neon.h>
6+
7+
Fixes #1321
8+
---
9+
configure.ac | 11 ++++++-----
10+
.../crypto_aead/aegis128l/aegis128l_armcrypto.c | 12 ++++++------
11+
.../crypto_aead/aegis256/aegis256_armcrypto.c | 12 ++++++------
12+
.../aes256gcm/armcrypto/aead_aes256gcm_armcrypto.c | 12 ++++++------
13+
4 files changed, 24 insertions(+), 23 deletions(-)
14+
15+
diff --git a/configure.ac b/configure.ac
16+
index 287e109cd7..e792f67139 100644
17+
--- a/configure.ac
18+
+++ b/configure.ac
19+
@@ -397,11 +397,6 @@ AS_IF([test "x$EMSCRIPTEN" = "x"], [
20+
have_armcrypto=no
21+
AC_MSG_CHECKING(for ARM crypto instructions set)
22+
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
23+
- #ifdef __clang__
24+
- # pragma clang attribute push(__attribute__((target("neon,crypto,aes"))), apply_to = function)
25+
- #elif defined(__GNUC__)
26+
- # pragma GCC target("+simd+crypto")
27+
- #endif
28+
#ifndef __ARM_FEATURE_CRYPTO
29+
# define __ARM_FEATURE_CRYPTO 1
30+
#endif
31+
@@ -410,6 +405,12 @@ AS_IF([test "x$EMSCRIPTEN" = "x"], [
32+
#endif
33+
34+
#include <arm_neon.h>
35+
+
36+
+ #ifdef __clang__
37+
+ # pragma clang attribute push(__attribute__((target("neon,crypto,aes"))), apply_to = function)
38+
+ #elif defined(__GNUC__)
39+
+ # pragma GCC target("+simd+crypto")
40+
+ #endif
41+
]], [[
42+
int64x2_t x = { 0, 0 };
43+
vaeseq_u8(vmovq_n_u8(0), vmovq_n_u8(0));
44+
diff --git a/src/libsodium/crypto_aead/aegis128l/aegis128l_armcrypto.c b/src/libsodium/crypto_aead/aegis128l/aegis128l_armcrypto.c
45+
index 825de8a1c8..a01f60cbe6 100644
46+
--- a/src/libsodium/crypto_aead/aegis128l/aegis128l_armcrypto.c
47+
+++ b/src/libsodium/crypto_aead/aegis128l/aegis128l_armcrypto.c
48+
@@ -17,12 +17,6 @@
49+
50+
#include "aegis128l_armcrypto.h"
51+
52+
-#ifdef __clang__
53+
-#pragma clang attribute push(__attribute__((target("neon,crypto,aes"))), apply_to = function)
54+
-#elif defined(__GNUC__)
55+
-#pragma GCC target("+simd+crypto")
56+
-#endif
57+
-
58+
#ifndef __ARM_FEATURE_CRYPTO
59+
#define __ARM_FEATURE_CRYPTO 1
60+
#endif
61+
@@ -32,6 +26,12 @@
62+
63+
#include <arm_neon.h>
64+
65+
+#ifdef __clang__
66+
+#pragma clang attribute push(__attribute__((target("neon,crypto,aes"))), apply_to = function)
67+
+#elif defined(__GNUC__)
68+
+#pragma GCC target("+simd+crypto")
69+
+#endif
70+
+
71+
#define AES_BLOCK_LENGTH 16
72+
73+
typedef uint8x16_t aes_block_t;
74+
diff --git a/src/libsodium/crypto_aead/aegis256/aegis256_armcrypto.c b/src/libsodium/crypto_aead/aegis256/aegis256_armcrypto.c
75+
index e1ebd577a2..058e2072b9 100644
76+
--- a/src/libsodium/crypto_aead/aegis256/aegis256_armcrypto.c
77+
+++ b/src/libsodium/crypto_aead/aegis256/aegis256_armcrypto.c
78+
@@ -17,12 +17,6 @@
79+
80+
#include "aegis256_armcrypto.h"
81+
82+
-#ifdef __clang__
83+
-#pragma clang attribute push(__attribute__((target("neon,crypto,aes"))), apply_to = function)
84+
-#elif defined(__GNUC__)
85+
-#pragma GCC target("+simd+crypto")
86+
-#endif
87+
-
88+
#ifndef __ARM_FEATURE_CRYPTO
89+
#define __ARM_FEATURE_CRYPTO 1
90+
#endif
91+
@@ -32,6 +26,12 @@
92+
93+
#include <arm_neon.h>
94+
95+
+#ifdef __clang__
96+
+#pragma clang attribute push(__attribute__((target("neon,crypto,aes"))), apply_to = function)
97+
+#elif defined(__GNUC__)
98+
+#pragma GCC target("+simd+crypto")
99+
+#endif
100+
+
101+
#define AES_BLOCK_LENGTH 16
102+
103+
typedef uint8x16_t aes_block_t;
104+
diff --git a/src/libsodium/crypto_aead/aes256gcm/armcrypto/aead_aes256gcm_armcrypto.c b/src/libsodium/crypto_aead/aes256gcm/armcrypto/aead_aes256gcm_armcrypto.c
105+
index ed2af303c3..8f9bba6d74 100644
106+
--- a/src/libsodium/crypto_aead/aes256gcm/armcrypto/aead_aes256gcm_armcrypto.c
107+
+++ b/src/libsodium/crypto_aead/aes256gcm/armcrypto/aead_aes256gcm_armcrypto.c
108+
@@ -19,12 +19,6 @@
109+
#define __vectorcall
110+
#endif
111+
112+
-#ifdef __clang__
113+
-#pragma clang attribute push(__attribute__((target("neon,crypto,aes"))), apply_to = function)
114+
-#elif defined(__GNUC__)
115+
-#pragma GCC target("+simd+crypto")
116+
-#endif
117+
-
118+
#ifndef __ARM_FEATURE_CRYPTO
119+
#define __ARM_FEATURE_CRYPTO 1
120+
#endif
121+
@@ -34,6 +28,12 @@
122+
123+
#include <arm_neon.h>
124+
125+
+#ifdef __clang__
126+
+#pragma clang attribute push(__attribute__((target("neon,crypto,aes"))), apply_to = function)
127+
+#elif defined(__GNUC__)
128+
+#pragma GCC target("+simd+crypto")
129+
+#endif
130+
+
131+
#define ABYTES crypto_aead_aes256gcm_ABYTES
132+
#define NPUBBYTES crypto_aead_aes256gcm_NPUBBYTES
133+
#define KEYBYTES crypto_aead_aes256gcm_KEYBYTES

0 commit comments

Comments
 (0)