Skip to content

Commit 6c9c234

Browse files
authored
make : use unaligned vector moves on MinGW (#2945)
Fixes #2922
1 parent ee8654b commit 6c9c234

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,14 @@ ifeq ($(UNAME_M),$(filter $(UNAME_M),x86_64 i686 amd64))
177177
#CXXFLAGS += -mssse3
178178
endif
179179

180+
# The stack is only 16-byte aligned on Windows, so don't let gcc emit aligned moves.
181+
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54412
182+
# https://github.com/ggerganov/llama.cpp/issues/2922
183+
ifneq '' '$(findstring mingw,$(shell $(CC) -dumpmachine))'
184+
CFLAGS += -Xassembler -muse-unaligned-vector-move
185+
CXXFLAGS += -Xassembler -muse-unaligned-vector-move
186+
endif
187+
180188
ifneq ($(filter aarch64%,$(UNAME_M)),)
181189
# Apple M1, M2, etc.
182190
# Raspberry Pi 3, 4, Zero 2 (64-bit)

0 commit comments

Comments
 (0)