From: David Miller <davem@davemloft.net>
To: wbx@openadk.org
Cc: linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org
Subject: Re: sparc gcc 7.1 compile issue
Date: Wed, 31 May 2017 17:10:08 -0400 (EDT) [thread overview]
Message-ID: <20170531.171008.528800003662477033.davem@davemloft.net> (raw)
In-Reply-To: <20170531193431.GA26922@waldemar-brodkorb.de>
A fix for this is in Linus's tree and was submitted to -stable last
night:
====================
commit deba804c90642c8ed0f15ac1083663976d578f54
Author: Orlando Arias <oarias@knights.ucf.edu>
Date: Tue May 16 15:34:00 2017 -0400
sparc: Fix -Wstringop-overflow warning
Greetings,
GCC 7 introduced the -Wstringop-overflow flag to detect buffer overflows
in calls to string handling functions [1][2]. Due to the way
``empty_zero_page'' is declared in arch/sparc/include/setup.h, this
causes a warning to trigger at compile time in the function mem_init(),
which is subsequently converted to an error. The ensuing patch fixes
this issue and aligns the declaration of empty_zero_page to that of
other architectures. Thank you.
Cheers,
Orlando.
[1] https://gcc.gnu.org/ml/gcc-patches/2016-10/msg02308.html
[2] https://gcc.gnu.org/gcc-7/changes.html
Signed-off-by: Orlando Arias <oarias@knights.ucf.edu>
--------------------------------------------------------------------------------
Signed-off-by: David S. Miller <davem@davemloft.net>
diff --git a/arch/sparc/include/asm/pgtable_32.h b/arch/sparc/include/asm/pgtable_32.h
index ce6f569..cf19072 100644
--- a/arch/sparc/include/asm/pgtable_32.h
+++ b/arch/sparc/include/asm/pgtable_32.h
@@ -91,9 +91,9 @@ extern unsigned long pfn_base;
* ZERO_PAGE is a global shared page that is always zero: used
* for zero-mapped memory areas etc..
*/
-extern unsigned long empty_zero_page;
+extern unsigned long empty_zero_page[PAGE_SIZE / sizeof(unsigned long)];
-#define ZERO_PAGE(vaddr) (virt_to_page(&empty_zero_page))
+#define ZERO_PAGE(vaddr) (virt_to_page(empty_zero_page))
/*
* In general all page table modifications should use the V8 atomic
diff --git a/arch/sparc/include/asm/setup.h b/arch/sparc/include/asm/setup.h
index 478bf6bb..3fae200 100644
--- a/arch/sparc/include/asm/setup.h
+++ b/arch/sparc/include/asm/setup.h
@@ -16,7 +16,7 @@ extern char reboot_command[];
*/
extern unsigned char boot_cpu_id;
-extern unsigned long empty_zero_page;
+extern unsigned long empty_zero_page[PAGE_SIZE / sizeof(unsigned long)];
extern int serial_console;
static inline int con_is_present(void)
diff --git a/arch/sparc/mm/init_32.c b/arch/sparc/mm/init_32.c
index c6afe98..3bd0d51 100644
--- a/arch/sparc/mm/init_32.c
+++ b/arch/sparc/mm/init_32.c
@@ -290,7 +290,7 @@ void __init mem_init(void)
/* Saves us work later. */
- memset((void *)&empty_zero_page, 0, PAGE_SIZE);
+ memset((void *)empty_zero_page, 0, PAGE_SIZE);
i = last_valid_pfn >> ((20 - PAGE_SHIFT) + 5);
i += 1;
next prev parent reply other threads:[~2017-05-31 21:10 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-31 19:34 Waldemar Brodkorb
2017-05-31 21:10 ` David Miller [this message]
2017-06-01 12:12 ` Waldemar Brodkorb
2017-06-01 12:46 ` Anatoly Pugachev
2017-06-01 12:48 ` John Paul Adrian Glaubitz
2017-06-01 16:45 ` David Miller
2017-06-02 9:17 ` John Paul Adrian Glaubitz
2017-06-02 14:22 ` David Miller
2017-06-02 16:33 ` John Paul Adrian Glaubitz
2017-06-02 17:28 ` David Miller
2017-06-04 13:16 ` John Paul Adrian Glaubitz
2017-06-04 14:40 ` Waldemar Brodkorb
2017-06-04 15:09 ` John Paul Adrian Glaubitz
2017-06-04 20:22 ` David Miller
2017-06-04 20:27 ` John Paul Adrian Glaubitz
2017-06-04 20:21 ` David Miller
2017-06-04 20:26 ` John Paul Adrian Glaubitz
2017-06-04 20:30 ` David Miller
2017-06-04 20:33 ` John Paul Adrian Glaubitz
2017-06-04 20:34 ` David Miller
2017-06-04 20:38 ` John Paul Adrian Glaubitz
2017-06-18 9:22 ` Pavel Machek
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=20170531.171008.528800003662477033.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=sparclinux@vger.kernel.org \
--cc=wbx@openadk.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
all inboxes | Powered by JetHome®