Compiling GCC for different x86 CPU generation

Marc Glisse marc.glisse@inria.fr
Tue Jul 24 08:07:00 GMT 2018


On Tue, 24 Jul 2018, Andrew Janke wrote:

> I am having difficulty compiling GCC for a different generation of x86 CPU. I 
> would like to produce a portable/redistributable build of GCC to be 
> distributed along with a packaging of GNU Octave. So I would like to build it 
> for the Core2 architecture, even though my build box has a Skylake CPU.
>
> This is for GCC 8.1.0 on macOS.
>
> It seems like setting "-march=core2" in CFLAGS, BOOT_CFLAGS, and 
> CFLAGS_FOR_TARGET is the way to do this, but it doesn't seem to be working. 
> When I do the build, and then copy the built GCC to an older Ivy Bridge Mac, 
> and attempt to use gfortran to compile a program, it errors out with an 
> "internal compiler error: Illegal instruction: 4" error message.

Here you are supposed to use a debugger to find out what instruction this 
is and where it is (could be in libgmp for instance).

-- 
Marc Glisse



More information about the Gcc-help mailing list