[SDK] gcc.cmake: Only add -mstackrealign on i386 (#4016)
authorKonrad Dybcio <32096130+konradybcio@users.noreply.github.com>
Sat, 16 Oct 2021 08:58:08 +0000 (10:58 +0200)
committerGitHub <noreply@github.com>
Sat, 16 Oct 2021 08:58:08 +0000 (11:58 +0300)
This option is only useful for the i386 architecture and breaks ARM builds.

Reviewed-by: Victor Perevertkin <victor.perevertkin@reactos.org>
Reviewed-by: Stanislav Motylkov <x86corez@gmail.com>
Signed-off-by: Konrad Dybcio <konrad.dybcio@somainline.org>
sdk/cmake/gcc.cmake

index cb20227..65085ab 100644 (file)
@@ -45,8 +45,6 @@ add_compile_options(-pipe -fms-extensions -fno-strict-aliasing)
 # The case for C++ is handled through the reactos_c++ INTERFACE library
 add_compile_options("$<$<NOT:$<COMPILE_LANGUAGE:CXX>>:-nostdinc>")
 
-add_compile_options(-mstackrealign)
-
 if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
     add_compile_options(-fno-aggressive-loop-optimizations)
     if (DBG)
@@ -145,7 +143,7 @@ if(LTCG)
 endif()
 
 if(ARCH STREQUAL "i386")
-    add_compile_options(-fno-optimize-sibling-calls -fno-omit-frame-pointer)
+    add_compile_options(-fno-optimize-sibling-calls -fno-omit-frame-pointer -mstackrealign)
     if(NOT CMAKE_C_COMPILER_ID STREQUAL "Clang")
         add_compile_options(-mpreferred-stack-boundary=3 -fno-set-stack-executable)
     endif()