Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 467948 - dev-db/mariadb-5.5.30 injects -march=i686 into CFLAGS
Summary: dev-db/mariadb-5.5.30 injects -march=i686 into CFLAGS
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: x86 Linux
: Normal normal
Assignee: Gentoo Linux MySQL bugs team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-30 06:51 UTC by Michael
Modified: 2013-05-28 19:39 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (file_467948.txt,4.51 KB, text/plain)
2013-04-30 06:53 UTC, Michael
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael 2013-04-30 06:51:46 UTC
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
Comment 1 Michael 2013-04-30 06:53:30 UTC
Created attachment 346948 [details]
emerge --info
Comment 2 Brian Evans (RETIRED) gentoo-dev 2013-05-02 19:23:14 UTC
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
Comment 3 Brian Evans (RETIRED) gentoo-dev 2013-05-02 19:25:46 UTC
(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.
Comment 4 Michael 2013-05-03 04:52:56 UTC
(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.
Comment 5 Michael 2013-05-03 14:07:57 UTC
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.
Comment 6 Sergei Golubchik 2013-05-03 22:01:02 UTC
-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.
Comment 7 David Heidelberg (okias) 2013-05-28 18:38:36 UTC
status? patch?
Comment 8 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2013-05-28 19:08:02 UTC
(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.
Comment 9 Sergei Golubchik 2013-05-28 19:17:35 UTC
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
Comment 10 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2013-05-28 19:39:57 UTC
Ok, well 5.5.31 is going into the tree soon, so i'm just going to close this as UPSTREAM.