On 01-06-14 14:03, Yamakaky wrote:
Hi
I just discovered the gcc option march=native. It enables all the
local-supported optimizations, without downsides except the
non-portability of the binaries. Is there a reason why it isn't
enabled by default, as cross platform compilation isn't used by most
of the users (I think) ?
Yamakaky
Yamakaky, the non-portability is a very big downside imo.
When using -march=native on a core i7, those packages won't run on an
amd processor or on an intel atom. They might even give problems on a
core i3.
All official packages for arch are build on systems running arch.
With current makepkg default, all packages build will run on all systems
with same architecture (x86-64 / i686) .
Now assume makepkg had -march=native as default.
packages build for official repos now will fail on all systems that
don't have same cpu family.
This effectively forces all devs to change makepkg defaults.
Incase they forget it, their offficial build will fail.
some user-specific examples :
user has a netbook with an intel atom processor and needs to compile
program foo to work on it.
building foo on the netbook takes over an hour.
User tries building foo on his main system with a core i7, SSD etc and
finds building foo takes only a few minutes there. foo build with
makepkg default on the i7 will run flawlessly on the netbook.
user has an ageing AMD FX system and wants to replace that with an intel
core i7 system.
they don't feel like re-installing, so just transfer the harddrive to
the intel system.
if they used -march=native everything they build on the AMD FX system
will need to be rebuild on the core i7 .
LW