Created attachment 14742 [details] FreeBSD 13 include path fix If the binutils package is install GDB 13.1 does not compile when building an ARM GDB for RTEMS. The error is: In file included from ../../gdb-13.1/gdb/xml-tdesc.c:23: In file included from ../../gdb-13.1/gdb/target.h:42: In file included from ../../gdb-13.1/gdb/infrun.h:21: In file included from ../../gdb-13.1/gdb/gdbthread.h:26: In file included from ../../gdb-13.1/gdb/breakpoint.h:38: ../../gdb-13.1/gdb/target/waitstatus.h:113:1: error: use of undeclared identifier 'DIAGNOSTIC_ERROR_SWITCH' DIAGNOSTIC_ERROR_SWITCH ^ The binutils package is: $ pkg which /usr/local/include/diagnostics.h /usr/local/include/diagnostics.h was installed by package binutils-2.37_2,1 The attached patch from John resolved the problem.
(In reply to Chris Johns from comment #0) > /usr/local/include/diagnostics.h was installed by package binutils-2.37_2,1 Installing these things always seemed like a mistake to me :{ > The attached patch from John resolved the problem. Seems fine, what is John's last name + some email addr for attribution in git?
(In reply to Tom Tromey from comment #1) > (In reply to Chris Johns from comment #0) > > The attached patch from John resolved the problem. > > Seems fine, what is John's last name + some email addr for attribution in > git? John Baldwin <jhb@FreeBSD.org> https://inbox.sourceware.org/gdb/70b50c1d-29bf-2c5c-2dbb-c2ed7dc55ab2@FreeBSD.org/
Mark, thanks for providing the needed details and Tom I am sorry I should have provided more context in the report. Is there anything further I need to do to help?
(In reply to Chris Johns from comment #3) > Mark, thanks for providing the needed details and Tom I am sorry I should > have provided more context in the report. No problem. > Is there anything further I need to do to help? Nope.
The master branch has been updated by John Baldwin <jhb@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=a2fbb6903889c8fe32f4f3b890ef4b8c565d6b84 commit a2fbb6903889c8fe32f4f3b890ef4b8c565d6b84 Author: John Baldwin <jhb@FreeBSD.org> Date: Fri Mar 10 12:01:40 2023 -0800 PR gdb/30214: Prefer local include paths to system include paths Some systems may install binutils headers into a system location (e.g. /usr/local/include on FreeBSD) which may also include headers for other external packages used by GDB such as zlib or zstd. If a system include path such as /usr/local/include is added before local include paths to directories within a clone or release tarball, then headers from the external binutils package are used which can result in build failures if the external binutils package is out of sync with the version of GDB being built. To fix, sort the include paths in INTERNAL_CFLAGS_BASE to add CFLAGS for "local" componenets before external components. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30214 Reviewed-By: Tom Tromey <tom@tromey.com>
The gdb-13-branch branch has been updated by John Baldwin <jhb@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=a980a7d24b9ab416a70880182d4e6b4975967d38 commit a980a7d24b9ab416a70880182d4e6b4975967d38 Author: John Baldwin <jhb@FreeBSD.org> Date: Fri Mar 10 12:01:40 2023 -0800 PR gdb/30214: Prefer local include paths to system include paths Some systems may install binutils headers into a system location (e.g. /usr/local/include on FreeBSD) which may also include headers for other external packages used by GDB such as zlib or zstd. If a system include path such as /usr/local/include is added before local include paths to directories within a clone or release tarball, then headers from the external binutils package are used which can result in build failures if the external binutils package is out of sync with the version of GDB being built. To fix, sort the include paths in INTERNAL_CFLAGS_BASE to add CFLAGS for "local" componenets before external components. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30214 Reviewed-By: Tom Tromey <tom@tromey.com> (cherry picked from commit a2fbb6903889c8fe32f4f3b890ef4b8c565d6b84)
Fix merged to master and gdb-13-branch.