From 58a2a5e2e3cf3c9ecdc261a38ff9da227a5d4a1c Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Wed, 5 Aug 2020 17:43:51 -0700 Subject: Add a comment about 32-bit GCC stack aligning with SSE codegen --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index b59bdf71..f02dc89a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -364,6 +364,10 @@ if(CMAKE_SIZEOF_VOID_P MATCHES "4" AND (SSE2_SWITCH OR MSVC)) set(C_FLAGS ${C_FLAGS} ${SSE_FLAGS}) set(FPMATH_SET 2) endif() + # SSE depends on a 16-byte aligned stack, and by default, GCC + # assumes the stack is suitably aligned. Older Linux code or other + # OSs don't guarantee this on 32-bit, so externally-callable + # functions need to ensure an aligned stack. set(EXPORT_DECL "${EXPORT_DECL} __attribute__((force_align_arg_pointer))") elseif(MSVC) check_c_compiler_flag("/arch:SSE2" HAVE_ARCH_SSE2) -- cgit v1.2.3