https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115368

            Bug ID: 115368
           Summary: Wrong order of gcc include paths on musl systems
           Product: gcc
           Version: 14.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: driver
          Assignee: unassigned at gcc dot gnu.org
          Reporter: raj.khem at gmail dot com
  Target Milestone: ---

When doing cross-builds targeting musl based systems, gcc driver adds -iprefix
to cc1/cc1plus call, the path is based on gcc cross compiler installation
location, and points to GCC private headers which override some of system
headers e.g. stddef.h stdint.h, stdarg.h to name a few. This works ok with
glibc based systems but musl does not depend/use gcc's private headers [1] and
-iprefix prepends to search path which means the headers from gcc installation
will be picked up first. This causes problems e.g. when configuring python
build, it tries to detect platform and logic to detect musl system is based on
musl specific define coming from stdarg.h, however musl cross gcc feeds the
gcc's own stdarg.h header and the test fails. 

[1] https://gitlab.alpinelinux.org/alpine/aports/-/issues/12477#note_145159

Reply via email to