Re: sparc gcc 7.1 compile issue

From: David Miller
Date: Thu Jun 01 2017 - 12:46:28 EST


From: Anatoly Pugachev <matorola@xxxxxxxxx>
Date: Thu, 1 Jun 2017 15:46:04 +0300

> on the same topic , latest git does not compile for me with gcc-7.0.1
> gcc version 7.0.1 20170407 (experimental) [trunk revision 246759]
> (Debian 7-20170407-1)
>
> $ make
> ...
> CC arch/sparc/kernel/ds.o
> arch/sparc/kernel/ds.c: In function ʽregister_servicesʼ:
> arch/sparc/kernel/ds.c:912:3: error: ʽstrcpyʼ: writing at least 1 byte
> into a region of size 0 overflows the destination
> [-Werror=stringop-overflow ]
> strcpy(pbuf.req.svc_id, cp->service_id);
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

That's easy enough to fix, I've pushed the patch below to 'sparc' GIT.

> MODPOST vmlinux.o
> ipc/built-in.o: In function `mq_attr_ok.isra.0':
> mqueue.c:(.text+0xc490): undefined reference to `__multi3'
> drivers/built-in.o: In function `dm_vcalloc':
> (.text+0xc9e98): undefined reference to `__multi3'
> Makefile:997: recipe for target 'vmlinux' failed
> make: *** [vmlinux] Error 1

This, on the other hand.... wonder why it wants to do a 128-bit multiply
when the MQ attribute struct is just 64-bit values...

====================
From 0fde7ad71ee371ede73b3f326e58f9e8d102feb6 Mon Sep 17 00:00:00 2001
From: "David S. Miller" <davem@xxxxxxxxxxxxx>
Date: Thu, 1 Jun 2017 09:42:46 -0700
Subject: [PATCH] sparc64: Fix build warnings with gcc 7.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

arch/sparc/kernel/ds.c: In function ʽregister_servicesʼ:
arch/sparc/kernel/ds.c:912:3: error: ʽstrcpyʼ: writing at least 1 byte
into a region of size 0 overflows the destination

Reported-by: Anatoly Pugachev <matorola@xxxxxxxxx>
Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
---
arch/sparc/kernel/ds.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/sparc/kernel/ds.c b/arch/sparc/kernel/ds.c
index b542cc7..f87265a 100644
--- a/arch/sparc/kernel/ds.c
+++ b/arch/sparc/kernel/ds.c
@@ -909,7 +909,7 @@ static int register_services(struct ds_info *dp)
pbuf.req.handle = cp->handle;
pbuf.req.major = 1;
pbuf.req.minor = 0;
- strcpy(pbuf.req.svc_id, cp->service_id);
+ strcpy(pbuf.id_buf, cp->service_id);

err = __ds_send(lp, &pbuf, msg_len);
if (err > 0)
--
2.1.2.532.g19b5d50