Closed diversys closed 3 years ago
Uh, it appears that you are trying to build Serenity with your system's gcc installation. SerenityOS requires a custom version of gcc tuned to compile using serenity-specific internal compiler options, which is a standard practice in the osdev world. This custom version is what is built when you build the Toolchain. Is there any particular reason why you are trying to use your own gcc version?
If not, I believe simply not using the -DCMAKE_CXX_COMPILER=gcc-10
and -DCMAKE_C_COMPILER=g++-10
flags when running cmake will fix your build issues. If you look closely, it shows that the compiler is trying to include your system's version of stdio.h
when compiling AK, which is incompatible with how SerenityOS implements stdio.h
.
Yeah, I understand that Serenity uses its own version of gcc. These cmake flags are mentioned in https://github.com/SerenityOS/serenity/blob/master/Documentation/BuildInstructions.md#macos-prerequisites and this is how I always used to configure in the past and it always worked.
Hmm, I was not aware of that. Looking further into the reasoning behind that, it appears that it's because tools like IPCCompiler need to be built using the system's compiler, according to #4594, so overriding the CMAKE_CXX_COMPILER flag is surprisingly legit.
The only cause I can think of is that something in your system compiler is broken, if it's reliable enough to compile the toolchain maybe it's some weird edge case that's only triggered when header files are included in a specific order or something? I've found a kind of similar issue at https://stackoverflow.com/questions/58085311/stdio-fatal-error-ctermid-h-file-not-found , but other than that, I'm not sure whether this is an issue with SerenityOS or your compiler.
Right there are a bunch of host tools that need built and run as part of a normal serenity build. There's the IPC compiler and a few code generators for LibWeb that need to use the host compiler to compile and execute some programs at build time.
The current MacOs CI doesn't use gcc 10.2.0_02, it uses 10.2.0 https://github.com/SerenityOS/serenity/runs/1661911737?check_suite_focus=true#step:4:11
This is another reason to switch to proper two phase cmake builds per #4594. Though, overriding CMAKE_CXX_COMPILER within the cmake lists is not "surprisingly legit", more "surprising that it works at all".
I downgraded gcc to 10.2.0 and isl to 0.22 and that fixed the build.
I recently updated host gcc from 10.2.0 to 10.2.0_2 via
brew upgrade
so it might have something to do with it but I can't really tell. However, now when I try to make a clean build gcc can't find _ctermid.h I already triedbrew doctor
andbrew reinstall gcc
to no avail.