From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751348AbdIMHoe (ORCPT ); Wed, 13 Sep 2017 03:44:34 -0400 Received: from terminus.zytor.com ([65.50.211.136]:38001 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750737AbdIMHob (ORCPT ); Wed, 13 Sep 2017 03:44:31 -0400 Date: Wed, 13 Sep 2017 00:43:17 -0700 From: tip-bot for Arnaldo Carvalho de Melo Message-ID: Cc: namhyung@kernel.org, mingo@kernel.org, acme@redhat.com, tglx@linutronix.de, linux-kernel@vger.kernel.org, adrian.hunter@intel.com, wangnan0@huawei.com, hpa@zytor.com, jolsa@kernel.org Reply-To: acme@redhat.com, mingo@kernel.org, namhyung@kernel.org, jolsa@kernel.org, hpa@zytor.com, wangnan0@huawei.com, adrian.hunter@intel.com, tglx@linutronix.de, linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/urgent] tools include linux: Guard against redefinition of some macros Git-Commit-ID: 259d40775ee11dbeba022514815df08c57994ef3 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 259d40775ee11dbeba022514815df08c57994ef3 Gitweb: http://git.kernel.org/tip/259d40775ee11dbeba022514815df08c57994ef3 Author: Arnaldo Carvalho de Melo AuthorDate: Tue, 5 Sep 2017 10:52:02 -0300 Committer: Arnaldo Carvalho de Melo CommitDate: Tue, 12 Sep 2017 12:33:39 -0300 tools include linux: Guard against redefinition of some macros When cross building to android r15c (and older versions) on Fedora 26 we notice these: /opt/android-ndk-r15c/platforms/android-24/arch-arm/usr/include/sys/cdefs.h:332:0: note: this is the location of the previous definition For __aligned, __packed and __noreturn, so guard those with ifdefs to avoid drowning useful warnings in these. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Cc: Wang Nan Link: http://lkml.kernel.org/n/tip-d7w3fa9c22dtmrwbedos6ie1@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/include/linux/compiler-gcc.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tools/include/linux/compiler-gcc.h b/tools/include/linux/compiler-gcc.h index bd39b20..3723b9f 100644 --- a/tools/include/linux/compiler-gcc.h +++ b/tools/include/linux/compiler-gcc.h @@ -21,11 +21,14 @@ #define __must_be_array(a) BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0])) #define noinline __attribute__((noinline)) - +#ifndef __packed #define __packed __attribute__((packed)) - +#endif +#ifndef __noreturn #define __noreturn __attribute__((noreturn)) - +#endif +#ifndef __aligned #define __aligned(x) __attribute__((aligned(x))) +#endif #define __printf(a, b) __attribute__((format(printf, a, b))) #define __scanf(a, b) __attribute__((format(scanf, a, b)))