Bug 1219648 - build mariadb with -mtune=sandybridge fails (-mno-avx works)
Summary: build mariadb with -mtune=sandybridge fails (-mno-avx works)
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: 21
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-05-07 21:38 UTC by Harald Reindl
Modified: 2015-12-02 17:56 UTC (History)
6 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2015-12-02 11:51:58 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
buildlog (10.31 KB, application/x-xz)
2015-05-07 21:38 UTC, Harald Reindl
no flags Details
the mentioned output files (305.59 KB, application/octet-stream)
2015-05-12 11:17 UTC, Harald Reindl
no flags Details


Links
System ID Private Priority Status Summary Last Updated
GNU Compiler Collection 66137 0 None None None Never

Description Harald Reindl 2015-05-07 21:38:23 UTC
Created attachment 1023275 [details]
buildlog

while the compile opions are not default for Fedora it's pretty sure a bug in GCC that if you switch to -mtune=westmere and rmeove -mavx the build is fine, see attachment

a ton of other packages with the same compiler flags are built just fine (httpd, php, ffmpeg....) but mariadb 10.0.17 / 10.0.18 fails
________________________________________________________

finally i reduced that all to the values below and still "sandybridge" is broken while "westmere" works

[builduser@buildserver64:/rpmbuild/SPECS]$ cat /home/builduser/.rpmrc
optflags: x86_64 -m64 -O2 -march=sandybridge -mtune=sandybridge -fopenmp -mfpmath=sse -pipe -fomit-frame-pointer -finline-functions -finline-limit=60 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=6 -D_FORTIFY_SOURCE=2 -Wstack-protector -Wformat -Werror=format-security

%build
export CFLAGS="%{optflags} -O3 -fno-stack-protector -fstack-protector --param=ssp-buffer-size=8 -fPIC -fomit-frame-pointer -fno-exceptions -ffixed-ebp -fwrapv -fno-strict-aliasing -fno-delete-null-pointer-checks -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE"
export CXXFLAGS="$CFLAGS"
export FFLAGS="$CFLAGS"
export FCFLAGS="$CFLAGS"
export LDFLAGS="-Wl,-z,now -Wl,-z,relro,-z,noexecstack -pie"
export SH_LDFLAGS="$LDFLAGS"

Comment 1 Harald Reindl 2015-05-09 12:41:19 UTC
in fact using -mno-avx works around that bug when using -mtune=sandybridge

Comment 2 Jakub Jelinek 2015-05-12 07:29:51 UTC
The compiler told you to attach what you haven't attached:
Preprocessed source stored into /tmp/cczTogJq.out file, please attach this to your bugreport.
Preprocessed source stored into /tmp/ccq25Xw4.out file, please attach this to your bugreport.
Preprocessed source stored into /tmp/ccWoNNCF.out file, please attach this to your bugreport.
Preprocessed source stored into /tmp/ccz6ZhXK.out file, please attach this to your bugreport.
Preprocessed source stored into /tmp/ccxFAkFb.out file, please attach this to your bugreport.
Preprocessed source stored into /tmp/cc7h0A6g.out file, please attach this to your bugreport.
Supposedly one of those is enough.

Comment 3 Harald Reindl 2015-05-12 11:17:22 UTC
Created attachment 1024539 [details]
the mentioned output files

well, as i reported that to MariaDB i where asked for the in the initial report attached full buildlog, anyways all the mentioned files from another build-try attached in this archive

Comment 4 Jakub Jelinek 2015-05-13 18:14:43 UTC
Why are you adding -ffixed-ebp?  As rbp register is used for frame pointer and for AVX really needed for dynamic stack realignment, it is obviously incompatible with that option.

Comment 5 Jakub Jelinek 2015-05-13 18:25:33 UTC
Filed http://gcc.gnu.org/PR66137 for this, but I bet the only fix will be just to error out in that case.

Comment 6 Harald Reindl 2015-05-13 18:27:36 UTC
-ffixed-ebp seems to be indeed the problem and likely comes from optimization guides before SandyBridge / AVX was invented since most of the flags are unchanged over years now in my SPEC file

Comment 7 Harald Reindl 2015-05-25 11:04:22 UTC
that already happened

_________________________________________

The following is a list of bugs or attachments to bugs in which a user has been
waiting more than 7 days for a response from you. Please take
action on these requests as quickly as possible. (Note that some of these bugs
might already be closed, but a user is still waiting for your response.)

We'll remind you again in another 7 days if these requests are still
outstanding, or if there are any new requests where users have been waiting
more than 7 days for your response.

needinfo
--------

  Bug 1219648: build mariadb with -mtune=sandybridge fails (-mno-avx works) (12 days old)
    https://bugzilla.redhat.com/show_bug.cgi?id=1219648

Comment 8 Fedora End Of Life 2015-11-04 11:50:16 UTC
This message is a reminder that Fedora 21 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 21. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '21'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 21 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 9 Fedora End Of Life 2015-12-02 11:52:07 UTC
Fedora 21 changed to end-of-life (EOL) status on 2015-12-01. Fedora 21 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.