public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: Fernando Rodriguez <frodriguez.developer@outlook.com>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] Will a 64-bit-no-multilib machine cross-compile 32-bit code?
Date: Sun, 22 Mar 2015 21:25:53 -0400	[thread overview]
Message-ID: <1570093.qMVvttJaZ4@navi> (raw)
In-Reply-To: <CAJ0EP40ROYC8FarXymDOyoZsFzT8P4HqWec-zSNFB6tA5q00-Q@mail.gmail.com>

On Sunday, March 22, 2015 10:03:01 AM Mike Gilbert wrote:
> On Sat, Mar 21, 2015 at 3:52 PM, Fernando Rodriguez
> <frodriguez.developer@outlook.com> wrote:
> > On Saturday, March 21, 2015 8:46:10 AM Mike Gilbert wrote:
> >> On Thu, Mar 19, 2015 at 12:20 AM, Walter Dnes <waltdnes@waltdnes.org> 
wrote:
> >> > CFLAGS="-O2 -march=atom -mno-cx16 -msahf -mmovbe -mno-aes -mno-pclmul -
> > mno-popcnt -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-
bmi2 -
> > mno-tbm -mno-avx -mno-avx2 -mno-sse4.2 -mno-sse4.1 -mno-lzcnt -mno-rtm -
mno-
> > hle -mno-rdrnd -mno-f16c -mno-fsgsbase -mno-rdseed -mno-prfchw -mno-adx -
mfxsr
> > -mno-xsave -mno-xsaveopt --param l1-cache-size=24 --param l1-cache-line-
> > size=64 --param l2-cache-size=512 -mtune=atom -fstack-protector -
mfpmath=sse -
> > fomit-frame-pointer -pipe -fno-unwind-tables -fno-asynchronous-unwind-
tables"
> >> >
> >> >   Is that correct (assuming that's my output)?
> >> >
> >>
> >> I should warn you against including all of those -mno-xxx flags. This
> >> has been known to break the build process for packages like chromium,
> >> which always wants to build with SSE4 support and toggles it off at
> >> runtime. Passing -mno-sse4.1 causes a build failure as it tries to use
> >> macros that are not defined.
> >>
> >
> > Isn't it possible that removing it for all packages would cause a more 
subtle
> > problem with another faulty ebuild (like a program crashing due to an 
illegal
> > instruction)?
> 
> Passing -march=atom should be sufficient to ensure that you don't get
> any illegal instructions. The -mno-XXX flags are redundant, and MOSTLY
> harmless.
 
You got me curious as to why they're there being redundant and I think I found 
out why.

I looked at the code (gcc/config/i386/driver-i386.c) and there is a very slim 
chance that the -march reported by gcc when using -march=native will not be 
the most appropriate. In some cases it's guessed based on the features 
reported by the CPU but on other cases it trusts the model number and Intel 
lists several Atom server CPUs and SoCs with no extensions at all (I have no 
idea what they report themselves like or if their specs are right). All the -
mxxx and -mno-xxx flags are determined by the features reported by the CPU so 
no chance of error there (save from a CPU bug).

I guess gcc devs are careful when using the model numbers (Intel lists 3 for 
Atoms, gcc uses only two so that may account for the models I mentioned) but 
the chance of error is there. The -mno-xxx flags would safeguard against it.

-- 
Fernando Rodriguez


  parent reply	other threads:[~2015-03-23  1:26 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-19  1:56 [gentoo-user] Will a 64-bit-no-multilib machine cross-compile 32-bit code? Walter Dnes
2015-03-19  2:27 ` Fernando Rodriguez
2015-03-19  4:20   ` Walter Dnes
2015-03-19  5:12     ` Fernando Rodriguez
2015-03-21 12:46     ` Mike Gilbert
2015-03-21 19:52       ` Fernando Rodriguez
2015-03-22 14:03         ` Mike Gilbert
2015-03-22 14:05           ` Mike Gilbert
2015-03-23  0:56           ` Fernando Rodriguez
2015-03-23  1:25           ` Fernando Rodriguez [this message]
2015-03-24  1:51             ` Walter Dnes
2015-03-23 22:18               ` Mike Gilbert
2015-03-23 22:41                 ` Fernando Rodriguez
2015-03-23 22:48                   ` Mike Gilbert
2015-03-24  0:37                     ` Fernando Rodriguez
2015-03-24  6:06                   ` Walter Dnes
2015-03-24  7:17                 ` Walter Dnes
2015-03-24 17:18                   ` Mike Gilbert
2015-03-24 19:01                   ` Fernando Rodriguez
2015-03-25  2:01                     ` Walter Dnes
2015-03-25  5:20                     ` Walter Dnes
2015-03-25  6:44                       ` Walter Dnes
2015-03-24  0:26               ` Peter Humphrey
2015-03-22 11:32       ` Walter Dnes
2015-03-28 11:13 ` Frank Steinmetzger
2015-03-28 13:03   ` Walter Dnes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1570093.qMVvttJaZ4@navi \
    --to=frodriguez.developer@outlook.com \
    --cc=gentoo-user@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox