[odb-users] ODB 2.5.0-b.21 Failing Test

Brian E. Coggins becoggins at hotmail.com
Thu Dec 9 14:53:44 EST 2021

On 8 Dec 2021, at 08:54, Boris Kolpackov <boris at codesynthesis.com> wrote:
> Thanks! So you are cross-compiling: GCC is targeting x86_64, not
> aarch64 (aka arm64) that is running host. I wonder if there is a
> way to get Homebrew GCC that targets aarch64?

As a matter of fact, there is, but I had to start with figuring out why the newly installed GCC 11 was cross-compiling.  I set up this new M1 laptop using Apple's migration tool to move things from an older Intel laptop, which worked fantastically on the whole, but I hadn’t thought carefully about what Homebrew would do.  It turns out that a Homebrew installation begun on x86_64 and migrated to aarch64 will continue to download x86_64 packages, running them under Rosetta 2.  On reflection, that makes sense—it allows one to maintain an x86_64 world within an aarch64 machine—but it wasn’t my initial expectation.

To get an aarch64 GCC, one needs to create an independent native Homebrew installation.  This is as easy as running the Homebrew installer again from a terminal; when run on aarch64 it ignores any existing x86_64 installation and builds a new aarch64 one.  Homebrew is putting all aarch64 installations under /opt/Homebrew and all x86_64 installations under /usr/local/Homebrew, so they can coexist.

Unfortunately, Homebrew doesn’t have much documentation on all of that at this point.

Once I had the new aarch64 Homebrew, I could install a native GCC 11.  With that done, everything builds and works fine.

More information about the odb-users mailing list