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

[Feature Request] Compile for android via termux arm64 and for raspberry arm32/arm64 #187

Open
yashikada opened this issue Aug 19, 2024 · 2 comments

Comments

@yashikada
Copy link

I would like to use securefs on Android via termux and on Raspberry, but the compilation is not successful, could you provide the already compiled binaries?

@netheril96
Copy link
Owner

How did you compile and what are the error messages?

I don't have an Android with termux or Raspberry, so I cannot build it for you.

@yashikada
Copy link
Author

for build you can use crosscompiling, github actions has it.
For raspberry I use debian which has securefs old versions.
I cloned your repository and microsoft/vcpkg, I used your python script build.py for build, the same parameters used on github action.
On raspberry stuck on bootstrapping for hours, while on termux I got this error:

python build.py --lto --enable_unit_test --enable_integration_test --vcpkg_root=$PWD/../vcpkg --build_root=./build 
Executing ('cmake', '-DCMAKE_BUILD_TYPE=Release', '-DCMAKE_TOOLCHAIN_FILE=/data/data/com.termux/files/home/xxx/securefs/../vcpkg/scripts/buildsystems/vcpkg.cmake', '-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON', '-DVCPKG_OVERLAY_TRIPLETS=/data/data/com.termux/files/home/xxx/securefs/overlay_triplets', '/data/data/com.termux/files/home/xxx/securefs')
-- Running vcpkg install
Detecting compiler hash for triplet arm64-android...
error: while detecting compiler information:
The log file content at "/data/data/com.termux/files/home/xxx/vcpkg/buildtrees/detect_compiler/stdout-arm64-android.log" is:
-- Configuring arm64-android-rel
CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:127 (message):
    Command failed: /data/data/com.termux/files/usr/bin/cmake /data/data/com.termux/files/home/xxx/vcpkg/scripts/detect_compiler -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/data/data/com.termux/files/home/xxx/vcpkg/packages/detect_compiler_arm64-android -DCMAKE_SYSTEM_NAME=Android -DCMAKE_SYSTEM_VERSION=21 -DBUILD_SHARED_LIBS=OFF -DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=/data/data/com.termux/files/home/xxx/vcpkg/scripts/toolchains/android.cmake -DVCPKG_TARGET_TRIPLET=arm64-android -DVCPKG_SET_CHARSET_FLAG=ON -DVCPKG_PLATFORM_TOOLSET=external -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON -DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON -DCMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY=ON -DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=TRUE -DCMAKE_VERBOSE_MAKEFILE=ON -DVCPKG_APPLOCAL_DEPS=OFF -DCMAKE_TOOLCHAIN_FILE=/data/data/com.termux/files/home/xxx/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION=ON -DVCPKG_CXX_FLAGS= -DVCPKG_CXX_FLAGS_RELEASE= -DVCPKG_CXX_FLAGS_DEBUG= -DVCPKG_C_FLAGS= -DVCPKG_C_FLAGS_RELEASE= -DVCPKG_C_FLAGS_DEBUG= -DVCPKG_CRT_LINKAGE=static -DVCPKG_LINKER_FLAGS= -DVCPKG_LINKER_FLAGS_RELEASE= -DVCPKG_LINKER_FLAGS_DEBUG= -DVCPKG_TARGET_ARCHITECTURE=arm64 -DCMAKE_INSTALL_LIBDIR:STRING=lib -DCMAKE_INSTALL_BINDIR:STRING=bin -D_VCPKG_ROOT_DIR=/data/data/com.termux/files/home/xxx/vcpkg -DZ_VCPKG_ROOT_DIR=/data/data/com.termux/files/home/xxx/vcpkg -D_VCPKG_INSTALLED_DIR=/data/data/com.termux/files/home/xxx/securefs/build/vcpkg_installed -DVCPKG_MANIFEST_INSTALL=OFF -DANDROID_ABI=arm64-v8a
    Working Directory: /data/data/com.termux/files/home/xxx/vcpkg/buildtrees/detect_compiler/arm64-android-rel
    Error code: 1
    See logs for more information:
      /data/data/com.termux/files/home/xxx/vcpkg/buildtrees/detect_compiler/config-arm64-android-rel-CMakeCache.txt.log
      /data/data/com.termux/files/home/xxx/vcpkg/buildtrees/detect_compiler/config-arm64-android-rel-out.log
      /data/data/com.termux/files/home/xxx/vcpkg/buildtrees/detect_compiler/config-arm64-android-rel-err.log

Call Stack (most recent call first):
  scripts/cmake/vcpkg_configure_cmake.cmake:344 (vcpkg_execute_required_process)
  scripts/detect_compiler/portfile.cmake:18 (vcpkg_configure_cmake)
  scripts/ports.cmake:192 (include)


error: vcpkg was unable to detect the active compiler's information. See above for the CMake failure output.
-- Running vcpkg install - failed
CMake Error at /data/data/com.termux/files/home/xxx/vcpkg/scripts/buildsystems/vcpkg.cmake:904 (message):
  vcpkg install failed.  See logs for more information:
  /data/data/com.termux/files/home/xxx/securefs/build/vcpkg-manifest-install.log
Call Stack (most recent call first):
  /data/data/com.termux/files/usr/share/cmake-3.30/Modules/CMakeDetermineSystem.cmake:146 (include)
  CMakeLists.txt:22 (project)


CMake Error: CMake was unable to find a build program corresponding to "Unix Makefiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
Traceback (most recent call last):
  File "/data/data/com.termux/files/home/xxx/securefs/build.py", line 137, in <module>
    main()
  File "/data/data/com.termux/files/home/xxx/securefs/build.py", line 124, in main
    check_call(*configure_args)
  File "/data/data/com.termux/files/home/xxx/securefs/build.py", line 12, in check_call
    subprocess.check_call(args)
  File "/data/data/com.termux/files/usr/lib/python3.11/subprocess.py", line 413, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '('cmake', '-DCMAKE_BUILD_TYPE=Release', '-DCMAKE_TOOLCHAIN_FILE=/data/data/com.termux/files/home/xxx/securefs/../vcpkg/scripts/buildsystems/vcpkg.cmake', '-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON', '-DVCPKG_OVERLAY_TRIPLETS=/data/data/com.termux/files/home/xxx/securefs/overlay_triplets', '/data/data/com.termux/files/home/xxx/securefs')' returned non-zero exit status 1.

I set the environment variable VCPKG_FORCE_SYSTEM_BINARIES = arm as suggested from bootstrapping

dpkg -l | grep clan
ii  clang                      18.1.8         aarch64      C language frontend for LLVM
ii  libcompiler-rt             18.1.8         aarch64      Compiler runtime libraries for clang

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

2 participants