1 From 7210e060155b9cf557fb13128353c3e494fa5ed3 Mon Sep 17 00:00:00 2001
2 From: Kees Cook <keescook@chromium.org>
3 Date: Mon, 20 May 2019 11:50:42 -0700
4 Subject: gcc-plugins: Fix build failures under Darwin host
6 From: Kees Cook <keescook@chromium.org>
8 commit 7210e060155b9cf557fb13128353c3e494fa5ed3 upstream.
10 The gcc-common.h file did not take into account certain macros that
11 might have already been defined in the build environment. This updates
12 the header to avoid redefining the macros, as seen on a Darwin host
15 HOSTCXX -fPIC scripts/gcc-plugins/arm_ssp_per_task_plugin.o - due to: scripts/gcc-plugins/gcc-common.h
16 In file included from scripts/gcc-plugins/arm_ssp_per_task_plugin.c:3:0:
17 scripts/gcc-plugins/gcc-common.h:153:0: warning: "__unused" redefined
19 In file included from /usr/include/stdio.h:64:0,
20 from /Users/hns/Documents/Projects/QuantumSTEP/System/Library/Frameworks/System.framework/Versions-jessie/x86_64-apple-darwin15.0.0/gcc/arm-linux-gnueabi/bin/../lib/gcc/arm-linux-gnueabi/4.9.2/plugin/include/system.h:40,
21 from /Users/hns/Documents/Projects/QuantumSTEP/System/Library/Frameworks/System.framework/Versions-jessie/x86_64-apple-darwin15.0.0/gcc/arm-linux-gnueabi/bin/../lib/gcc/arm-linux-gnueabi/4.9.2/plugin/include/gcc-plugin.h:28,
22 from /Users/hns/Documents/Projects/QuantumSTEP/System/Library/Frameworks/System.framework/Versions-jessie/x86_64-apple-darwin15.0.0/gcc/arm-linux-gnueabi/bin/../lib/gcc/arm-linux-gnueabi/4.9.2/plugin/include/plugin.h:23,
23 from scripts/gcc-plugins/gcc-common.h:9,
24 from scripts/gcc-plugins/arm_ssp_per_task_plugin.c:3:
25 /usr/include/sys/cdefs.h:161:0: note: this is the location of the previous definition
28 Reported-and-tested-by: "H. Nikolaus Schaller" <hns@goldelico.com>
29 Fixes: 189af4657186 ("ARM: smp: add support for per-task stack canaries")
30 Cc: stable@vger.kernel.org
31 Signed-off-by: Kees Cook <keescook@chromium.org>
32 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
35 scripts/gcc-plugins/gcc-common.h | 4 ++++
36 1 file changed, 4 insertions(+)
38 --- a/scripts/gcc-plugins/gcc-common.h
39 +++ b/scripts/gcc-plugins/gcc-common.h
40 @@ -150,8 +150,12 @@ void print_gimple_expr(FILE *, gimple, i
41 void dump_gimple_stmt(pretty_printer *, gimple, int, int);
45 #define __unused __attribute__((__unused__))
48 #define __visible __attribute__((visibility("default")))
51 #define DECL_NAME_POINTER(node) IDENTIFIER_POINTER(DECL_NAME(node))
52 #define DECL_NAME_LENGTH(node) IDENTIFIER_LENGTH(DECL_NAME(node))