Does it matter if a bootstrap C compiler supports C11?
barracuda156 opened this issue · 7 comments
macOS on PowerPC uses by default gcc-4.2, which does not support C11. Modern gcc is available and works fine (I use gcc-13.2.0 mostly on PowerPC), but it is an additional and quite heavy dependency to build. So if there is no benefit in using a modern gcc, we rather use the old Xcode one.
Could someone advise on this matter?
Mercury requires support for fairly large subset of C99 (specifically, the subset that Microsoft have deigned to support in recent versions of MSVC). C11 support should not be required.
C99 should be supported in gcc-4.2. Sometime requires passing -std=C99
, but so far mercury
is building without interventions beyond disabling -Werror
(which, I think, will not be compiler-dependent, but rather a specificity of system headers).
On a side note, for some reason different targets are picked on macOS PowerPC vs macOS aarch64: hlc + reg on the first but hlc + none on the second (plus java on aarch64, but no surprise it is unsupported on ppc).
The configure
script ought to be able to work out if enough of C99 is supported to compile Mercury.
The different grade selection on PowerPC and aarch64 is deliberate. That said, I don't think the PowerPC port has been tested much since about 2010.
@juliensf It is quite painful to build on PowerPC, since apparently only one cpu core is used by the build system. Running for 3 hrs already, and just began compiling reg.gc.debug.stseg. Even 1 core is not fully loaded. (Though to be honest it was slow to build even on M1.)
But it seems to build smoothly. I am curious whether it gonna actually work, but chances are it will.
Building using multiple cores should work. It should just be a matter of:
$ make PARALLEL=-j4
(Or whatever your preferred number of cores is.)
Oh, that would have saved me a few hours :) It will probably complete reasonably soon, I won’t risk interrupting already (Macports builds post-initial-bootstrap stages in destroot, and I am not sure it resumes if stopped).
UPD. I tried on arm64 now, and yes, it works. Thank you.