List:Commits« Previous MessageNext Message »
From:Davi Arnaut Date:October 8 2010 1:31pm
Subject:bzr commit into mysql-5.5-bugteam branch (davi:3225) Bug#42733
View as plain text  
# At a local mysql-5.5-bugteam repository of davi

 3225 Davi Arnaut	2010-10-08
      Bug#42733: Type-punning warnings when compiling MySQL -- strict aliasing violations.
      
      Due to the extent of aliasing violations in the MySQL source
      code, at this time it is safer to disable strict aliasing related
      optimizations in release builds.
      
      As of this patch, only GCC enables strict aliasing by default.
      Hence, use the -fno-strict-aliasing option to disable the
      aliasing rules.
     @ cmake/build_configurations/mysql_release.cmake
        Add -fno-strict-aliasing to release builds.

    modified:
      cmake/build_configurations/mysql_release.cmake
=== modified file 'cmake/build_configurations/mysql_release.cmake'
--- a/cmake/build_configurations/mysql_release.cmake	2010-07-19 14:23:02 +0000
+++ b/cmake/build_configurations/mysql_release.cmake	2010-10-08 13:30:58 +0000
@@ -131,16 +131,16 @@ IF(UNIX)
 
   # Default GCC flags
   IF(CMAKE_COMPILER_IS_GNUCC)
-    SET(COMMON_C_FLAGS               "-g -static-libgcc -fno-omit-frame-pointer")
+    SET(COMMON_C_FLAGS               "-g -static-libgcc -fno-omit-frame-pointer -fno-strict-aliasing")
     SET(CMAKE_C_FLAGS_DEBUG          "-O ${COMMON_C_FLAGS}")
     SET(CMAKE_C_FLAGS_RELWITHDEBINFO "-O3 ${COMMON_C_FLAGS}")
   ENDIF()
   IF(CMAKE_COMPILER_IS_GNUCXX)
-    SET(COMMON_CXX_FLAGS               "-g -static-libgcc -fno-omit-frame-pointer")
+    SET(COMMON_CXX_FLAGS               "-g -static-libgcc -fno-omit-frame-pointer -fno-strict-aliasing")
     SET(CMAKE_CXX_FLAGS_DEBUG          "-O ${COMMON_CXX_FLAGS}")
     SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 ${COMMON_CXX_FLAGS}")
   ENDIF()
-  
+
   # HPUX flags
   IF(CMAKE_SYSTEM_NAME MATCHES "HP-UX")
     IF(CMAKE_C_COMPILER_ID MATCHES "HP")
@@ -156,7 +156,7 @@ IF(UNIX)
     ENDIF()
     SET(WITH_SSL no)
   ENDIF()
-  
+
   # Linux flags
   IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
     IF(CMAKE_C_COMPILER_ID MATCHES "Intel")
@@ -173,18 +173,18 @@ IF(UNIX)
       SET(WITH_SSL no)
     ENDIF()
   ENDIF()
-  
+
   # OSX flags
   IF(APPLE)
-    SET(COMMON_C_FLAGS                 "-g -fno-common")
+    SET(COMMON_C_FLAGS                 "-g -fno-common -fno-strict-aliasing")
     # XXX: why are we using -felide-constructors on OSX?
-    SET(COMMON_CXX_FLAGS               "-g -fno-common -felide-constructors")
+    SET(COMMON_CXX_FLAGS               "-g -fno-common -felide-constructors -fno-strict-aliasing")
     SET(CMAKE_C_FLAGS_DEBUG            "-O ${COMMON_C_FLAGS}")
     SET(CMAKE_CXX_FLAGS_DEBUG          "-O ${COMMON_CXX_FLAGS}")
     SET(CMAKE_C_FLAGS_RELWITHDEBINFO   "-Os ${COMMON_C_FLAGS}")
     SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-Os ${COMMON_CXX_FLAGS}")
   ENDIF()
-  
+
   # Solaris flags
   IF(CMAKE_SYSTEM_NAME MATCHES "SunOS")
     IF(CMAKE_SYSTEM_VERSION VERSION_GREATER "5.9")
@@ -219,7 +219,7 @@ IF(UNIX)
       ENDIF()
     ENDIF()
   ENDIF()
-  
+
   IF(CMAKE_C_FLAGS_DEBUG)
     SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}"
       CACHE STRING "Debug C compile flags")


Attachment: [text/bzr-bundle] bzr/davi.arnaut@oracle.com-20101008133058-x8grxuw9yjl0e87h.bundle
Thread
bzr commit into mysql-5.5-bugteam branch (davi:3225) Bug#42733Davi Arnaut8 Oct