[Bug other/82708] New: libmpx fails to compile due to PATH_MAX
keno at juliacomputing dot com
gcc-bugzilla@gcc.gnu.org
Tue Oct 24 21:46:00 GMT 2017
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.
More information about the Gcc-bugs
mailing list