Skip to content

fix: building with non other standard libraries than glibc#8302

Open
AMS21 wants to merge 1 commit intodanmar:mainfrom
AMS21:patch-1
Open

fix: building with non other standard libraries than glibc#8302
AMS21 wants to merge 1 commit intodanmar:mainfrom
AMS21:patch-1

Conversation

@AMS21
Copy link

@AMS21 AMS21 commented Mar 6, 2026

I've noticed since version 2.19.0 building with musl libc (alpine for example). I get the following error:

/dev/cppcheck/cli/stacktrace.cpp:29:10: fatal error: execinfo.h: No such file or directory
   29 | #include <execinfo.h>
      |          ^~~~~~~~~~~~

Documentation mentions explicitly that execinfo.h is not available on the following platforms: musl libc, FreeBSD 9.3, NetBSD 6.1, OpenBSD 6.9, Minix 3.1.8, AIX 5.1, HP-UX 11, Solaris 10, Cygwin, mingw, MSVC 14, Android 9.0

@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 6, 2026

@firewave
Copy link
Collaborator

firewave commented Mar 6, 2026

We dropped this change since it doesn't work. __GLIBC__ is not a built-in define but defined by the used libc and requires an include beforehand.

The correct handling would be to detect if the include is available. Unfortunately __has_include is not available until C++17. Using CMake we can detect if the include exists but that still leaves the regular Makefile.

Knowing the use case of musl (although I think nobody should ever be using it as it violates the spec) to reproduce it I will take a look on fixing this properly. This also allows us to add a step to the CI to make sure it doesn't break in the future.

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

Successfully merging this pull request may close these issues.

2 participants