From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qv1-xf2b.google.com (mail-qv1-xf2b.google.com [IPv6:2607:f8b0:4864:20::f2b]) by sourceware.org (Postfix) with ESMTPS id 8752E385781F for ; Wed, 7 Apr 2021 19:39:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 8752E385781F Received: by mail-qv1-xf2b.google.com with SMTP id h3so6652620qvr.10 for ; Wed, 07 Apr 2021 12:39:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=/ceMQlktkrDZr6JHC+rA9dwijQUKIy30MCYJlWFSeRI=; b=ijwdSLhEcHwcQghFZKo83OXP61Mwmfp8eLQzVjGefUhx1Lxo+7hiaqVYil/u/GeHPy QwT/cr3N1xA7WfygOGA2go+CWeqw6ZSySPZD8g6K2N8gKD+lu0V7g28ogzFNq7h5YW3H a35ZRpWTLIM+u5EuJ0sTVFl5W4UkAZGL8Jijfx5Zof2OPPWzNHOhNbBR1tXoqMQ8ucnY cRAoXDW1/JuzO/uctFMdCRJlPFhajkU5jl7gJjuXtwcIozhIKnEIoufy04trAGHw54C7 5wLW+kAauu1kzzdl1h2lm/qT3yF1kDeKB36Q/RHWCFPVtUGueJQgwVwL8/EbPWlTTl54 buXA== X-Gm-Message-State: AOAM5322lsJZnK56SSwiqReKvLqk58oTbt6udqdwMiZImUH9GNjUixAP 0rcCszOMXetowQpWg12OMKRt8+uW79tk+g== X-Google-Smtp-Source: ABdhPJzwF43DYKvSEXuX3dh5J5+CZKfGATnTSUfx8KBPiZ7+2AYOfRH9RQH6V/1ieotQFrTxXHCBUA== X-Received: by 2002:ad4:4aa2:: with SMTP id i2mr3875367qvx.26.1617824374146; Wed, 07 Apr 2021 12:39:34 -0700 (PDT) Received: from localhost.localdomain ([2804:7f0:4841:2841:516e:f0db:af1:ccb4]) by smtp.gmail.com with ESMTPSA id f136sm19324720qke.24.2021.04.07.12.39.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Apr 2021 12:39:33 -0700 (PDT) From: Luis Machado To: gdb-patches@sourceware.org Subject: [PATCH] [sim,moxie] Fix DTB generation mechanism and build failure Date: Wed, 7 Apr 2021 16:39:29 -0300 Message-Id: <20210407193929.1251903-1-luis.machado@linaro.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Apr 2021 19:39:36 -0000 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. Given the device tree compiler (dtc) is not available everywhere, it seems fair to only generate the DTB file on the spot if we have such a tool. For those who don't have the tool available, we can use a prebuilt version of the DTB available in the repository. The DTS file hasn't changed since ~2009, so it seems pretty safe to assume a prebuilt version is suitable to be used. I also checked that the DTB file generated on an x86_64-Linux machine is the the same as the one generated on an AArch64-Linux machine. Tested by running make/make install with/without the dtc tool. --- sim/moxie/Makefile.in | 12 ++++++++++-- sim/moxie/moxie-gdb.dtb | Bin 0 -> 519 bytes 2 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 sim/moxie/moxie-gdb.dtb diff --git a/sim/moxie/Makefile.in b/sim/moxie/Makefile.in index ee513867290..65c41e6c2ac 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 = \ @@ -33,8 +35,14 @@ 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 + if test "x$(DTC)" != x; then \ + $(DTC) -O dtb -o moxie-gdb.dtb ${srcdir}/moxie-gdb.dts ; \ + fi ; install-dtb: moxie-gdb.dtb $(SHELL) $(srcdir)/../../mkinstalldirs $(DESTDIR)$(dtbdir) - $(INSTALL_DATA) moxie-gdb.dtb $(DESTDIR)$(dtbdir)/moxie-gdb.dtb + if test "x$(DTC)" = x; then \ + $(INSTALL_DATA) $(srcdir)/moxie-gdb.dtb $(DESTDIR)$(dtbdir)/moxie-gdb.dtb ; \ + else \ + $(INSTALL_DATA) moxie-gdb.dtb $(DESTDIR)$(dtbdir)/moxie-gdb.dtb ; \ + fi ; 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``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|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