]> git.ipfire.org Git - thirdparty/elfutils.git/commit
config: Adjust AM_CPPFLAGS for srcdir and .. path includes
authorMark Wielaard <mark@klomp.org>
Thu, 26 Jun 2025 13:06:07 +0000 (15:06 +0200)
committerMark Wielaard <mark@klomp.org>
Thu, 26 Jun 2025 13:16:43 +0000 (15:16 +0200)
commit76bd5f6bea9bbeed68b1434455e4904d0fc22b04
treeb64bffc5cfe79631e60debaf47ae5911c5023bdc
parent6136fe46258e2292abeab06703610ad58fb91aef
config: Adjust AM_CPPFLAGS for srcdir and .. path includes

When building with clang and libc++ some standard headers might try
including <stack> even when no source file requests such include
directly. When building with srcdir == builddir this might clash in
the src dir since we then build a stack binary there and the src dir
also has srcfiles.cxx which might include some standard c++ headers.

Work around this by removing -I.. from AM_CPPFLAGS and replacing it
with -I(abs_top_builddir) where the <config.h> file can be found. And
use -iquote for srcdir so it doesn't get included in the search path
for the system <header> includes (only for "header" includes).

Note that DEFAULT_INCLUDES might add . and srcdir back.  So
DEFAULT_INCLUDES is disabled explicitly in src/Makefile.am (where the
stack binary is build). We could also use the nostdinc automake option
to completely suppress that, but that needs more auditing of various
installed vs not-installed header files.

* config/eu.am (AM_CPPFLAGS): Use -iquote for $(srcdir) and
        replace -I.. with -I$(abs_top_builddir).
* libdw/libdwP.h: Include "libdw.h" and "dwarf.h" instead of
        the system headers <libdw.h> and <dwarf.h>.

https://sourceware.org/bugzilla/show_bug.cgi?id=33103

Signed-off-by: Mark Wielaard <mark@klomp.org>
config/eu.am
libdw/libdwP.h