public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Luis Machado <luis.machado@linaro.org>
To: gdb-patches@sourceware.org, vapier@gentoo.org
Subject: [PATCH,v2][sim,moxie] Fix DTB generation mechanism and build failure
Date: Thu,  8 Apr 2021 11:40:10 -0300	[thread overview]
Message-ID: <20210408144010.1334633-1-luis.machado@linaro.org> (raw)

I ran into a build failure with --enable-targets=all due to the fact that
the moxie sim expects to be able to use the dtc tool.  If it isn't available,
the builds fails.

The following patch adds a prebuilt dtb file to the tree. That file is the one
that is used for installations.

The patch also enables (re-)generation of the dtb file through maintainer
mode, if it needs to be updated due to a change in the dts file.

Tested on aarch64-linux/x86_64-linux.

sim/moxie/ChangeLog:

YYYY-MM-DD  Luis Machado  <luis.machado@linaro.org>

	* Makefile.in (moxie-gdb.dtb): Add maintainer mode dependency.
	(install-dtb): Install prebuilt dtb file.
	* moxie-gdb.dtb: New prebuilt file.
---
 sim/moxie/Makefile.in   |  11 ++++++++---
 sim/moxie/moxie-gdb.dtb | Bin 0 -> 519 bytes
 2 files changed, 8 insertions(+), 3 deletions(-)
 create mode 100644 sim/moxie/moxie-gdb.dtb

diff --git a/sim/moxie/Makefile.in b/sim/moxie/Makefile.in
index ee513867290..78e140fdfb2 100644
--- a/sim/moxie/Makefile.in
+++ b/sim/moxie/Makefile.in
@@ -17,6 +17,8 @@
 
 ## COMMON_PRE_CONFIG_FRAG
 
+DTC = @DTC@
+
 dtbdir = @datadir@/gdb/dtb
 
 SIM_OBJS = \
@@ -32,9 +34,12 @@ SIM_EXTRA_CFLAGS = -DDTB="\"$(dtbdir)/moxie-gdb.dtb\""
 
 all: moxie-gdb.dtb
 
-moxie-gdb.dtb: moxie-gdb.dts
-	dtc -O dtb -o moxie-gdb.dtb ${srcdir}/moxie-gdb.dts
+moxie-gdb.dtb: @MAINTAINER_MODE_TRUE@ moxie-gdb.dts
+	if test "x$(DTC)" != x; then \
+	  $(DTC) -O dtb -o moxie-gdb.dtb ${srcdir}/moxie-gdb.dts ; \
+	  $(SHELL) $(srcroot)/move-if-change moxie-gdb.dtb ${srcdir}/moxie-gdb.dtb ; \
+	fi ;
 
 install-dtb: moxie-gdb.dtb
 	$(SHELL) $(srcdir)/../../mkinstalldirs $(DESTDIR)$(dtbdir)
-	$(INSTALL_DATA) moxie-gdb.dtb $(DESTDIR)$(dtbdir)/moxie-gdb.dtb
+	$(INSTALL_DATA) $(srcdir)/moxie-gdb.dtb $(DESTDIR)$(dtbdir)/moxie-gdb.dtb
diff --git a/sim/moxie/moxie-gdb.dtb b/sim/moxie/moxie-gdb.dtb
new file mode 100644
index 0000000000000000000000000000000000000000..4c7e4570438a62b81df2021bb4c955d9888d2a8b
GIT binary patch
literal 519
zcmZ8d%}T^D5T34riikhgUWA3kLo4;>f(v``<U>fCjx~}tA<2sM>|^;5zKE|N&LrtB
z8ko*}U%r{nm#>qbZ-ChW0Nes(pOmjC&MD3)_&gB*5z9Z{ETKKh`>AGb!lzVE_=4)Z
zYn!6iZxTyXPbHz)#QH;ug-7S*&@r3!*lRnkt8|!S9q(DhJEj81y|nvwi5Zodc-9UF
zW`icDe5cII>V^hh3OzWjaD}y1qeEK-UF<U(7tqcJ!^sExy#I&UC!b81%{q<>|KvB!
zgWu%3x?V1WayPr69;VpaF~uV4x60`)gFm|G9j7>&*KKRjxl*7~4(3k2W2%MjP3>i)
d5PIFBf)-z;z(+qC1dAOsTKn2|)I}RO_yq~^OHTj*

literal 0
HcmV?d00001

-- 
2.25.1


         reply	other threads:[~2021-04-08 14:40 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-07 19:39 [PATCH] [sim,moxie] " Luis Machado
2021-04-07 20:26 ` Mike Frysinger
2021-04-07 20:39   ` Luis Machado
2021-04-07 22:31     ` Mike Frysinger
2021-04-08 14:40       ` Luis Machado
2021-04-08 14:40 ` Luis Machado [this message]
2021-04-08 16:37   ` [PATCH,v2][sim,moxie] " Mike Frysinger
2021-04-08 17:21 ` [PATCH,v3][sim,moxie] " Luis Machado
2021-04-08 17:44   ` Mike Frysinger
2021-04-08 18:03     ` Luis Machado

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=20210408144010.1334633-1-luis.machado@linaro.org \
    --to=luis.machado@linaro.org \
    --cc=gdb-patches@sourceware.org \
    --cc=vapier@gentoo.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).