aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2020-08-05 17:43:51 -0700
committerChris Robinson <[email protected]>2020-08-05 17:43:51 -0700
commit58a2a5e2e3cf3c9ecdc261a38ff9da227a5d4a1c (patch)
tree9fcd4bee732ce5ba9a0538eacff7649ea73dbd8b /CMakeLists.txt
parent816510fee7ac6cac5733660319e5a647f247362c (diff)
Add a comment about 32-bit GCC stack aligning with SSE codegen
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt4
1 files changed, 4 insertions, 0 deletions
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)