Skip to content

Commit 09a0fbd

Browse files
authored
Merge pull request #3610 from cmitu/lzdoom-armed
lzdoom: fix the build for RPI1/ARMv6 platforms
2 parents 5b2b962 + caf332b commit 09a0fbd

File tree

3 files changed

+45
-4
lines changed

3 files changed

+45
-4
lines changed

scriptmodules/ports/lzdoom.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,19 @@ function depends_lzdoom() {
2727

2828
function sources_lzdoom() {
2929
gitPullOrClone
30+
if isPlatform "arm"; then
31+
# patch the CMake build file to remove the ARMv8 options, we handle `gcc`'s CPU flags ourselves
32+
applyPatch "$md_data/01_remove_cmake_arm_options.diff"
33+
# patch the 21.06 version of LZMA-SDK to disable the CRC32 ARMv8 intrinsics forced for ARM CPUs
34+
applyPatch "$md_data/02_lzma_sdk_dont_force_arm_crc32.diff"
35+
fi
3036
}
3137

3238
function build_lzdoom() {
3339
rm -rf release
3440
mkdir -p release
3541
cd release
36-
local params=(-DCMAKE_INSTALL_PREFIX="$md_inst" -DCMAKE_BUILD_TYPE=Release)
37-
if isPlatform "armv8"; then
38-
params+=(-DUSE_ARMV8=On)
39-
fi
42+
local params=(-DCMAKE_INSTALL_PREFIX="$md_inst" -DPK3_QUIET_ZIPDIR=ON -DCMAKE_BUILD_TYPE=Release)
4043
# Note: `-funsafe-math-optimizations` should be avoided, see: https://forum.zdoom.org/viewtopic.php?f=7&t=57781
4144
cmake "${params[@]}" ..
4245
make
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
2+
index 5b3e777..0bce388 100644
3+
--- a/src/CMakeLists.txt
4+
+++ b/src/CMakeLists.txt
5+
@@ -334,16 +334,6 @@ if( ZD_CMAKE_COMPILER_IS_GNUCXX_COMPATIBLE )
6+
set( CMAKE_C_FLAGS "-Wall -Wextra -Wno-unused -Wno-unused-parameter -Wno-missing-field-initializers -ffp-contract=off ${CMAKE_C_FLAGS}" )
7+
set( CMAKE_CXX_FLAGS "-Wall -Wextra -Wno-unused -Wno-unused-parameter -Wno-missing-field-initializers -ffp-contract=off ${CMAKE_CXX_FLAGS}" )
8+
9+
- # ARM processors (Raspberry Pi, et al) - enable ARM NEON support.
10+
- if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm")
11+
- set (USE_ARMV8 0 CACHE BOOL "Use ARMv8 instructions - Raspberry Pi 3")
12+
- if (USE_ARMV8)
13+
- set( CMAKE_CXX_FLAGS "-mcpu=cortex-a53 -mfpu=neon-fp-armv8 -mtune=cortex-a53 -mhard-float -DNO_SSE ${CMAKE_CXX_FLAGS}" )
14+
- else ()
15+
- set( CMAKE_CXX_FLAGS "-mcpu=cortex-a7 -mfpu=neon-vfpv4 -mtune=cortex-a7 -mhard-float -DNO_SSE ${CMAKE_CXX_FLAGS}" )
16+
- endif ()
17+
- endif ()
18+
-
19+
if( NOT X64 AND NOT CAN_DO_MFPMATH )
20+
set( CMAKE_C_FLAGS "-DNO_SSE ${CMAKE_C_FLAGS}" )
21+
set( CMAKE_CXX_FLAGS "-DNO_SSE ${CMAKE_CXX_FLAGS}" )
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
diff --git a/libraries/lzma/C/7zCrc.c b/libraries/lzma/C/7zCrc.c
2+
index f186324..f3ae7be 100644
3+
--- a/libraries/lzma/C/7zCrc.c
4+
+++ b/libraries/lzma/C/7zCrc.c
5+
@@ -83,12 +83,6 @@ UInt32 MY_FAST_CALL CrcUpdateT1(UInt32 v, const void *data, size_t size, const U
6+
#endif
7+
#elif (defined(__clang__) && (__clang_major__ >= 3)) \
8+
|| (defined(__GNUC__) && (__GNUC__ > 4))
9+
- #if !defined(__ARM_FEATURE_CRC32)
10+
- #define __ARM_FEATURE_CRC32 1
11+
- #if (!defined(__clang__) || (__clang_major__ > 3)) // fix these numbers
12+
- #define ATTRIB_CRC __attribute__((__target__("arch=armv8-a+crc")))
13+
- #endif
14+
- #endif
15+
#if defined(__ARM_FEATURE_CRC32)
16+
#define USE_ARM64_CRC
17+
#include <arm_acle.h>

0 commit comments

Comments
 (0)