Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@adacore.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tromey@adacore.com>
Subject: [PATCH 2/3] Fix igen build
Date: Tue,  4 May 2021 08:58:17 -0600	[thread overview]
Message-ID: <20210504145818.4088770-3-tromey@adacore.com> (raw)
In-Reply-To: <20210504145818.4088770-1-tromey@adacore.com>

The igen build fails for me like:

gcc  -g -O2 -c ../../binutils-gdb/sim/igen/igen.c -o igen/igen.o
In file included from ../../binutils-gdb/sim/igen/igen.c:26:
../../binutils-gdb/sim/igen/lf.h:22:10: fatal error: ansidecl.h: No such file or directory

This patch fixes the problem by arranging for igen to find the
libiberty includes.

This seems slightly hacky to me, because libiberty is not a "build"
library, so it can't be linked against.  However, since igen currently
only includes the header, it seems relatively safe.

sim/ChangeLog
2021-05-04  Tom Tromey  <tromey@adacore.com>

	* Makefile.in: Rebuild.
	* Makefile.am (AM_CPPFLAGS): New variable.
---
 sim/ChangeLog   | 5 +++++
 sim/Makefile.am | 2 ++
 sim/Makefile.in | 1 +
 3 files changed, 8 insertions(+)

diff --git a/sim/Makefile.am b/sim/Makefile.am
index a68a964d87a..6696adc304a 100644
--- a/sim/Makefile.am
+++ b/sim/Makefile.am
@@ -35,6 +35,8 @@ CLEANFILES =
 DISTCLEANFILES =
 MOSTLYCLEANFILES = core
 
+AM_CPPFLAGS = -I$(srcroot)/include
+
 COMPILE_FOR_BUILD = $(CC_FOR_BUILD) $(AM_CPPFLAGS) $(CFLAGS_FOR_BUILD)
 LINK_FOR_BUILD = $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -o $@
 
diff --git a/sim/Makefile.in b/sim/Makefile.in
index 890adab5072..5c997b0c118 100644
--- a/sim/Makefile.in
+++ b/sim/Makefile.in
@@ -682,6 +682,7 @@ CLEANFILES = testsuite/common/bits-gen testsuite/common/bits32m0.c \
 DISTCLEANFILES = 
 MOSTLYCLEANFILES = core $(am__append_3) site-srcdir.exp testrun.log \
 	testrun.sum
+AM_CPPFLAGS = -I$(srcroot)/include
 COMPILE_FOR_BUILD = $(CC_FOR_BUILD) $(AM_CPPFLAGS) $(CFLAGS_FOR_BUILD)
 LINK_FOR_BUILD = $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -o $@
 @SIM_ENABLE_IGEN_TRUE@igen_libigen_a_SOURCES = \
-- 
2.26.3


  parent reply	other threads:[~2021-05-04 14:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-04 14:58 [PATCH 0/3] Some minor sim fixes Tom Tromey
2021-05-04 14:58 ` [PATCH 1/3] Add config.h to generated_files for sim Tom Tromey
2021-05-04 17:38   ` Mike Frysinger via Gdb-patches
2021-05-04 14:58 ` Tom Tromey [this message]
2021-05-04 17:38   ` [PATCH 2/3] Fix igen build Mike Frysinger via Gdb-patches
2021-05-04 14:58 ` [PATCH 3/3] Add missing stdlib.h includes to sim Tom Tromey
2021-05-04 17:44   ` Mike Frysinger via Gdb-patches
2021-05-04 19:17     ` Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210504145818.4088770-3-tromey@adacore.com \
    --to=tromey@adacore.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox