Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752483AbdFOWf4 (ORCPT ); Thu, 15 Jun 2017 18:35:56 -0400 Received: from mail-co1nam03on0076.outbound.protection.outlook.com ([104.47.40.76]:5608 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752071AbdFOWfw (ORCPT ); Thu, 15 Jun 2017 18:35:52 -0400 Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=none action=none header.from=cavium.com; From: David Daney To: Alexei Starovoitov , Daniel Borkmann , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mips@linux-mips.org, ralf@linux-mips.org, Catalin Marinas , Will Deacon , linux-arm-kernel@lists.infradead.org Cc: David Daney Subject: [PATCH RFC 2/3] samples/bpf: Add define __EMITTING_BPF__ when building BPF Date: Thu, 15 Jun 2017 15:35:42 -0700 Message-Id: <20170615223543.22867-3-david.daney@cavium.com> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170615223543.22867-1-david.daney@cavium.com> References: <20170615223543.22867-1-david.daney@cavium.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [50.233.148.156] X-ClientProxiedBy: CO2PR07CA0070.namprd07.prod.outlook.com (10.174.192.38) To MWHPR07MB3501.namprd07.prod.outlook.com (10.164.192.28) X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWHPR07MB3501: X-MS-Office365-Filtering-Correlation-Id: fbfa0dea-f5ad-425e-d680-08d4b43edf00 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(201703131423075)(201703031133081);SRVR:MWHPR07MB3501; X-Microsoft-Exchange-Diagnostics: 1;MWHPR07MB3501;3:g11bbMpWJAf2H0EtDDZQPX9qg+k3rbbeGAoS2ifdLAXnZJR+rVuMLNvhw4qev12Fa0RJBDDiJfFxE6IJJIbqX2wQMRBkvFjGDS0iNb56JiNtVmiD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ZR7YcmGeX7+xb1ULJ+W3sxE/QHZrWKl5WjQXhhywchk0txc94GyWYyVHToXsCau71ZPMCBuYOV+l8fs6NEFhBQCYByWqAbUpAkry4E66Jk3MYuaUKUBFMXrdU7hF+G/8AymBJqmHEuW+z9nK2S/nH5HWmgkoRLyP3sWWJlp89lNWPk6HfkglF7UmkQZijaMaAAbckzCfvu/kE5JwnkL1Arqgc8CF2GBEbO+9uKwvXgXlKsDbFS5MFq+1QNgTLl6y5a7mvCBTI6z8s3hc2RAkOS5z8OzCBWzWF0FSFBb1AS5H+8h5CJvL3X1hkfwRywmeLegKXoCSDJ8kod6LDION/XuJXrVkFhEy+29iGbCAWq4ERG6fBQNPjhH7w4bF/Ujw/cSLC8wl72GvTL3uqEJqehqZ7sca56LgekSrjZ8kJUfvtLnv12 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(100000703101)(100105400095)(3002001)(6041248)(20161123558100)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123555025)(20161123562025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:MWHPR07MB3501;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:MWHPR07MB3501; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;MWHPR07MB3501;4:JAruq2hyVWsC2PXSYewcNmKnq6doXFx0aQzOE8p5pU?= =?us-ascii?Q?woJfpHfapV6gKAedzajiZ6RwGZkoABtUlEmP1N+CNIdcJy5tUp7hGTYXajge?= =?us-ascii?Q?w/ARJnm5GA5QNLF3QP1Qd6mfx68jbiQbvdH0DN0qq+kamEabzz1TI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KTtdqyuwH/YgcduyWXRcVCJZSEKrHaPQeE8Ywb7U?= =?us-ascii?Q?YUAiA3qHtySsXozGDozqm1xckQzgOhOxlClBV1oOXyEZQZ6ZY3Au1BJXyMkU?= =?us-ascii?Q?nxFwzvzoR9BbT4Z17EPagMVX9g8R9F?= X-Forefront-PRVS: 0339F89554 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6009001)(39400400002)(39850400002)(39410400002)(39450400003)(39860400002)(39840400002)(81166006)(72206003)(8676002)(47776003)(1076002)(7736002)(305945005)(76176999)(6116002)(50986999)(86362001)(5660300001)(2906002)(36756003)(3846002)(38730400002)(66066001)(2950100002)(53416004)(6506006)(189998001)(478600001)(107886003)(4326008)(6512007)(5003940100001)(42186005)(33646002)(6486002)(50466002)(53936002)(48376002)(25786009)(50226002)(6666003)(217873001);DIR:OUT;SFP:1101;SCL:1;SRVR:MWHPR07MB3501;H:ddl.caveonetworks.com;FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;MWHPR07MB3501;23:Jn8yA85su0aHoLv5xFz3aVlLHPp8CtIN3OcWmiNpb?= =?us-ascii?Q?GBQvhhrX5ujLCb0ms4g42FeD0GenKA0Vj9uP5/CMk/RwvESw78m8LrCLlXFT?= =?us-ascii?Q?EnDk2/1o/itg875EtIsZQztMikTlj/NLZmmMlfBpiAftDep1d2cwR9LutCTB?= =?us-ascii?Q?RP+pNIZWwJeoidq00GSn38HDFqy+216UOZGdoiDHBMYaOS6wgx7BQoRNVDEg?= =?us-ascii?Q?Ss05ew/8ZQ4pFOdy/0WlgtBnNsGsObprP09nUO9YOaWNFDoyyby+lDLkfdBu?= =?us-ascii?Q?0QIu02LibwuQYRF2aUytBGquvRgDiDUhvr2lNH4fgzw8p5sd2hlYUO0eJTtT?= =?us-ascii?Q?8hS3XkS1vnpXFiH/59gYMAKfOZf8W1wz9Tn3kgS4n+vobmTOIyvb2SnOo+CK?= =?us-asc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: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;MWHPR07MB3501;7:GDp9WEk1gLhgCp7Ggo/2V3hzuX1UXwfTy9Vznz3d4UCdUWgbTJOf3Q4rLGnliED7BNQJc7U9YtW2nDZJA0cQxYtsUr7znj0zuMrKIDwul8KC6MmMW7nbVKSo7Xm+R15YtLX2oMG0g4opv8EZOEiZS5t1OW3O/xRpR9wHdZaEl98NbQ1d2L76yBCX8f70uQcxL7vicaUxutPXes9vNPTNvZJKri/KMcP1SFDjn6YmY1eAKyVsO+C4evcYVitkdvZ/nn55V3eR7PJnkrbb+NldbPifJG3snGfXNrhzbriNZfP2gi5TVZIY+w2Go37hD4lU4oFF535shh9rO9zlGdXzHQ== X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jun 2017 22:35:48.4678 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR07MB3501 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1143 Lines: 31 ... this allows gating of inline assembly code that causes llvm to fail when emitting BPF. Signed-off-by: David Daney --- samples/bpf/Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile index a0561dc762fe..4979e6b56662 100644 --- a/samples/bpf/Makefile +++ b/samples/bpf/Makefile @@ -193,12 +193,12 @@ $(src)/*.c: verify_target_bpf $(obj)/tracex5_kern.o: $(obj)/syscall_nrs.h -# asm/sysreg.h - inline assembly used by it is incompatible with llvm. -# But, there is no easy way to fix it, so just exclude it since it is -# useless for BPF samples. +# __EMITTING_BPF__ used to exclude inline assembly, which cannot be +# emitted in BPF code. $(obj)/%.o: $(src)/%.c $(CLANG) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) $(EXTRA_CFLAGS) \ - -D__KERNEL__ -D__ASM_SYSREG_H -Wno-unused-value -Wno-pointer-sign \ + -D__KERNEL__ -D__EMITTING_BPF__ \ + -Wno-unused-value -Wno-pointer-sign \ -Wno-compare-distinct-pointer-types \ -Wno-gnu-variable-sized-type-not-at-end \ -Wno-address-of-packed-member -Wno-tautological-compare \ -- 2.11.0