Fix compiling for MUSL/ARM.

This commit is contained in:
2021-10-24 05:09:48 +01:00
parent 64ed30e13d
commit 33fb237ac7
2 changed files with 4 additions and 3 deletions

View File

@@ -65,9 +65,9 @@ if("${CMAKE_BUILD_TYPE}" MATCHES "Release")
if(NOT "${CMAKE_C_PLATFORM_ID}" MATCHES "MinGW")
add_compile_options(-flto)
endif()
elseif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "armv7l")
elseif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "armv7l" OR ${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm")
if(NOT "${CMAKE_C_COMPILER_ID}" MATCHES "AppleClang")
add_compile_options(-march=armv7)
add_compile_options(-march=armv7+fp -mfpu=vfpv3-d16)
endif()
endif()
endif()

View File

@@ -92,12 +92,13 @@ mv libAaru.Compression.Native.so runtimes/linux-mips64/native/
## Linux (ARM), musl
# Detected system processor: arm
# /work/3rdparty/lzma-21.03beta/C/7zCrc.c:159:1: error: -mfloat-abi=hard: selected processor lacks an FPU
rm -f CMakeCache.txt
mkdir -p runtimes/linux-musl-arm/native
docker run --rm dockcross/linux-armv7l-musl >docker/dockcross-linux-musl-arm
chmod +x docker/dockcross-linux-musl-arm
docker/dockcross-linux-musl-arm cmake -DCMAKE_BUILD_TYPE=Release -DAARU_BUILD_PACKAGE=1 -DCMAKE_POLICY_DEFAULT_CMP0077=NEW -DCMAKE_POLICY_DEFAULT_CMP0069=NEW .
sed -e 's/\-fno-fat-lto-objects\s//g' ./3rdparty/lzfse/CMakeFiles/lzfse.dir/flags.make > flags.make
mv flags.make ./3rdparty/lzfse/CMakeFiles/lzfse.dir/flags.make
docker/dockcross-linux-musl-arm make Aaru.Compression.Native
mv libAaru.Compression.Native.so runtimes/linux-musl-arm/native/