1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

centos5 gcc 4.1 asm bug

include/atomic/x86-gcc.h:
  force %esi register, don't give gcc a choice.
  (otherwise it could choose %ebx, and 4.1 did)
This commit is contained in:
Sergei Golubchik
2013-05-07 18:28:36 +02:00
parent e0a08c567a
commit 009dee833c
2 changed files with 3 additions and 9 deletions

View File

@@ -47,9 +47,3 @@ IF(HAVE_DECL_SHM_HUGETLB)
SET(HAVE_LARGE_PAGE_OPTION 1) SET(HAVE_LARGE_PAGE_OPTION 1)
ENDIF() ENDIF()
IF(CMAKE_SIZEOF_VOID_P EQUAL 4 AND CMAKE_SYSTEM_PROCESSOR MATCHES "86")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=i686")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=i686")
SET(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -march=i686")
ENDIF()

View File

@@ -124,10 +124,10 @@
asm volatile ("push %%ebx;" \ asm volatile ("push %%ebx;" \
"movl (%%ecx), %%ebx;" \ "movl (%%ecx), %%ebx;" \
"movl 4(%%ecx), %%ecx;" \ "movl 4(%%ecx), %%ecx;" \
LOCK_prefix "; cmpxchg8b %0;" \ LOCK_prefix "; cmpxchg8b (%%esi);" \
"setz %2; pop %%ebx" \ "setz %2; pop %%ebx" \
: "=m" (*a), "+A" (*cmp), "=c" (ret) \ : "+S" (a), "+A" (*cmp), "=c" (ret) \
: "c" (&set), "m" (*a) \ : "c" (&set) \
: "memory", "esp") : "memory", "esp")
#endif #endif