From 62d7a6a51447b0986279fc393beeb0fcec442205e3264533ddc9bdbde0c8592c Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Tue, 20 Jul 2021 14:49:21 +0000 Subject: [PATCH] Accepting request 907326 from home:Andreas_Schwab:glibc:rebuild - amd64-linux-siginfo-include-order.patch: Adjust include order to avoid gnulib error OBS-URL: https://build.opensuse.org/request/show/907326 OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=288 --- amd64-linux-siginfo-include-order.patch | 59 +++++++++++++++++++++++++ gdb.changes | 6 +++ gdb.spec | 4 +- 3 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 amd64-linux-siginfo-include-order.patch diff --git a/amd64-linux-siginfo-include-order.patch b/amd64-linux-siginfo-include-order.patch new file mode 100644 index 0000000..494e859 --- /dev/null +++ b/amd64-linux-siginfo-include-order.patch @@ -0,0 +1,59 @@ +From 8488c357ce4fc309d49c7b0224cf9574b68e8116 Mon Sep 17 00:00:00 2001 +From: Kevin Buettner +Date: Thu, 18 Feb 2021 22:46:58 -0700 +Subject: [PATCH] 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: + + * nat/amd64-linux-siginfo.c: Include "gdbsupport/common-defs.h" + (which in turn includes ) before include + of . +--- + gdb/ChangeLog | 6 ++++++ + gdb/nat/amd64-linux-siginfo.c | 2 +- + 2 files changed, 7 insertions(+), 1 deletion(-) + +diff --git a/gdb/nat/amd64-linux-siginfo.c b/gdb/nat/amd64-linux-siginfo.c +index 0c932814ec8..e2d2db6e112 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 +-- +2.32.0 + diff --git a/gdb.changes b/gdb.changes index b2315bf..0a5286e 100644 --- a/gdb.changes +++ b/gdb.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Jul 20 13:46:59 UTC 2021 - Andreas Schwab + +- amd64-linux-siginfo-include-order.patch: Adjust include order to avoid + gnulib error + ------------------------------------------------------------------- Wed Jun 23 11:52:54 UTC 2021 - Andreas Schwab diff --git a/gdb.spec b/gdb.spec index 8bb409f..7d727c2 100644 --- a/gdb.spec +++ b/gdb.spec @@ -1,5 +1,5 @@ # -# spec file for package gdb-testresults +# spec file # # Copyright (c) 2021 SUSE LLC # Copyright (c) 2012 RedHat @@ -321,6 +321,7 @@ Patch2020: gdb-breakpoint-fix-assert-in-jit_event_handler.patch Patch2021: gdb-save-restore-file-offset-while-reading-notes-in-core-file.patch Patch2022: gdb-symtab-fix-infinite-recursion-in-dwarf2_cu-get_builder-again.patch Patch2023: gdb-support-dw-lle-start-end.patch +Patch2024: amd64-linux-siginfo-include-order.patch # Testsuite patches @@ -758,6 +759,7 @@ find -name "*.info*"|xargs rm -f %patch2021 -p1 %patch2022 -p1 %patch2023 -p1 +%patch2024 -p1 %patch2500 -p1 %if 0%{?suse_version} > 1500