https://git.reactos.org/?p=reactos.git;a=commitdiff;h=8f40fc7ede620213ef6d647d4c0ae5aa66bacf12

commit 8f40fc7ede620213ef6d647d4c0ae5aa66bacf12
Author:     Victor Perevertkin <[email protected]>
AuthorDate: Tue Apr 26 03:15:46 2022 +0300
Commit:     Victor Perevertkin <[email protected]>
CommitDate: Tue Apr 26 04:22:27 2022 +0300

    [CMAKE] Build GCC and Clang builds with -fno-common
---
 sdk/cmake/gcc.cmake  | 4 ++--
 sdk/cmake/msvc.cmake | 5 -----
 2 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/sdk/cmake/gcc.cmake b/sdk/cmake/gcc.cmake
index 921583cb276..076a9fc5731 100644
--- a/sdk/cmake/gcc.cmake
+++ b/sdk/cmake/gcc.cmake
@@ -39,7 +39,8 @@ if(STACK_PROTECTOR)
 endif()
 
 # Compiler Core
-add_compile_options(-pipe -fms-extensions -fno-strict-aliasing)
+# note: -fno-common is default since GCC 10
+add_compile_options(-pipe -fms-extensions -fno-strict-aliasing -fno-common)
 
 # Prevent GCC from searching any of the default directories.
 # The case for C++ is handled through the reactos_c++ INTERFACE library
@@ -54,7 +55,6 @@ elseif(CMAKE_C_COMPILER_ID STREQUAL "Clang")
     add_compile_options("$<$<COMPILE_LANGUAGE:C>:-Wno-microsoft>")
     add_compile_options(-Wno-pragma-pack)
     add_compile_options(-fno-associative-math)
-    add_compile_options(-fcommon)
 
     if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 12.0)
         # disable "libcall optimization"
diff --git a/sdk/cmake/msvc.cmake b/sdk/cmake/msvc.cmake
index 5c6492f448e..cfd852211f6 100644
--- a/sdk/cmake/msvc.cmake
+++ b/sdk/cmake/msvc.cmake
@@ -55,11 +55,6 @@ if(ARCH STREQUAL "i386")
     endif()
 endif()
 
-# CLang default to -fno-common from version 11 onward. We are not ready for 
this now
-if (USE_CLANG_CL)
-    add_compile_options(-fcommon)
-endif()
-
 # VS 12+ requires /FS when used in parallel compilations
 if(NOT MSVC_IDE)
     add_compile_options(/FS)

Reply via email to