Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp331245ybi; Fri, 7 Jun 2019 08:45:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqw/U5DMH0pBPubM7iv5xkSWBSstiiJ5Wz8Yr+xpA+o4iH4Zrwfc454Su98GBUx3CFpPin0w X-Received: by 2002:a17:902:d896:: with SMTP id b22mr56480545plz.40.1559922328408; Fri, 07 Jun 2019 08:45:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559922328; cv=none; d=google.com; s=arc-20160816; b=okbbFJ4dZx5aHI0OPMWhXB0mDhYLmUSwQ1YpEsX3PQV9B+B6970PcI/fNiKDlyQ9QX 3mxa2in55b71Zk3O5ElBFamk5tecJXYDp0dt0vPUkNV1Y4ozp3D1Dtovo+WpFfmvFIEh OfTvqOJVf3dWwiAhY8vRsJCpVs8iyzsPSCA42LkmM2niOsHIWDRXre0yUhbGuDa/zvAl T9gl1319Se9IcaNcfaX3uf+iTbX+9gbKwPOegefBxrrbAt3wmeDzNBGCsF6Ub5BZ9dZB 6LJMSfEOXHE+ja6tB9It9rymuRznU35SQ+/0tj2L6XLOPIMM8SY/hl9he728G2VDpHjA iqnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ODbjoNqcpG5+3d8g6P18mYEzJricBxEmGpVRZAJSkO8=; b=Pll3kYGw0/4s0fXPsAyW2IH45/kacohKykN2qMjpPzI7oN8RPQ1TmPP6t7zFRtz7jU vCIxaZEoqyPZiWjtc18ZPKE7jj1Apn+8UXuZESd12ouIhzVe7NSVwyB/LWda3G0rjEDn aFP5Op5+z7hOJyYJPUmUBi5GFSwfadYSGTFGRqlwaswJkvSiWponqnNcMWu+yXwcSNjn CpZD1T8ehk4Y4y+VC0LR8EarpT00DPt9lCwMKT/vWZnSHpHEdThdFCB3XH5fga/j4me3 J9ugB9B9EKcBZJBLcRg2ziFXCFi5YLDWs+5vrdVaaM/efBqvC1D/mD4i7ljLvaF7l1Ng tRhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=FxWBuEyf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z10si2122302pgr.413.2019.06.07.08.45.11; Fri, 07 Jun 2019 08:45:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=FxWBuEyf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730695AbfFGPmz (ORCPT + 99 others); Fri, 7 Jun 2019 11:42:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:53708 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730663AbfFGPmu (ORCPT ); Fri, 7 Jun 2019 11:42:50 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 588D421479; Fri, 7 Jun 2019 15:42:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559922169; bh=PRLpC5nwM9nO3KrtQa6s3Sz5d8KnuDm79+AssLvw99g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FxWBuEyfXh7/laGS5A7dG/BvraPK81MMIOOMgh3/fb3Bmn4jZ3rA7yzEl5nuxlYzB zGfeRgwvoDqXguOQqICu67YecVbf1oEVc4iyyZ+HDSQUi3k0hKpzoNidf0M+xY1OFV q2Y/acLQGgNKDcAlskDGp7YKPQBZvHYKQbvFbEZg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kees Cook , "H. Nikolaus Schaller" Subject: [PATCH 4.14 61/69] gcc-plugins: Fix build failures under Darwin host Date: Fri, 7 Jun 2019 17:39:42 +0200 Message-Id: <20190607153855.545998344@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190607153848.271562617@linuxfoundation.org> References: <20190607153848.271562617@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Kees Cook commit 7210e060155b9cf557fb13128353c3e494fa5ed3 upstream. The gcc-common.h file did not take into account certain macros that might have already been defined in the build environment. This updates the header to avoid redefining the macros, as seen on a Darwin host using gcc 4.9.2: HOSTCXX -fPIC scripts/gcc-plugins/arm_ssp_per_task_plugin.o - due to: scripts/gcc-plugins/gcc-common.h In file included from scripts/gcc-plugins/arm_ssp_per_task_plugin.c:3:0: scripts/gcc-plugins/gcc-common.h:153:0: warning: "__unused" redefined ^ In file included from /usr/include/stdio.h:64:0, 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, 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, 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, from scripts/gcc-plugins/gcc-common.h:9, from scripts/gcc-plugins/arm_ssp_per_task_plugin.c:3: /usr/include/sys/cdefs.h:161:0: note: this is the location of the previous definition ^ Reported-and-tested-by: "H. Nikolaus Schaller" Fixes: 189af4657186 ("ARM: smp: add support for per-task stack canaries") Cc: stable@vger.kernel.org Signed-off-by: Kees Cook Signed-off-by: Greg Kroah-Hartman --- scripts/gcc-plugins/gcc-common.h | 4 ++++ 1 file changed, 4 insertions(+) --- a/scripts/gcc-plugins/gcc-common.h +++ b/scripts/gcc-plugins/gcc-common.h @@ -150,8 +150,12 @@ void print_gimple_expr(FILE *, gimple, i void dump_gimple_stmt(pretty_printer *, gimple, int, int); #endif +#ifndef __unused #define __unused __attribute__((__unused__)) +#endif +#ifndef __visible #define __visible __attribute__((visibility("default"))) +#endif #define DECL_NAME_POINTER(node) IDENTIFIER_POINTER(DECL_NAME(node)) #define DECL_NAME_LENGTH(node) IDENTIFIER_LENGTH(DECL_NAME(node))