Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 6 Feb 2016 21:58:23 -0700
From:      Warner Losh <imp@bsdimp.com>
To:        Erich Dollansky <erichsfreebsdlist@alogt.com>
Cc:        "freebsd-arm@freebsd.org" <freebsd-arm@freebsd.org>
Subject:   Re: clang++: error: the clang compiler does not support '-march=native'
Message-ID:  <CANCZdfqDqNYFG6700PMSdMGqDnW0EZrJ1PrkO_WCeU2OxDf5Mg@mail.gmail.com>
In-Reply-To: <20160207124404.186b395f@X220.alogt.com>
References:  <20160207050149.39f7e280@X220.alogt.com> <CANCZdfrHd3GTZWC96SQcbbWpfYMqMiLthQ%2BHdCUaKmz=OqAddA@mail.gmail.com> <20160207095721.57fc3502@X220.alogt.com> <CANCZdfrKN07xT-LnuB=DNrtHpAJ0_R6uDbQiQ2dyxtu_wMCZug@mail.gmail.com> <20160207124404.186b395f@X220.alogt.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Feb 6, 2016 at 9:44 PM, Erich Dollansky <erichsfreebsdlist@alogt.com
> wrote:

> Hi,
>
> On Sat, 6 Feb 2016 21:01:13 -0700
> Warner Losh <imp@bsdimp.com> wrote:
>
> > On Sat, Feb 6, 2016 at 6:57 PM, Erich Dollansky
> > <erichsfreebsdlist@alogt.com
> > > wrote:
> >
> > > On Sat, 6 Feb 2016 15:49:14 -0700
> > > Warner Losh <imp@bsdimp.com> wrote:
> > >
> > > > On Sat, Feb 6, 2016 at 2:01 PM, Erich Dollansky
> > > > <erichsfreebsdlist@alogt.com
> > > > > wrote:
> > > >
> > > > > compiling on a Raspberry Pi B 2 on FreeBSD 11 gives me above's
> > > > > error message.
> > > > >
> > > > > A Internet search shows that this message does not exist.
> > > > >
> > > > > The program compiles using the same make file on FreeBSD 10
> > > > > both on x86 and an Raspberry Pi B using the default compilers.
> > > > >
> > > > > Did support for 'march' get removed?
> > > > >
> > > >
> > > > As far as I can tell, it has never worked for either gcc or clang.
> > > >
> > > this is what I would have liked to find out. Intel claims speed
> > > gains of some 40% on their CPUs depending on the work load using
> > > gcc.
> > >
> > > Getting a few per cent on a Raspberry for free would make a real
> > > difference.
> > >
> >
> > Well, the -march=<actual-cpu-here> args work, just not -march=native.
> > The exact details of the core aren't exported from the kernel, so the
> > compiler can't easily query them to guess at the best code generation
> > to use. I think it would be a useful feature, but it just isn't one
> > we have yet.
> >
> > There are some -march values that get so aggressive about optimization
> > that they reveal some alignment issues. However, I think we've kill
> > them all. If not, we'd love to hear about it.
> >
> > I know that the -march=arm1176 works well for the RPi B. Last time I
> > tried it, the -march=cortex-a7 had some alignment issues. Since then
> > I've seen fixes go into the tree and I haven't tried again. Reports
> > from elsewhere indicate that this will give tens of percent in
> > improvement depending on the workload.
> >
> ok, I will try this then.
>
> Is there a list of working architectures somewhere which really
> applies for clang? I found only random information.


TARGET_CPUTYPE is how you can buildworld with this flag set.
Valid values can be found in bsd.cpus.mk

# Common values for FreeBSD
# arm:
#       arm920t, arm926ej-s, marvell-pj4, fa526, fa626,
#       fa606te, fa626te, fa726te
# armv6:
#       arm1176jzf-s, generic-armv7-a, cortex-a5, cortex-a7, cortex-a8,
#       cortex-a9, cortex-a12, cortex-a15, cortex-a17, cortex-a53,
cortex-a57,
#       cortex-a72, exynos-m1

I've not tried all of them, but the system at least builds with cortex-a7,
arm926ej-s, arm1176jzf-s.

Warner



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfqDqNYFG6700PMSdMGqDnW0EZrJ1PrkO_WCeU2OxDf5Mg>