From: Roland McGrath Date: Thu, 17 Dec 2015 00:35:43 +0000 (-0800) Subject: PR gold/17473: Fix gold build with system C++ headers that use . X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8510fe9cf4b31d142ace82cdf2281680987e59a9;p=thirdparty%2Fbinutils-gdb.git PR gold/17473: Fix gold build with system C++ headers that use . gold/ PR gold/17473 * binary.cc: Move #include "safe-ctype.h" to be last #include. (cherry picked from commit 95c29a83ebadd0038fd304539a83c5e90798c1b9) --- diff --git a/gold/ChangeLog b/gold/ChangeLog index dbe5a9e559c..c6ce6f366e5 100644 --- a/gold/ChangeLog +++ b/gold/ChangeLog @@ -1,3 +1,8 @@ +2015-12-16 Roland McGrath + + PR ld/17473 + * binary.cc: Move #include "safe-ctype.h" to be last #include. + 2015-07-26 Doug Kwan Apply from master diff --git a/gold/binary.cc b/gold/binary.cc index 4dab52cd6bf..94973a1ba01 100644 --- a/gold/binary.cc +++ b/gold/binary.cc @@ -24,7 +24,6 @@ #include #include -#include "safe-ctype.h" #include "elfcpp.h" #include "stringpool.h" @@ -32,6 +31,13 @@ #include "output.h" #include "binary.h" +// safe-ctype.h interferes with macros defined by the system . +// Some C++ system headers might include and rely on its macro +// definitions being intact. So make sure that safe-ctype.h is included +// only after any C++ system headers, whether directly here (above) or via +// other local header files (e.g. #include in "binary.h"). +#include "safe-ctype.h" + // Support for reading binary files as input. These become blobs in // the final output. These files are treated as though they have a // single .data section and define three symbols: