https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82708
Bug ID: 82708 Summary: libmpx fails to compile due to PATH_MAX Product: gcc Version: 7.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: other Assignee: unassigned at gcc dot gnu.org Reporter: keno at juliacomputing dot com Target Milestone: --- In trying to build gcc on musl-based Alpine linux, I encountered the following error: ``` /src/gcc-7.2.0/libmpx/mpxrt/mpxrt-utils.c:72:23: error: ‘PATH_MAX’ undeclared here (not in a function); did you mean ‘INT8_MAX’? #define MAX_FILE_NAME PATH_MAX ^ /src/gcc-7.2.0/libmpx/mpxrt/mpxrt-utils.c:95:22: note: in expansion of macro ‘MAX_FILE_NAME’ static char out_name[MAX_FILE_NAME]; ^~~~~~~~~~~~~ ``` I was confused by this at first because musl defines PATH_MAX in limits.h which appears to be included from that file, but looking at the `-E` output it turns out that it uses `include-fixed/limits.h` instead, which doesn't have that definition. I don't know enough about GCC's build system to determine what's at fault here (maybe it shouldn't be using that limits.h?) In searching the internet, there are a number of reports of this error from various other system configurations as well, so this like a fairly common problem when building gcc.