SDCC does not build on ARM MACs anymore since the "support/gcc" complains about a missing target config: "*** Configuration aarch64-apple-darwin21.6.0 not supported".
Unfortunately disabling sdcpp seems to not work either since sdcc nowadays just calls sdcpp to compile everything. Is this intentional? Otherwise this project could be renamed to "sdcpp-gcc" then when in fact there is not sdcc compiler anymore which does not work without gcc?
SDCC has been using the GNU preprocessor for a very long time, but the version was updated from 4.6.3 to 12.1.0 recently.
The lack of support for ARM Macs is definitely not intentional, but rather the result of a lack of suitable test systems.
Can you provide the entire console output for analysis?
Ok, I understand that gcc is used for the preprocessor, but there is a "configure" option for SDCC which let's one disable sdcpp: "--disable-sdcpp". If you try to do this then compilation will not work and the resulting sdcc is broken since it relies on "sdcpp" which is called for various reasons. The "support/cpp/gcc" directory in sdcc source looks like the gcc is for "C++" support... but it seems it is mandatory for normal sdcc as well (the preprocess step?).
The actual problem: The "configure" step in "support/cpp/gcc" fails (last line of output shows problem):
In fact there is a GCC branch (not in main) which adds support for newer hardware / architectures like "aarch64" and "apple-darwin"
The
support/cpp/gccfolder contains GCC's (C) (P)re-(P)rocessor. SDCC has no preprocessor without it.Thanks! That means that it can be added to SDCC sooner or later.
Though it seems quite inelegant that SDCC requires its host architectures to be supported by cpp first. After all, we use cpp to target other architectures only.
Maybe that check is actually for a full GCC build for which the target architecture obviously has to be supported explicitly unless you build a cross-compiler.
If that is the case, simply removing the check could solve the problem.
Great idea...
I disabled the "exit 1" after the error message in file "support/cpp/gcc/config.gcc" line 3592:
Besides a few error messages from gcc's configure the compilation of sdcc worked without a problem:
Error messages (which can be ignored):
After having a deeper look at configure.gcc I can see that there is some aarch64 and darwin support inside, but it looks like it is incomplete...
Side note: The resulting SDCC reports itself as a MacOS PPC version (should be AArch64 or ARM):
Last edit: Free-PDK 2022-11-07
I see the snapshots for actual MacOS PPC seem to be failing in the same way:
What is particularly worrying about this bug is that it likely will make the build fail for future unknown host systems. So if we have this bug in a release that makes it into distros, and a dsitro sticks with the version for a while, we'll see the sdcc packages fail to build for that distro when the distro adds future architectures.
This would also become a big problem without any distro involved: Some users prefer to stick to fixed, known-good-for-their-code SDCC versions, and there is always the risk of us at some point int he future not having the manpower to keep regular releases going (and this bug will be a constant drain on manpower if it requires maintenance for every future architecture).
I'll add this bug to the pre-4.3.0 todo list.
This is fixed in [r13746], ignoring "unsupported target" as discussed above.
Related
Commit: [r13746]