Skip to content
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

how to use fuzztest on Android(aarch64) #658

Open
o0xmuhe opened this issue Oct 24, 2023 · 0 comments
Open

how to use fuzztest on Android(aarch64) #658

o0xmuhe opened this issue Oct 24, 2023 · 0 comments

Comments

@o0xmuhe
Copy link

o0xmuhe commented Oct 24, 2023

Hi, I'm trying to follow the tutorial to build fuzztest for Android(aarch64), but I failed, here is my CMakeLists.txt

cmake_minimum_required(VERSION 3.19)
project(first_fuzz_project)

set(CMAKE_CXX_STANDARD 17)

add_subdirectory(fuzztest)

enable_testing()

include(GoogleTest)

add_executable(
  first_fuzz_test
  first_fuzz_test.cc
)

set(ANDROID_API_VER 29)
set(ABARCH1 arm64)
set(CMAKE_SYSTEM_PROCESSOR aarch64)
set(NDK /home/muhe/Android/Sdk/ndk/21.1.6352462/)
set(CROSS_SYSROOT "${NDK}/platforms/android-${ANDROID_API_VER}/arch-${ABARCH1}")
set(BUILD_ARCH linux-x86_64)

set(TC_PATH ${NDK}/toolchains/llvm/prebuilt/${BUILD_ARCH})
set(TC_BASE ${TC_PATH}/bin/${CMAKE_SYSTEM_PROCESSOR}-linux-android)
set(PLATFORM android)
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_C_COMPILER "${TC_BASE}${ANDROID_API_VER}-clang")
set(CMAKE_CXX_COMPILER "${TC_BASE}${ANDROID_API_VER}-clang++")
set(CMAKE_STAGING_PREFIX "${CROSS_SYSROOT}")

set(CMAKE_FIND_ROOT_PATH "${CROSS_SYSROOT}")
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

link_fuzztest(first_fuzz_test)
gtest_discover_tests(first_fuzz_test)

It seems fuzztest now only support x86:

  • _deps will build for x86_64, not aarch64 as I specified, so I will get error as following:
_deps/re2-build/libre2.a(compile.cc.o) is incompatible with aarch64linux
  • fuzztest will link -lrt, so I just deleted all the -lrt to continuing the building process

So does fuzztest currently support aarch64? Or will aarch64 be supported in the future?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant