GMP CFLAGS on homebrew

Mike McQuaid mike at
Fri Nov 18 08:47:23 UTC 2016

> On 18 Nov 2016, at 08:36, Gereon Kremer <gereon.kremer at> wrote:
> These flags as shipped by homebrew contain "-mtune=sandybridge
> -march=sandybridge". Thus, if you have a pre-sandybridge processor, the
> resulting binary will crash because the compiler uses some
> sandybridge-specific instructions.
> I assume that GMP (as shipped by homebrew) is actually built using these
> options. In that case, I'm wondering why this version works at all if
> you have an older processor. (And it does. I noticed this error on
> TravisCI, where gmp usually works fine if installed from homebrew)
> If you use some specific compiler or additional compiler options to make
> sure, that no sandybridge-specific instructions make it into the
> library, where is the point of setting these options in the first place?
> If you don't, is it just luck that the library that gets shipped usually
> works on older processors?

When you say “shipped by Homebrew” you’re not specifying whether you mean “shipped in a binary package for OS X version X.Y.Z” or “built from source".

As a general note, if you have a Homebrew question please post it on our GitHub issue tracker, follow our troubleshooting steps and issue template rather than CCing the lead maintainer on an email.


Mike McQuaid

More information about the gmp-discuss mailing list