-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
randen_hwaes compilation error on aarch64 #662
Comments
I also have one idea here - randen currently uses software AES when hardware AES is not supported, according to my benchmark, this is 10x slower on x64. What about using chacha (or speck if block cipher is desired) as the polyfill when hardware AES is not supported? |
It looks like the problem here is that https://github.com/abseil/abseil-cpp/blob/master/absl/copts/configure_copts.bzl has the symbol I think using ChaCha when hardware acceleration isn't available is a reasonable idea, but we likely won't be able to work on it for a while. I should also point out that |
|
Is there any work around for this? |
Towards #286 Workaround for abseil/abseil-cpp#662 PiperOrigin-RevId: 357990845
I see the same issue building for 32-bit ARM on an AArch64 platform (also using Buildroot). Note that Buildroot does not use the Bazel backend, but cmake. In the cmake files I do see that the The full command-line with output is:
The first But when I change the parameter to |
We're still looking in to this, though haven't prioritized it. PRs certainly welcome, as this is not a place we have significant expertise, though we are investigating solutions. |
With CMake compilation is working well: ./example/hello_world.cc #include <iostream>
#include <string>
#include <vector>
#include "absl/strings/str_join.h"
#include "absl/random/random.h"
int main() {
std::vector<std::string> v = {"foo", "bar", "baz"};
std::string s = absl::StrJoin(v, "-");
absl::BitGen bitgen;
std::cout << "Joined string: " << s << "\n";
std::cout << "Number: " << absl::Uniform(bitgen, 0, 1.0) << "\n";
return 0;
}
./CMakeLists.txt cmake_minimum_required(VERSION 3.5)
project(my_project)
# Abseil requires C++11
set(CMAKE_CXX_STANDARD 11)
# Process Abseil's CMake build system
add_subdirectory(abseil-cpp)
add_executable(hello_world hello_world.cc)
# Declare dependency on the absl::strings library
target_link_libraries(hello_world absl::strings)
target_link_libraries(hello_world absl::random_random) I have the issue only with Bazel: ./example/BUILD cc_binary(
name = "hello_world",
deps = ["@com_google_absl//absl/strings", "@com_google_absl//absl/random"],
srcs = ["hello_world.cc"],
) ./WORKSPACE load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "com_google_absl",
urls = ["https://github.com/abseil/abseil-cpp/archive/98eb410c93ad059f9bba1bf43f5bb916fc92a5ea.zip"],
strip_prefix = "abseil-cpp-98eb410c93ad059f9bba1bf43f5bb916fc92a5ea",
) ERROR
How can I redefine BUILD or WORKSPACE to make building successful? Thanks. |
This should be fixed by 2e94e5b. |
The error message is:
Looks like when crypto is not supported, the compiler cannot generate some instructions. Adding
-march=armv8-a+crypto
resolves the problem but forces hardware crypto.The text was updated successfully, but these errors were encountered: