From: Kevin Buettner Date: Fri, 19 Feb 2021 05:46:58 +0000 (-0700) Subject: amd64-linux-siginfo.c: Adjust include order to avoid gnulib error X-Git-Tag: gdb-10.2-release~58 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=aebc4aa2ece0363c16cab5a546df05220227ec31;p=thirdparty%2Fbinutils-gdb.git amd64-linux-siginfo.c: Adjust include order to avoid gnulib error On Fedora rawhide, after updating to glibc-2.33, I'm seeing the following build failure: CXX nat/amd64-linux-siginfo.o In file included from /usr/include/bits/sigstksz.h:24, from /usr/include/signal.h:315, from ../gnulib/import/signal.h:52, from /ironwood1/sourceware-git/rawhide-gnulib/bld/../../worktree-gnulib/gdbserver/../gdb/nat/amd64-linux-siginfo.c:20: ../gnulib/import/unistd.h:663:3: error: #error "Please include config.h first." 663 | #error "Please include config.h first." | ^~~~~ glibc-2.33 has changed signal.h to now include which, in turn, includes . For a gdb build, this causes the gnulib version of unistd.h to be pulled in first. The build failure shown above happens because gnulib's config.h has not been included before the include of . The fix is simple - we just rearrange the order of the header file includes to make sure that gdbsupport/commondefs.h is included before attempting to include signal.h. Note that gdbsupport/commondefs.h includes . Build and regression tested on Fedora 33. On Fedora rawhide, GDB builds again. gdb/ChangeLog: PR build/27535 * nat/amd64-linux-siginfo.c: Include "gdbsupport/common-defs.h" (which in turn includes ) before include of . --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 1f73b18f8df..9d90ee32acc 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +2021-03-06 Kevin Buettner + + PR build/27535 + * nat/amd64-linux-siginfo.c: Include "gdbsupport/common-defs.h" + (which in turn includes ) before include + of . + 2021-03-06 Tom de Vries PR symtab/27333 diff --git a/gdb/nat/amd64-linux-siginfo.c b/gdb/nat/amd64-linux-siginfo.c index 8bcff454378..9721a1fd913 100644 --- a/gdb/nat/amd64-linux-siginfo.c +++ b/gdb/nat/amd64-linux-siginfo.c @@ -17,8 +17,8 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include #include "gdbsupport/common-defs.h" +#include #include "amd64-linux-siginfo.h" #define GDB_SI_SIZE 128