From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Thu, 27 May 2021 08:46:18 +0200 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by lore.white.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1lm9mc-0002l6-Hi for lore@lore.pengutronix.de; Thu, 27 May 2021 08:46:18 +0200 Received: from localhost ([127.0.0.1] helo=metis.ext.pengutronix.de) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1lm9mc-00068f-9I; Thu, 27 May 2021 08:46:18 +0200 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lm9li-0005kd-RO; Thu, 27 May 2021 08:45:22 +0200 Received: from [2a0a:edc0:0:1101:1d::39] (helo=dude03.red.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1lm9li-0006Tl-Bl; Thu, 27 May 2021 08:45:22 +0200 Received: from mol by dude03.red.stw.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1lm9li-00GwmN-1s; Thu, 27 May 2021 08:45:22 +0200 From: Michael Olbrich To: ptxdist@pengutronix.de Date: Thu, 27 May 2021 08:45:22 +0200 Message-Id: <20210527064522.4039152-1-m.olbrich@pengutronix.de> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210503103743.31995-1-l.stach@pengutronix.de> References: <20210503103743.31995-1-l.stach@pengutronix.de> MIME-Version: 1.0 Subject: Re: [ptxdist] [APPLIED] dtc: fix build with GCC11 X-BeenThere: ptxdist@pengutronix.de X-Mailman-Version: 2.1.29 Precedence: list List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Cc: Lucas Stach Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "ptxdist" X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: ptxdist-bounces@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false Thanks, applied as c9de1f5357809c4d00396ebaf2f1ba3de1258269. Michael [sent from post-receive hook] On Thu, 27 May 2021 08:45:21 +0200, Lucas Stach wrote: > Pick patch from upstream to fix warning with GCC11. > > Signed-off-by: Lucas Stach > Message-Id: <20210503103743.31995-1-l.stach@pengutronix.de> > Signed-off-by: Michael Olbrich > > diff --git a/patches/dtc-v1.6.0/0001-fdtdump-Fix-gcc11-warning.patch b/patches/dtc-v1.6.0/0001-fdtdump-Fix-gcc11-warning.patch > new file mode 100644 > index 000000000000..052419940a15 > --- /dev/null > +++ b/patches/dtc-v1.6.0/0001-fdtdump-Fix-gcc11-warning.patch > @@ -0,0 +1,30 @@ > +From: David Gibson > +Date: Wed, 6 Jan 2021 14:52:26 +1100 > +Subject: [PATCH] fdtdump: Fix gcc11 warning > + > +In one place, fdtdump abuses fdt_set_magic(), passing it just a small char > +array instead of the full fdt header it expects. That's relying on the > +fact that in fact fdt_set_magic() will only actually access the first 4 > +bytes of the buffer. > + > +This trips a new warning in GCC 11 - and it's entirely possible it was > +always UB. So, don't do that. > + > +Signed-off-by: David Gibson > +--- > + fdtdump.c | 2 +- > + 1 file changed, 1 insertion(+), 1 deletion(-) > + > +diff --git a/fdtdump.c b/fdtdump.c > +index 9613befede71..d9fb374a59be 100644 > +--- a/fdtdump.c > ++++ b/fdtdump.c > +@@ -217,7 +217,7 @@ int main(int argc, char *argv[]) > + char *p = buf; > + char *endp = buf + len; > + > +- fdt_set_magic(smagic, FDT_MAGIC); > ++ fdt32_st(smagic, FDT_MAGIC); > + > + /* poor man's memmem */ > + while ((endp - p) >= FDT_MAGIC_SIZE) { > diff --git a/patches/dtc-v1.6.0/series b/patches/dtc-v1.6.0/series > new file mode 100644 > index 000000000000..a7e9d0319ba0 > --- /dev/null > +++ b/patches/dtc-v1.6.0/series > @@ -0,0 +1,4 @@ > +# generated by git-ptx-patches > +#tag:base --start-number 1 > +0001-fdtdump-Fix-gcc11-warning.patch > +# cb5c26c7ab3ae2082ecff7af4de4e8c5 - git-ptx-patches magic _______________________________________________ ptxdist mailing list ptxdist@pengutronix.de To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de