public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
* [Bug general/30812] New: ../libelf/gelf.h:32:10: fatal error: libelf.h: No such file or directory
@ 2023-08-30 15:26 schwab@linux-m68k.org
  2023-08-30 15:47 ` [Bug general/30812] " mark at klomp dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: schwab@linux-m68k.org @ 2023-08-30 15:26 UTC (permalink / raw)
  To: elfutils-devel

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

            Bug ID: 30812
           Summary: ../libelf/gelf.h:32:10: fatal error: libelf.h: No such
                    file or directory
           Product: elfutils
           Version: unspecified
            Status: NEW
          Keywords: testsuite
          Severity: normal
          Priority: P2
         Component: general
          Assignee: unassigned at sourceware dot org
          Reporter: schwab@linux-m68k.org
                CC: elfutils-devel at sourceware dot org
  Target Milestone: ---

Building the test system-elf-gelf-test fails with:

gcc -D_GNU_SOURCE -DHAVE_CONFIG_H -DLOCALEDIR='"/usr/share/locale"' -I. -I..    
-std=gnu99 -Wall -Wshadow -Wformat=2 -Wold-style-definition -Wstrict-prototypes 
-Wtrampolines -Wlogical-op -Wduplicated-cond -Wnull-dereference
-Wimplicit-fallt
hrough=5 -Wuse-after-free=3 -Werror -Wunused -Wextra -Wstack-usage=262144   -O2 
-Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong
-funwind-ta
bles -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type
-
flto=auto -ffat-lto-objects -Werror=date-time -g -c -o
system_elf_gelf_test-syst
em-elf-gelf-test.o `test -f 'system-elf-gelf-test.c' || echo
'./'`system-elf-gelf-test.c
In file included from system-elf-gelf-test.c:22:
../libelf/gelf.h:32:10: fatal error: libelf.h: No such file or directory
   32 | #include <libelf.h>
      |          ^~~~~~~~~~

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug general/30812] ../libelf/gelf.h:32:10: fatal error: libelf.h: No such file or directory
  2023-08-30 15:26 [Bug general/30812] New: ../libelf/gelf.h:32:10: fatal error: libelf.h: No such file or directory schwab@linux-m68k.org
@ 2023-08-30 15:47 ` mark at klomp dot org
  2023-09-03 16:24 ` mark at klomp dot org
  2023-09-04 11:41 ` mark at klomp dot org
  2 siblings, 0 replies; 4+ messages in thread
From: mark at klomp dot org @ 2023-08-30 15:47 UTC (permalink / raw)
  To: elfutils-devel

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

Mark Wielaard <mark at klomp dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mark at klomp dot org

--- Comment #1 from Mark Wielaard <mark at klomp dot org> ---
That is interesting. How are you building it?

The test should use the gelf.h and libelf.h from the current source tree, but
the system install libelf.

O... I see the testcase includes them as ../libelf/libelf.h and
../libelf/gelf.h, but then gelf.h itself does an #include <libelf.h> which
comes from the system path.

hmmm, so this is a build without libelf already installed.
Which of course is a valid setup. But have to think how to reorder the testcase
to work that way...

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug general/30812] ../libelf/gelf.h:32:10: fatal error: libelf.h: No such file or directory
  2023-08-30 15:26 [Bug general/30812] New: ../libelf/gelf.h:32:10: fatal error: libelf.h: No such file or directory schwab@linux-m68k.org
  2023-08-30 15:47 ` [Bug general/30812] " mark at klomp dot org
@ 2023-09-03 16:24 ` mark at klomp dot org
  2023-09-04 11:41 ` mark at klomp dot org
  2 siblings, 0 replies; 4+ messages in thread
From: mark at klomp dot org @ 2023-09-03 16:24 UTC (permalink / raw)
  To: elfutils-devel

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:

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

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug general/30812] ../libelf/gelf.h:32:10: fatal error: libelf.h: No such file or directory
  2023-08-30 15:26 [Bug general/30812] New: ../libelf/gelf.h:32:10: fatal error: libelf.h: No such file or directory schwab@linux-m68k.org
  2023-08-30 15:47 ` [Bug general/30812] " mark at klomp dot org
  2023-09-03 16:24 ` mark at klomp dot org
@ 2023-09-04 11:41 ` mark at klomp dot org
  2 siblings, 0 replies; 4+ messages in thread
From: mark at klomp dot org @ 2023-09-04 11:41 UTC (permalink / raw)
  To: elfutils-devel

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

Mark Wielaard <mark at klomp dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #3 from Mark Wielaard <mark at klomp dot org> ---
commit 276c367be0807301652817c0df071c90ae3c276b
Author: Mark Wielaard <mark@klomp.org>
Date:   Sun Sep 3 18:25:56 2023 +0200

    tests: Fix system_elf_gelf_test build without system libelf.h

    If there is no system libelf.h then the building of system-elf-gelf-test
    fails with:

    ../libelf/gelf.h:32:10: fatal error: libelf.h: No such file or directory

    This is because although the testcase includes the headers as
    ../libelf/libelf.h and ../libelf/gelf.h, gelf.h itself does an

    Fix this by putting a copy of libelf.h in the build test directory
    and using -I. for building system-elf-gelf-test.

            * tests/Makefile.am (BUILT_SOURCES): New for libelf.h.
            (CLEANFILES): Add libelf.h.
            (libelf.h): New target that copies srdir libelf.h.
            (system_elf_gelf_test_CPPFLAGS): Add -I.

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

    Signed-off-by: Mark Wielaard <mark@klomp.org>

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-09-04 11:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-30 15:26 [Bug general/30812] New: ../libelf/gelf.h:32:10: fatal error: libelf.h: No such file or directory schwab@linux-m68k.org
2023-08-30 15:47 ` [Bug general/30812] " mark at klomp dot org
2023-09-03 16:24 ` mark at klomp dot org
2023-09-04 11:41 ` mark at klomp dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).