Skip to content

Commit

Permalink
Add pagesize to compile flags when compiling for aarch64 to fix segme…
Browse files Browse the repository at this point in the history
…ntation faults on RPi5 (#488)
  • Loading branch information
schellingb committed May 31, 2024
1 parent 0f1cae4 commit 2dd7992
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,10 @@ else
COMMONFLAGS += -pthread
ifeq ($(CPUFLAGS),)
# ARM optimizations
PROCCPU := $(shell cat /proc/cpuinfo))
ifneq ($(and $(filter ARMv7,$(PROCCPU)),$(filter neon,$(PROCCPU))),)
UNAMEM := $(shell uname -m))
ifeq ($(UNAMEM),aarch64)
CPUFLAGS := -DPAGESIZE=$(or $(shell getconf PAGESIZE),4096)
else ifeq ($(UNAMEM),armv7l)
CPUFLAGS := -marm -mcpu=cortex-a72 -mfpu=neon-fp-armv8 -mfloat-abi=hard -ffast-math
else ifeq ($(ARM_RPI4), 1)
CPUFLAGS := -marm -mcpu=cortex-a72 -mfpu=neon-fp-armv8 -mfloat-abi=hard -ffast-math
Expand Down

0 comments on commit 2dd7992

Please sign in to comment.