In /var/tmp/portage/dev-db/mariadb-5.5.30/work/mysql/cmake/os/Linux.cmake it has: 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() This prevents mariadb from being built on any CPU without i686 support, including VIA C3. Pretty much the same in FreeBSD.cmake. Reproducible: Always
Created attachment 346948 [details] emerge --info
From #mariadb on freenode: 3:15:03 PM - grknight: since cmake/os/Linux.cmake adds -march=i686, does this mean that <i686 is not supported in mariadb? [snip unrelated] 3:17:26 PM - wlad: grknight, no it is not supported. you need gcc atomics to work 3:18:29 PM - wlad: and also there is some assembler in performance schema i don't remember
(In reply to comment #2) > From #mariadb on freenode: > > 3:15:03 PM - grknight: since cmake/os/Linux.cmake adds -march=i686, does > this mean that <i686 is not supported in mariadb? > [snip unrelated] > 3:17:26 PM - wlad: grknight, no it is not supported. you need gcc atomics to > work > 3:18:29 PM - wlad: and also there is some assembler in performance schema i > don't remember 3:24:28 PM - wlad: anyway, if gcc has builtin atomics on their architecture, that work with 64bit ints, they can remove it.
(In reply to comment #3) > 3:24:28 PM - wlad: anyway, if gcc has builtin atomics on their architecture, > that work with 64bit ints, they can remove it. I've remove -march=i686, and build it without any problems. From what I see for now it works fine.
From what I found here: http://gcc.gnu.org/wiki/Atomic atomic implementations are exactly the same for i686 and i586. Furthermore: "All other architectures simply generate calls to the appropriate sync function name, and will fail at link time if a library with the required routines is not provided." So, if I was able to build mariadb, then atomics are works. There is no need to force -march=i686.
-march=i686 was added, apparently, as a quick workaround for gcc 4.1 bug (?) that generated invalid code for x86 atomics written in inline assembly (part of MariaDB source code). I'll remove this hack in the upstream and will try to fix it differently.
status? patch?
(In reply to Michael from comment #4) > (In reply to comment #3) > > 3:24:28 PM - wlad: anyway, if gcc has builtin atomics on their architecture, > > that work with 64bit ints, they can remove it. > > I've remove -march=i686, and build it without any problems. From what I see > for now it works fine. Can you please run the full testsuite with that change? USE='berkdb -cluster embedded extraengine perl ssl community' FEATURES='test userpriv -usersandbox' ebuild mariadb-5.5.30.ebuild digest clean package Be sure to have portage logging on, and attach the full portage log output to this bug (you will probably need to compress it). If it passes, I'll accept removing that -march modification.
The bug was fixed in MariaDB 5.5.31 with this changeset: http://bazaar.launchpad.net/~maria-captains/maria/5.5/revision/sergii@pisem.net-20130507162836-t22jqmcz1sg0zcz0
Ok, well 5.5.31 is going into the tree soon, so i'm just going to close this as UPSTREAM.