binutils-gdb/gdbsupport
Pedro Alves 3684d331fd Fix gdbsupport build
I'm seeing this on F27 (a clean build from scratch):

~~~~~~~~~~~~~~~~~~~~~~~~~~~
 make[3]: Entering directory '/home/pedro/brno/pedro/gdb/binutils-gdb/build/gdbsupport'
   CC       gdb_tilde_expand.o
 In file included from /home/pedro/gdb/binutils-gdb/src/gdbsupport/../gnulib/import/libc-config.h:33:0,
                  from ../gnulib/import/glob.h:544,
                  from /home/pedro/gdb/binutils-gdb/src/gdbsupport/gdb_tilde_expand.c:22:
 ../bfd/config.h:7:4: error: #error config.h must be #included before system headers
  #  error config.h must be #included before system headers
     ^~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~

libc-config.h, where it includes config.h, says:

~~~~~~~~~~~~~~~~~~~~~~~~~~~
 /* This is intended to be a good-enough substitute for glibc system
    macros like those defined in <sys/cdefs.h>, so that Gnulib code
    shared with glibc can do this as the first #include:

      #ifndef _LIBC
      # include <libc-config.h>
      #endif

    When compiled as part of glibc this is a no-op; when compiled as
    part of Gnulib this includes Gnulib's <config.h> and defines macros
    that glibc library code would normally assume.  */

 #include <config.h>
~~~~~~~~~~~~~~~~~~~~~~~~~~~

The issue is that that '#include <config.h>' picks up bfd's config.h
instead of gnulib's.

This problem doesn't trigger in the gdb dir because there we generate
config.h under that exact name so gnulib's libc-config.h ends up
picking gdb's config.h instead of gnulib.c and that ends up harmless.

In gdbsupport, the config.h file is really named support-config.h, so
that '#include <config.h>' in libc-config.h doesn't pick it like it
would if it had the conventional config.h name.

This patch fixes it by simply renaming gdbserver's support-config.h to
config.h.

gdbsupport/ChangeLog:
2020-01-17  Pedro Alves  <palves@redhat.com>

	* configure.ac: Generate config.h instead of support-config.h.
	* common-defs.h: Include <gdbsupport/config.h> instead of
	<gdbsupport/support-config.h>.
	* Makefile.in: Regenerate.
	* configure: Regenerate.
2020-01-17 15:14:56 +00:00
..
acinclude.m4
aclocal.m4
agent.c
agent.h
alt-stack.h
array-view.h
ax.def
block-signals.h
break-common.h
btrace-common.c
btrace-common.h
buffer.c
buffer.h
byte-vector.h
ChangeLog Fix gdbsupport build 2020-01-17 15:14:56 +00:00
check-defines.el Add gdbsupport check-defines script 2020-01-14 16:25:04 -07:00
cleanups.c
cleanups.h
common-debug.c
common-debug.h
common-defs.h Fix gdbsupport build 2020-01-17 15:14:56 +00:00
common-exceptions.c
common-exceptions.h
common-gdbthread.h
common-inferior.c
common-inferior.h
common-regcache.c
common-regcache.h
common-types.h
common-utils.c
common-utils.h
common.m4
config.in
configure Fix gdbsupport build 2020-01-17 15:14:56 +00:00
configure.ac Fix gdbsupport build 2020-01-17 15:14:56 +00:00
create-version.sh
def-vector.h
default-init-alloc.h
enum-flags.h
environ.c
environ.h
errors.c
errors.h
fileio.c
fileio.h
filestuff.c
filestuff.h
filtered-iterator.h
format.c
format.h
forward-scope-exit.h
function-view.h
gdb_assert.h
gdb_binary_search.h
gdb_locale.h
gdb_optional.h
gdb_proc_service.h Ensure proc-service symbols have default visibility (PR build/24805) 2020-01-16 19:14:14 +00:00
gdb_ref_ptr.h
gdb_setjmp.h
gdb_signals.h
gdb_splay_tree.h
gdb_string_view.h
gdb_string_view.tcc
gdb_sys_time.h
gdb_tilde_expand.c
gdb_tilde_expand.h
gdb_unique_ptr.h
gdb_unlinker.h
gdb_vecs.c
gdb_vecs.h
gdb_wait.c
gdb_wait.h
gdb-dlfcn.c
gdb-dlfcn.h
gdb-sigmask.h
hash_enum.h
host-defs.h
job-control.c
job-control.h
Makefile.am Add gdbsupport check-defines script 2020-01-14 16:25:04 -07:00
Makefile.in Fix gdbsupport build 2020-01-17 15:14:56 +00:00
netstuff.c
netstuff.h
new-op.c
next-iterator.h
observable.h
offset-type.h
parallel-for.h
pathstuff.c
pathstuff.h
poison.h
preprocessor.h
print-utils.c
print-utils.h
ptid.c
ptid.h
README
refcounted-object.h
rsp-low.c
rsp-low.h
run-time-clock.c
run-time-clock.h
safe-iterator.h
safe-strerror.c
scope-exit.h
scoped_fd.h
scoped_mmap.c
scoped_mmap.h
scoped_restore.h
selftest.c
selftest.h
signals-state-save-restore.c
signals-state-save-restore.h
signals.c
symbol.h
tdesc.c
tdesc.h
thread-pool.c
thread-pool.h
traits.h
underlying.h
valid-expr.h
version.h
x86-xstate.h
xml-utils.c
xml-utils.h

This is a helper library that is used by gdb and gdbserver.

To send patches, follow the gdb patch submission instructions in
../gdb/CONTRIBUTE.  For maintainers, see ../gdb/MAINTAINERS.