https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70722
Bug ID: 70722 Summary: include_next in cmath skips user-defined wrapper Product: gcc Version: 6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: martin.thomson at gmail dot com Target Milestone: --- Firefox has a bunch of wrappers for system headers. I'm not 100% on the reasoning, but most just play with visibility. For instance, the math.h wrapper looks like: #pragma GCC system_header #pragma GCC visibility push(default) #include_next <math.h> #pragma GCC visibility pop Firefox fails to link when built with libstdc++ 6.0.0 because it includes <cmath> before it includes <math.h>. This leads to inclusion of <math.h> with different visibility than is desired. The version of cmath I have includes this: #define _GLIBCXX_INCLUDE_NEXT_C_HEADERS #include_next <math.h> #undef _GLIBCXX_INCLUDE_NEXT_C_HEADERS Removing the "_next" causes the build to succeed. You can see my flailings regarding this issue here: https://bugzilla.mozilla.org/show_bug.cgi?id=1264534