You are not logged in.
Hi everyone. I've been building KiCAD from source for a year now, but lately, build process is failing:
/home/anarki/build/kicad-git/src/kicad-git/common/netclass.cpp:338:1: internal compiler error: in diag_mismatched_tags, at cp/parser.cc:36131
338 | }
| ^
0x26ec391 diagnostic_context::diagnostic_impl(rich_location*, diagnostic_metadata const*, diagnostic_option_id, char const*, __va_list_tag (*) [1], diagnostic_t)
???:0
0x2746498 internal_error(char const*, ...)
???:0
0x7154cb fancy_abort(char const*, int, char const*)
???:0
0x8b4a47 class_decl_loc_t::diag_mismatched_tags(tree_node*)
???:0
0x8ed564 class_decl_loc_t::diag_mismatched_tags()
???:0
0xa22c35 c_common_parse_file()
???:0
Please submit a full bug report, with preprocessed source (by using -freport-bug).
Please include the complete backtrace with any bug report.
See <https://gitlab.archlinux.org/archlinux/packaging/packages/gcc/-/issues> for instructions.
make[2]: *** [common/CMakeFiles/kicommon.dir/build.make:2095: common/CMakeFiles/kicommon.dir/netclass.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:4320: common/CMakeFiles/kicommon.dir/all] Error 2
make: *** [Makefile:166: all] Error 2
==> ERROR: A failure occurred in build().
Aborting...
While this seems like a gcc issue, downgrading gcc and gcc-libs to last known good 15.1.1+r7+gf36ec88aa85a-1 does not make a difference to me.
Steps to reproduce:
git clone https://aur.archlinux.org/kicad-git.git
cd kicad-git
makepkg -Cs
Packages:
boost-1.88.0-3
boost-libs-1.88.0-3
gcc-15.2.1+r22+gc4e96a094636-1
gcc-libs-15.2.1+r22+gc4e96a094636-1
Can someone confirm?
Last edited by anarki@buttereblume (2025-10-03 11:28:07)
Offline
I get the same after adding libspnav and poppler-glib to the dependencies so the build would reach that point in a clean chroot.
Edit:
Can you still build the last known good version of kicad-git with the current gcc? Can you bisect kicad-git can find the commit that triggered the internal compiler error in gcc?
Last edited by loqs (2025-08-29 13:57:04)
Offline
Hi! While i was not trying to build kicad-git, but just kicad itself, i did hit this same issue and did a bisect of kicad, using g++ (GCC) 15.2.1 20250813, which lead me to 267b21d81ca751b0aba8a48b4c6e182213d63e01 as the first bad commit, which seems to set up precompiled headers.
Here's the bisect log, if that helps anyone digging further into this:
git bisect start
# status: waiting for both good and bad commits
# bad: [843eea259d0a3c0aaf43a591785b42b7d8af1e5b] Fix for Cursor rendering on Linux+EGL+Nvidia in accelerated graphics mode
git bisect bad 843eea259d0a3c0aaf43a591785b42b7d8af1e5b
# status: waiting for good commit(s), bad commit known
# bad: [ed7892d5b67b18cedb390d1b4de471a8c3704999] Translated using Weblate (German)
git bisect bad ed7892d5b67b18cedb390d1b4de471a8c3704999
# status: waiting for good commit(s), bad commit known
# skip: [9b56b8d89ac2ea3e9e5fcc2320180dcbb1f6d902] Add royalblue54L feather demo
git bisect skip 9b56b8d89ac2ea3e9e5fcc2320180dcbb1f6d902
# status: waiting for good commit(s), bad commit known
# good: [a02f1f2411768cba8640ae0e221b09d822849bc4] PDF plotter: fix a rare pen width issue when plotting many pages in one file.
git bisect good a02f1f2411768cba8640ae0e221b09d822849bc4
# good: [071bdbdaa764ada4149de35178b1584ae6e338d0] Nullptr safety.
git bisect good 071bdbdaa764ada4149de35178b1584ae6e338d0
# skip: [c09fc59ba57991809a67ac852bc9104e774835e4] It's too late to flag these at render time.
git bisect skip c09fc59ba57991809a67ac852bc9104e774835e4
# good: [34367020c4af7f78c4e0208f19eb9fee4d27e882] Don't presume a selection (potentially KICAD-8VP).
git bisect good 34367020c4af7f78c4e0208f19eb9fee4d27e882
# good: [40125c73d0a40461b6d4c8b62c15af60b6a2426b] Add option to D356 output to suppress NC pads
git bisect good 40125c73d0a40461b6d4c8b62c15af60b6a2426b
# bad: [e5bee14033f7880335263e7a09f22cdd3f9b7ca3] Translated using Weblate (Persian)
git bisect bad e5bee14033f7880335263e7a09f22cdd3f9b7ca3
# bad: [875fcffdf91c121592f206bc33af430847ffeab1] Mac has no fallback graphics.
git bisect bad 875fcffdf91c121592f206bc33af430847ffeab1
# bad: [42ed78cf6961918b0b73033dfcc7014b7387ff29] Fix PCB for gcc
git bisect bad 42ed78cf6961918b0b73033dfcc7014b7387ff29
# good: [0e83bf9bc4359d3b302077eb132ce423517cefa3] Fix position of hidden locked filter
git bisect good 0e83bf9bc4359d3b302077eb132ce423517cefa3
# good: [c58b1146def94e0bd6a90cd3f5f31b578f35ce1b] Honour pad holes when hit-testing.
git bisect good c58b1146def94e0bd6a90cd3f5f31b578f35ce1b
# bad: [267b21d81ca751b0aba8a48b4c6e182213d63e01] Added precompiled header support
git bisect bad 267b21d81ca751b0aba8a48b4c6e182213d63e01
# good: [1b8119056f03af62ab186514c553f9f81bbdade2] More code sharing.
git bisect good 1b8119056f03af62ab186514c553f9f81bbdade2
# first bad commit: [267b21d81ca751b0aba8a48b4c6e182213d63e01] Added precompiled header support
the build options i used are
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -GNinja -D KICAD_USE_EGL=ON -D KICAD_USE_BUNDLED_GLEW=OFF -D KICAD_BUILD_QA_TESTS=OFF -D KICAD_USE_CMAKE_FINDPROTOBUF=0 -W no-dev -DCMAKE_CXX_FLAGS=-fuse-ld=mold ../..
in just testing that first commit, switching back to GCC gcc-14 (GCC) 14.3.1 20250603 also didnt fix the issue for me.
What did however work, was setting "-D KICAD_USE_PCH=OFF", with current GCC (15)
Offline
The kicad PKGBUILD obtained using `pkgctl repo clone --protocol https kicad` builds 9.0.4 without issue. I can still produce the issue using the latest commit. The preprocessed source is over 10 megabytes so not includes.
Edit:
clang has no issues with the PCH but the final link fails due to missing libwebkit2gtk-4.1.so.0 and libjavascriptcoregtk-4.1.so.0.
Last edited by loqs (2025-09-02 01:55:05)
Offline
Edit:
Can you still build the last known good version of kicad-git with the current gcc? Can you bisect kicad-git can find the commit that triggered the internal compiler error in gcc?
Well, my last good pkg was kicad-git-9.99.0.r1805.g0997205ffb that built fine in july, while checking out the latter today results in the same error.
Offline
@anarki@buttereblume assuming `-D KICAD_USE_PCH=OFF` works for you then that would indicate it is the addition of PCH support that broke the build / gcc. You can then report it on Arch's gitlab instance against gcc which I expect would result in the bug being classed as upstream and you being told to file an issue on https://gcc.gnu.org/bugzilla/. You could also try asking the kicad developers what compiler they use/target and if they can isolate a simple test case for upstream gcc.
Edit:
I suspect it is the same bug as Bug 99642 - Compiler error while using precompiled header and -Wmismatched-tags flag
If you want to work around the issue while keeping PCH enabled you can remove the code that adds -Wmismatched-tags to CXXFLAGS (adding -Wno-mismatched-tags to CXXFLAGS does not work as -Wmismatched-tags is added after user CXXFLAGS).
sed -i '/COMPILER_SUPPORTS_WMISMATCHED_TAGS/,+6d' cmake/Warnings.cmake
Edit2:
I would also suggest you raise the issue with the kicad project and ask them to consider disabling `Wmismatched-tags` for gcc when `KICAD_USE_PCH` is enabled until gcc fixes the issue and makes a release containing the fix.
Last edited by loqs (2025-09-03 22:23:44)
Offline
Thank you @loqs and @ottojo. I'll raise an issue with kicad. Bug 99642 seems in discussion since 2021 and probably will take some more time.
Marking this as solved since `-D KICAD_USE_PCH=OFF`proveides a solution for me.
Offline