Skip to content

Commit

Permalink
Merge pull request zcash#6879 from zcash/llvm-18
Browse files Browse the repository at this point in the history
Migrate to LLVM 18
  • Loading branch information
str4d authored May 5, 2024
2 parents f2823bc + 3a6bd8a commit 2bbaff9
Show file tree
Hide file tree
Showing 27 changed files with 239 additions and 116 deletions.
File renamed without changes.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ Makefile
# Rust
.cargo/.configured-for-*
.cargo/config
.cargo/config.toml
src/rust/gen/
target/

Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ repository = "https://github.com/zcash/zcash"
readme = "README.md"
license = "MIT OR Apache-2.0"
edition = "2018"
rust-version = "1.69"
rust-version = "1.78"

[package.metadata.vet]
store = { path = "./qa/supply-chain" }
Expand Down
7 changes: 5 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@ DESIRED_WARNING_CXXFLAGS="\
# same as fields
# • `-Wno-string-conversion`: currently abused to `assert` on strings
# • `-Wno-tautological-type-limit-compare`: I think isn’t portable because of numeric type sizing
# • `-Wno-unsafe-buffer-usage`: Added in Clang 16, needs consideration
DISABLED_WARNING_CXXFLAGS="\
-Wno-c++20-compat -Wno-cast-align -Wno-cast-qual -Wno-comma -Wno-conditional-uninitialized \
-Wno-covered-switch-default -Wno-ctad-maybe-unsupported \
Expand All @@ -370,11 +371,13 @@ DISABLED_WARNING_CXXFLAGS="\
-Wno-redundant-parens -Wno-reorder-ctor -Wno-reserved-id-macro -Wno-reserved-identifier \
-Wno-return-type -Wno-shadow -Wno-shadow-field -Wno-shadow-field-in-constructor \
-Wno-shift-sign-overflow -Wno-shorten-64-to-32 -Wno-sign-compare -Wno-sign-conversion \
-Wno-string-conversion -Wno-suggest-destructor-override -Wno-suggest-override -Wno-switch-enum \
-Wno-string-conversion -Wno-suggest-destructor-override -Wno-suggest-override \
-Wno-switch-default -Wno-switch-enum \
-Wno-tautological-type-limit-compare -Wno-tautological-unsigned-enum-zero-compare \
-Wno-tautological-unsigned-zero-compare -Wno-thread-safety-attributes \
-Wno-thread-safety-negative -Wno-undef -Wno-undefined-func-template -Wno-uninitialized \
-Wno-unreachable-code -Wno-unreachable-code-break -Wno-unreachable-code-return \
-Wno-unsafe-buffer-usage \
-Wno-unused-but-set-variable -Wno-unused-exception-parameter -Wno-unused-function \
-Wno-unused-macros -Wno-unused-member-function -Wno-unused-parameter -Wno-unused-private-field \
-Wno-unused-template -Wno-unused-variable -Wno-used-but-marked-unused -Wno-weak-vtables \
Expand All @@ -401,7 +404,7 @@ REENABLED_WARNING_CXXFLAGS="\
-Wmicrosoft-comment-paste -Wmicrosoft-cpp-macro -Wmicrosoft-end-of-file -Wmicrosoft-enum-value \
-Wmicrosoft-fixed-enum -Wmicrosoft-flexible-array -Wmicrosoft-redeclare-static \
-Wnested-anon-types -Wnullability-extension -Wobjc-signed-char-bool-implicit-int-conversion \
-Woverlength-strings -Wpre-c++2b-compat -Wretained-language-linkage \
-Woverlength-strings -Wpre-c++20-compat -Wretained-language-linkage \
-Wshadow-field-in-constructor-modified -Wshadow-ivar -Wsometimes-uninitialized \
-Wstatic-self-init -Wundefined-internal-type -Wunneeded-member-function \
-Wunreachable-code-fallthrough -Wunreachable-code-generic-assoc -Wunreachable-code-loop-increment"
Expand Down
2 changes: 1 addition & 1 deletion contrib/devtools/update-clang-hashes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
CLANG_PACKAGE="$SCRIPT_DIR/../../depends/packages/native_clang.mk"
LIBCXX_PACKAGE="$SCRIPT_DIR/../../depends/packages/libcxx.mk"

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

update_clang_hash() {
Expand Down
12 changes: 6 additions & 6 deletions depends/packages/libcxx.mk
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package=libcxx
$(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)))
$(package)_msys2_version=15.0.7-3
$(package)_msys2_version=18.1.4-1

ifneq ($(canonical_host),$(build))
ifneq ($(host_os),mingw32)
Expand All @@ -9,10 +9,10 @@ ifneq ($(host_os),mingw32)
$(package)_download_path=$(native_clang_download_path)
$(package)_download_file_aarch64_linux=clang+llvm-$($(package)_version)-aarch64-linux-gnu.tar.xz
$(package)_file_name_aarch64_linux=clang-llvm-$($(package)_version)-aarch64-linux-gnu.tar.xz
$(package)_sha256_hash_aarch64_linux=8ca4d68cf103da8331ca3f35fe23d940c1b78fb7f0d4763c1c059e352f5d1bec
$(package)_download_file_linux=clang+llvm-$($(package)_version)-x86_64-linux-gnu-ubuntu-18.04.tar.xz
$(package)_file_name_linux=clang-llvm-$($(package)_version)-x86_64-linux-gnu-ubuntu-18.04.tar.xz
$(package)_sha256_hash_linux=38bc7f5563642e73e69ac5626724e206d6d539fbef653541b34cae0ba9c3f036
$(package)_sha256_hash_aarch64_linux=8c2f4d1606d24dc197a590acce39453abe7a302b9b92e762108f9b5a9701b1df
$(package)_download_file_linux=clang+llvm-$($(package)_version)-x86_64-linux-gnu-ubuntu-22.04.tar.xz
$(package)_file_name_linux=clang-llvm-$($(package)_version)-x86_64-linux-gnu-ubuntu-22.04.tar.xz
$(package)_sha256_hash_linux=1607375b4aa2aec490b6db51846a04b265675a87e925bcf5825966401ff9b0b1

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

define $(package)_stage_cmds
mkdir -p $($(package)_staging_prefix_dir)/lib && \
Expand Down
2 changes: 1 addition & 1 deletion depends/packages/libevent.mk
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ endef
# version as we do in configure. Due to quirks in libevents build system, this
# is also required to enable support for ipv6. See #19375.
define $(package)_set_vars
$(package)_config_opts=--disable-shared --disable-openssl --disable-libevent-regress
$(package)_config_opts=--disable-shared --disable-openssl --disable-libevent-regress --disable-samples
$(package)_config_opts += --disable-dependency-tracking --enable-option-checking
$(package)_config_opts_release=--disable-debug-mode
$(package)_config_opts_linux=--with-pic
Expand Down
3 changes: 2 additions & 1 deletion depends/packages/libsodium.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ $(package)_download_path=https://download.libsodium.org/libsodium/releases/
$(package)_file_name=$(package)-$($(package)_version).tar.gz
$(package)_sha256_hash=018d79fe0a045cca07331d37bd0cb57b2e838c51bc48fd837a1472e50068bbea
$(package)_dependencies=
$(package)_patches=1.0.15-pubkey-validation.diff 1.0.15-signature-validation.diff
$(package)_patches=1.0.15-pubkey-validation.diff 1.0.15-signature-validation.diff 1321-aarch64-fix-compiler-attributes.patch
$(package)_config_opts=

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

Expand Down
16 changes: 10 additions & 6 deletions depends/packages/native_clang.mk
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@ package=native_clang
# - Manually fix the versions for packages that don't exist (the LLVM project
# doesn't uniformly cut binaries across releases).
# The Clang compiler should use the same LLVM version as the Rust compiler.
$(package)_default_major_version=15
$(package)_default_version=15.0.6
$(package)_default_major_version=18
$(package)_default_version=18.1.4
# 2024-05-03: No Intel macOS packages are available for Clang 16, 17, or 18.
$(package)_major_version_darwin=15
$(package)_version_darwin=15.0.4
# 2023-02-16: No FreeBSD packages are available for Clang 15.
# 2023-04-07: Still the case.
# 2024-05-03: No FreeBSD packages are available for Clang 17 or 18.
# Clang 16 has FreeBSD 13 packages, but none for FreeBSD 12.
$(package)_major_version_freebsd=14
$(package)_version_freebsd=14.0.6

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

ifneq (,$(wildcard /etc/arch-release))
$(package)_dependencies=native_libtinfo
ifeq ($(build_os),linux)
$(package)_dependencies=native_libtinfo5
endif

# Ensure we have clang native to the builder, not the target host
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
package=native_tinfo
$(package)_version=5.6.0
$(package)_download_path_linux=http://ftp.debian.org/debian/pool/main/n/ncurses/
$(package)_download_file_linux=libtinfo5_6.0+20161126-1+deb9u2_amd64.deb
$(package)_file_name_linux=libtinfo5_6.0+20161126-1+deb9u2_amd64.deb
$(package)_sha256_hash_linux=1d249a3193568b5ef785ad8993b9ba6d6fdca0eb359204c2355532b82d25e9f5
package=native_libtinfo5
$(package)_version=6.2

# We only enable this if build_os is linux.
$(package)_download_path=http://ftp.debian.org/debian/pool/main/n/ncurses/
$(package)_download_file=libtinfo5_$($(package)_version)+20201114-2+deb11u2_amd64.deb
$(package)_file_name=libtinfo5-$($(package)_version).deb
$(package)_sha256_hash=69e131ce3f790a892ca1b0ae3bfad8659daa2051495397eee1b627d9783a6797

define $(package)_extract_cmds
mkdir -p $($(package)_extract_dir) && \
echo "$($(package)_sha256_hash) $($(package)_source)" > $($(package)_extract_dir)/.$($(package)_file_name).hash && \
$(build_SHA256SUM) -c $($(package)_extract_dir)/.$($(package)_file_name).hash && \
mkdir -p libtinfo5 && \
ar x --output libtinfo5 $($(package)_source_dir)/$($(package)_file_name) && \
cd libtinfo5 && \
ar x $($(package)_source_dir)/$($(package)_file_name) && \
tar xf data.tar.xz
endef

Expand Down
18 changes: 9 additions & 9 deletions depends/packages/native_rust.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ package=native_rust
# ./contrib/devtools/update-rust-hashes.sh
# The Rust compiler should use the same LLVM version as the Clang compiler; you
# can check this with `rustc --version -v`.
$(package)_version=1.69.0
$(package)_version=1.78.0
$(package)_download_path=https://static.rust-lang.org/dist
$(package)_file_name_linux=rust-$($(package)_version)-x86_64-unknown-linux-gnu.tar.gz
$(package)_sha256_hash_linux=2ca4a306047c0b8b4029c382910fcbc895badc29680e0332c9df990fd1c70d4f
$(package)_sha256_hash_linux=1307747915e8bd925f4d5396ab2ae3d8d9c7fad564afbc358c081683d0f22e87
$(package)_file_name_darwin=rust-$($(package)_version)-x86_64-apple-darwin.tar.gz
$(package)_sha256_hash_darwin=9818dab2c3726d63dfbfde12c9273e62e484ef6d6f6e05a6431a3e089c335454
$(package)_sha256_hash_darwin=6c91ed3bd90253961fcb4a2991b8b22e042e2aaa9aba9f389f1e17008171d898
$(package)_file_name_freebsd=rust-$($(package)_version)-x86_64-unknown-freebsd.tar.gz
$(package)_sha256_hash_freebsd=2985d98910b4a1dd336bfc7a1ac3b18082ed917cff097b4db6f0d6602016c289
$(package)_sha256_hash_freebsd=b9cc84c60deb8da08a6c876426f8721758f4c7e7c553b4554385752ad37c63df
$(package)_file_name_aarch64_linux=rust-$($(package)_version)-aarch64-unknown-linux-gnu.tar.gz
$(package)_sha256_hash_aarch64_linux=88af5aa7a40c8f1b40416a1f27de8ffbe09c155d933f69d3e109c0ccee92353b
$(package)_sha256_hash_aarch64_linux=131eda738cd977fff2c912e5838e8e9b9c260ecddc1247c0fe5473bf09c594af

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

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

define rust_target
$(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))))
Expand Down
4 changes: 2 additions & 2 deletions depends/packages/packages.mk
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ zcash_packages := libsodium rustcxx utfcpp tl_expected
packages := boost libevent zeromq $(zcash_packages) googletest
native_packages := native_clang native_ccache native_cmake native_rust native_cxxbridge native_zstd

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

wallet_packages=bdb
Expand Down
133 changes: 133 additions & 0 deletions depends/patches/libsodium/1321-aarch64-fix-compiler-attributes.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
From 8f453f41f8834e0fe47610f2a3e03e696ddb3450 Mon Sep 17 00:00:00 2001
From: Frank Denis <[email protected]>
Date: Fri, 20 Oct 2023 13:47:57 +0200
Subject: [PATCH] aarch64: set compiler attributes *after* including
<arm_neon.h>

Fixes #1321
---
configure.ac | 11 ++++++-----
.../crypto_aead/aegis128l/aegis128l_armcrypto.c | 12 ++++++------
.../crypto_aead/aegis256/aegis256_armcrypto.c | 12 ++++++------
.../aes256gcm/armcrypto/aead_aes256gcm_armcrypto.c | 12 ++++++------
4 files changed, 24 insertions(+), 23 deletions(-)

diff --git a/configure.ac b/configure.ac
index 287e109cd7..e792f67139 100644
--- a/configure.ac
+++ b/configure.ac
@@ -397,11 +397,6 @@ AS_IF([test "x$EMSCRIPTEN" = "x"], [
have_armcrypto=no
AC_MSG_CHECKING(for ARM crypto instructions set)
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
- #ifdef __clang__
- # pragma clang attribute push(__attribute__((target("neon,crypto,aes"))), apply_to = function)
- #elif defined(__GNUC__)
- # pragma GCC target("+simd+crypto")
- #endif
#ifndef __ARM_FEATURE_CRYPTO
# define __ARM_FEATURE_CRYPTO 1
#endif
@@ -410,6 +405,12 @@ AS_IF([test "x$EMSCRIPTEN" = "x"], [
#endif

#include <arm_neon.h>
+
+ #ifdef __clang__
+ # pragma clang attribute push(__attribute__((target("neon,crypto,aes"))), apply_to = function)
+ #elif defined(__GNUC__)
+ # pragma GCC target("+simd+crypto")
+ #endif
]], [[
int64x2_t x = { 0, 0 };
vaeseq_u8(vmovq_n_u8(0), vmovq_n_u8(0));
diff --git a/src/libsodium/crypto_aead/aegis128l/aegis128l_armcrypto.c b/src/libsodium/crypto_aead/aegis128l/aegis128l_armcrypto.c
index 825de8a1c8..a01f60cbe6 100644
--- a/src/libsodium/crypto_aead/aegis128l/aegis128l_armcrypto.c
+++ b/src/libsodium/crypto_aead/aegis128l/aegis128l_armcrypto.c
@@ -17,12 +17,6 @@

#include "aegis128l_armcrypto.h"

-#ifdef __clang__
-#pragma clang attribute push(__attribute__((target("neon,crypto,aes"))), apply_to = function)
-#elif defined(__GNUC__)
-#pragma GCC target("+simd+crypto")
-#endif
-
#ifndef __ARM_FEATURE_CRYPTO
#define __ARM_FEATURE_CRYPTO 1
#endif
@@ -32,6 +26,12 @@

#include <arm_neon.h>

+#ifdef __clang__
+#pragma clang attribute push(__attribute__((target("neon,crypto,aes"))), apply_to = function)
+#elif defined(__GNUC__)
+#pragma GCC target("+simd+crypto")
+#endif
+
#define AES_BLOCK_LENGTH 16

typedef uint8x16_t aes_block_t;
diff --git a/src/libsodium/crypto_aead/aegis256/aegis256_armcrypto.c b/src/libsodium/crypto_aead/aegis256/aegis256_armcrypto.c
index e1ebd577a2..058e2072b9 100644
--- a/src/libsodium/crypto_aead/aegis256/aegis256_armcrypto.c
+++ b/src/libsodium/crypto_aead/aegis256/aegis256_armcrypto.c
@@ -17,12 +17,6 @@

#include "aegis256_armcrypto.h"

-#ifdef __clang__
-#pragma clang attribute push(__attribute__((target("neon,crypto,aes"))), apply_to = function)
-#elif defined(__GNUC__)
-#pragma GCC target("+simd+crypto")
-#endif
-
#ifndef __ARM_FEATURE_CRYPTO
#define __ARM_FEATURE_CRYPTO 1
#endif
@@ -32,6 +26,12 @@

#include <arm_neon.h>

+#ifdef __clang__
+#pragma clang attribute push(__attribute__((target("neon,crypto,aes"))), apply_to = function)
+#elif defined(__GNUC__)
+#pragma GCC target("+simd+crypto")
+#endif
+
#define AES_BLOCK_LENGTH 16

typedef uint8x16_t aes_block_t;
diff --git a/src/libsodium/crypto_aead/aes256gcm/armcrypto/aead_aes256gcm_armcrypto.c b/src/libsodium/crypto_aead/aes256gcm/armcrypto/aead_aes256gcm_armcrypto.c
index ed2af303c3..8f9bba6d74 100644
--- a/src/libsodium/crypto_aead/aes256gcm/armcrypto/aead_aes256gcm_armcrypto.c
+++ b/src/libsodium/crypto_aead/aes256gcm/armcrypto/aead_aes256gcm_armcrypto.c
@@ -19,12 +19,6 @@
#define __vectorcall
#endif

-#ifdef __clang__
-#pragma clang attribute push(__attribute__((target("neon,crypto,aes"))), apply_to = function)
-#elif defined(__GNUC__)
-#pragma GCC target("+simd+crypto")
-#endif
-
#ifndef __ARM_FEATURE_CRYPTO
#define __ARM_FEATURE_CRYPTO 1
#endif
@@ -34,6 +28,12 @@

#include <arm_neon.h>

+#ifdef __clang__
+#pragma clang attribute push(__attribute__((target("neon,crypto,aes"))), apply_to = function)
+#elif defined(__GNUC__)
+#pragma GCC target("+simd+crypto")
+#endif
+
#define ABYTES crypto_aead_aes256gcm_ABYTES
#define NPUBBYTES crypto_aead_aes256gcm_NPUBBYTES
#define KEYBYTES crypto_aead_aes256gcm_KEYBYTES
Loading

0 comments on commit 2bbaff9

Please sign in to comment.