[Bug,general/30812] ../libelf/gelf.h:32:10: fatal error: libelf.h: No such file or directory

Message ID bug-30812-10460-uHZFJSs5GU@http.sourceware.org/bugzilla/
State Committed
Headers
Series [Bug,general/30812] ../libelf/gelf.h:32:10: fatal error: libelf.h: No such file or directory |

Commit Message

dodji at seketeli dot org Sept. 3, 2023, 4:24 p.m. UTC
  https://sourceware.org/bugzilla/show_bug.cgi?id=30812

Mark Wielaard <mark at klomp dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at sourceware dot org   |mark at klomp dot org

--- Comment #2 from Mark Wielaard <mark at klomp dot org> ---
The following seems to work:
  

Patch

diff --git a/tests/Makefile.am b/tests/Makefile.am
index 49069ccf..32b18e6e 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -807,9 +807,14 @@  nvidia_extended_linemap_libdw_LDADD = $(libelf) $(libdw)

 # We want to test the libelf headers against the system elf.h header.
 # Don't include any -I CPPFLAGS. Except when we install our own elf.h.
+# For the gelf test we do want our own libelf.h, but nothing else.
+BUILT_SOURCES = libelf.h
+CLEANFILES += libelf.h
+libelf.h: $(top_srcdir)/libelf/libelf.h
+       cp $< $@
 if !INSTALL_ELFH
 system_elf_libelf_test_CPPFLAGS =
-system_elf_gelf_test_CPPFLAGS =
+system_elf_gelf_test_CPPFLAGS = -I.
 else
 system_elf_libelf_test_CPPFLAGS = -I$(top_srcdir)/libelf
 system_elf_gelf_test_CPPFLAGS = -I$(top_srcdir)/libelf