Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does it matter if a bootstrap C compiler supports C11? #128

Open
barracuda156 opened this issue Feb 20, 2024 · 7 comments
Open

Does it matter if a bootstrap C compiler supports C11? #128

barracuda156 opened this issue Feb 20, 2024 · 7 comments

Comments

@barracuda156
Copy link

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?

@juliensf
Copy link
Member

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.

@barracuda156
Copy link
Author

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).

@barracuda156
Copy link
Author

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).

@juliensf
Copy link
Member

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.

@barracuda156
Copy link
Author

@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.

@juliensf
Copy link
Member

Building using multiple cores should work. It should just be a matter of:

 $ make PARALLEL=-j4

(Or whatever your preferred number of cores is.)

@barracuda156
Copy link
Author

barracuda156 commented Feb 20, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants