From patchwork Fri Aug 30 00:50:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 172665 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp3000970ily; Thu, 29 Aug 2019 17:51:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqwksfjDrD606ayCLt0gRa9kpjvXEHtnPuCqtjYCDk8XQ20eY+4mN68+lam4w8wM/Xlj3N8P X-Received: by 2002:a17:902:e506:: with SMTP id ck6mr13180004plb.132.1567126296917; Thu, 29 Aug 2019 17:51:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567126296; cv=none; d=google.com; s=arc-20160816; b=DyGTSHwo0M5E2OM0O7ugEyQqRiyWRKr1WiIa/8lT21+D/aessgj9viLPfaMJ/nErX3 u+QzLGTszg+dVpxfB4M0AbHWjrQrntaSjr/pn3Ne1TnUpMiydLtoRByNcFUYb68B+A7z gm2mK9WtA316HUE9GzRmGnJc6qu80+rEbEsJBWda4UHDeKkn6RpK9RCdGbPfPN7Dqgfd Oog+KiAXBqJcpyyfX/FHvK3E6q087vyTrX8fI/6dkjv/P3dHorrBGvLYs50kwRmu6n+D r9M/PvEkYTH1O0iDoxJwpg+Jqy/XdzWLwV7mEfdm3MkP2JlwawEMfSHgmnORCBy0jxBQ hpxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=LKaVdiULHZHeM3qmwqXGbS3W/6JSevNYH66TL2VqMJs=; b=loOGq4JIVmCdNrCjtVP9pl0QszeBdMRErKoInOaSyJuUeWM3RhhLHqy1ZxL9BVxDX1 VCg5A86GjdWN/CWNtJJlCl8oTqNGvkCdDyl6UKkXv2ymYvz3GqlcdIijR3MmpSxL7lf8 wGzvxvDusOU8CNpxGwPsZYYzWRwEj5BaqRnYdE66pElEwJn/7DXrpQk26/0kWRZfId5z HGI8ZeEhqqViXohXF0hN0GnbqQatDWMQsQ28+NW+5JQBnFe/COTNrcmlJHOBPAYkKs9e Gq/4ZEyoQcx7FJ+YPNxuG0NBsBWw5xrFQmepe0Y6uZqpeQF5cChHwA4j5y998BJqAxu6 8IJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FCvja2RR; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ck4si3325238plb.235.2019.08.29.17.51.36; Thu, 29 Aug 2019 17:51:36 -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=@linaro.org header.s=google header.b=FCvja2RR; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727726AbfH3Auu (ORCPT + 28 others); Thu, 29 Aug 2019 20:50:50 -0400 Received: from mail-lj1-f196.google.com ([209.85.208.196]:33080 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727487AbfH3Auq (ORCPT ); Thu, 29 Aug 2019 20:50:46 -0400 Received: by mail-lj1-f196.google.com with SMTP id z17so4856682ljz.0 for ; Thu, 29 Aug 2019 17:50:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=LKaVdiULHZHeM3qmwqXGbS3W/6JSevNYH66TL2VqMJs=; b=FCvja2RR0Kl7bYsDQOOUQUjMRFvKXGR7eNe2NgdFDmbxw/n8dJHTjUoGSI+mau6Y+4 Nur0MR6ogMXxJ5zfyi7m9Wy9jxTs0li83IAoNnO3od01GnS9Hqlng6pvxCjHf6xEnMyr augAVWdm8PjLCzmGgLHygy3NIRgFB7JySVZRBQN0s3ZKjzbUAEdFIJqIzM5lHjreRvGG snI7tdFTUKcqaa8IwauSlZkbGJE8QEkzS8ZNg5oOiKBIMrKDtwadtIdeZ6JwNYKeJIn3 tKv1ox5CdWMtkIaJu0sJl+tRU4qXmxLrhXLswctpqbwRgon6CnOE9jLR+4q5IXCY6JhA KYLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=LKaVdiULHZHeM3qmwqXGbS3W/6JSevNYH66TL2VqMJs=; b=CeW4oKIS7cH2A31Q63MZBsi4uv7Hpd2MUe5+BfpDQ8RUH++PQydPTMfyrhp4FgJol4 VMDXvK/qZfvZqH9roUhleJJzHrCPWD4tTW3NMxx5xKWKhIExHgyQkV1gChTMJcpytrNj qKt9QZjs++nn8GOcTyP0BbxEEUu0KbRQgEEvVHgXt8ZTpNyraXhUGXNBzOIsBzmIQuHy gdivpzjCtNZXtvtv+a7IkBhNViGBIFgJFwpt1ycwvgFzrTFRFUaCaN5jzW0lIJUdLBsY Fl2nJeKrm42nkkB82GW1QwJcDtH32umg0ADt49khVVb8/uayyhR4h37AvsBJhvQoQ1tI NaLQ== X-Gm-Message-State: APjAAAUaFHADK7JrpzeL9yDixcmG8oS1UYgpbgqXJ1M6rRWVBou0jGBS 6HgRD/UsszTDHgZ16ZKn9xddoQ== X-Received: by 2002:a2e:970e:: with SMTP id r14mr6839936lji.204.1567126244471; Thu, 29 Aug 2019 17:50:44 -0700 (PDT) Received: from localhost.localdomain (168-200-94-178.pool.ukrtel.net. [178.94.200.168]) by smtp.gmail.com with ESMTPSA id f19sm628149lfk.43.2019.08.29.17.50.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Aug 2019 17:50:43 -0700 (PDT) From: Ivan Khoronzhuk To: linux@armlinux.org.uk, ast@kernel.org, daniel@iogearbox.net, yhs@fb.com, davem@davemloft.net, jakub.kicinski@netronome.com, hawk@kernel.org, john.fastabend@gmail.com Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org, clang-built-linux@googlegroups.com, Ivan Khoronzhuk Subject: [PATCH RFC bpf-next 02/10] samples: bpf: Makefile: remove target for native build Date: Fri, 30 Aug 2019 03:50:29 +0300 Message-Id: <20190830005037.24004-3-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190830005037.24004-1-ivan.khoronzhuk@linaro.org> References: <20190830005037.24004-1-ivan.khoronzhuk@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org No need to set --target for native build, at least for arm, the default target will be used anyway. In case of arm, for at least clang 5 - 10 it causes error like: clang: warning: unknown platform, assuming -mfloat-abi=soft LLVM ERROR: Unsupported calling convention make[2]: *** [/home/root/snapshot/samples/bpf/Makefile:299: /home/root/snapshot/samples/bpf/sockex1_kern.o] Error 1 To make the platform to be known, only set to real triple helps: --target=arm-linux-gnueabihf or just drop the target key to use default one. Decision to just drop it and thus default target will be used, looks better. Signed-off-by: Ivan Khoronzhuk --- samples/bpf/Makefile | 2 -- 1 file changed, 2 deletions(-) -- 2.17.1 diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile index 61b7394b811e..a2953357927e 100644 --- a/samples/bpf/Makefile +++ b/samples/bpf/Makefile @@ -197,8 +197,6 @@ BTF_PAHOLE ?= pahole ifdef CROSS_COMPILE HOSTCC = $(CROSS_COMPILE)gcc CLANG_ARCH_ARGS = --target=$(notdir $(CROSS_COMPILE:%-=%)) -else -CLANG_ARCH_ARGS = -target $(ARCH) endif # Don't evaluate probes and warnings if we need to run make recursively From patchwork Fri Aug 30 00:50:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 172658 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp3000337ily; Thu, 29 Aug 2019 17:50:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqyxI7QEwY9kuIpuPXIZIx+5G/YWjeQqFiemD2BSLcUs+qQ+xP9csI25STJCA8YNfEymKwGj X-Received: by 2002:a63:30c6:: with SMTP id w189mr10396996pgw.398.1567126254848; Thu, 29 Aug 2019 17:50:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567126254; cv=none; d=google.com; s=arc-20160816; b=cmfKM8YF8khL2Ir7Eq4e99WBFCbYNRROJ5ZYFcZ6mgJcgHufhy+M0Y0Ox3NUDrXyqC iNVl3k0hNtMBr5LSkmJ0SFiDNitbsKHYRJQNmrO3TK4Q8fs6x2HzDdYN9XRIvYiSKPwq 1bK2/LkMZDDzCaoXYZjEckTBo4FIG16tG6tloJYNWenJkrc1IwnqeIEwztFV3Ai+Btqm Jj+ITWcrlb5lPa9zxji0W99eOEyraCXLV7fH9aq3PN47I81NzHFGtpy0jVaBbb0VmTKk c7wyZqG7AH3RGp0euq7Pqmy/ndkjd9xXHVHW1jfujc08NRjILABAeyz5XfRSAVDpkrH6 gUmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=Q+vZM4cZektdF572TqWkVl3QkOoJAXjpmJXjWwwbKzE=; b=r5mrtG+qhtc5PNjnC+UaBuBozMuP/PL2olDmHSOuz89AcQFiGqq0vaTpzo7mD/S8Iu Fbd36PHDvrFuThq+tmFsfU4Dtb6mi2QzFczoJMJv6YdL47kcRsc863RJxo7g+fBSae2Y SwMbEkMWQom8/LJPpOnicjxN2/rUzSa6kDOWgsarHyYCZuFlm6dSBzeZBOLi9NeObgAB QTrU/1m7oAkEg3Mu8SqPNwUgUwtGz9JmiwAxfifpkDZtQAObv37uPqKyAHVGjO64vJH0 JHlGLHmPYrfigvoVD0RcsEzKzbYFFUTcUnI26MzR2ZzAEvDUQZyuLV0Sc6QdCm5hGZcS HxWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LEYfqXzZ; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t9si3330408pgv.225.2019.08.29.17.50.54; Thu, 29 Aug 2019 17:50:54 -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=@linaro.org header.s=google header.b=LEYfqXzZ; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727859AbfH3Aux (ORCPT + 28 others); Thu, 29 Aug 2019 20:50:53 -0400 Received: from mail-lf1-f68.google.com ([209.85.167.68]:37007 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727600AbfH3Aut (ORCPT ); Thu, 29 Aug 2019 20:50:49 -0400 Received: by mail-lf1-f68.google.com with SMTP id w67so3981330lff.4 for ; Thu, 29 Aug 2019 17:50:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Q+vZM4cZektdF572TqWkVl3QkOoJAXjpmJXjWwwbKzE=; b=LEYfqXzZUPeIuy93SH8GAssQsvlBou/hIWteBhvmXq1F9JVWj2wTkzeZdfRJclvOXa Ml9kVrTIeDyM2A/3eaEvzVK9/pGt5qEqzLTWvJqdBmLcHkvvh07Ut09wAvSKXrIMNobx r2RNchETr9Z4KWTcRDbMNJ6rLBGv3sDWxx1Z8Z5O54FYC/zPoXMdoQJR1eWto+H3GBER DlMphrpkhbPZGMzNxrWnt0/mC94HVFKOY0k+/6wVxcaRK9ftaqDrp/Dypqjz3DpeV74s 5LHndEkamECTgyLl93XSkTDSnp9E79AvMzRJuicO+St87f2BsjM+kyYugZH0KcXkbFhW G9ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Q+vZM4cZektdF572TqWkVl3QkOoJAXjpmJXjWwwbKzE=; b=inT0L6vcY7IasPlXxu3RoFvYD+axgCnflXGjcKJyVSNMqzH2wNpOHSS6TaAzRSUjOV bj83n4Plv6nUOn2G1AnmDaLsQAdt+faugVPBFDFkgv3CmbDucYqmA2q2/fixBzJDTT9d /9ArLRFlfAzpacl6HvwbawoHGYIY+KeAltMc51mT/7WVKWJLRd+gjGcqe2XUF4B/uboI AdlTSeysWjdVVqtu2IEuGq6BAfNzTuS1XRzqwM/fbHoPat4RdPSgMDrZKKEMVTrwQuJS sQ3s6plygFWoVGJI5FAwmFkiK6x3+yXWCgvIJlK56N7yXlM/sDPJ7krSaNzomhDVoCfs VXZA== X-Gm-Message-State: APjAAAUctDAmMIlrgk/w7Rvdkhc4fgCPo37ZWT/4O9ULvqYnQjoCDarX 0zhtfirZIGMGppkot3RCmJh0JYEiuQY= X-Received: by 2002:a19:ae0b:: with SMTP id f11mr2637945lfc.28.1567126246924; Thu, 29 Aug 2019 17:50:46 -0700 (PDT) Received: from localhost.localdomain (168-200-94-178.pool.ukrtel.net. [178.94.200.168]) by smtp.gmail.com with ESMTPSA id f19sm628149lfk.43.2019.08.29.17.50.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Aug 2019 17:50:46 -0700 (PDT) From: Ivan Khoronzhuk To: linux@armlinux.org.uk, ast@kernel.org, daniel@iogearbox.net, yhs@fb.com, davem@davemloft.net, jakub.kicinski@netronome.com, hawk@kernel.org, john.fastabend@gmail.com Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org, clang-built-linux@googlegroups.com, Ivan Khoronzhuk Subject: [PATCH RFC bpf-next 04/10] samples: bpf: use own EXTRA_CFLAGS for clang commands Date: Fri, 30 Aug 2019 03:50:31 +0300 Message-Id: <20190830005037.24004-5-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190830005037.24004-1-ivan.khoronzhuk@linaro.org> References: <20190830005037.24004-1-ivan.khoronzhuk@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It can overlap with CFLAGS used for libraries built with gcc if not now then in following patches. Correct it here for simplicity. Signed-off-by: Ivan Khoronzhuk --- samples/bpf/Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) -- 2.17.1 diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile index a2953357927e..cdd742c05200 100644 --- a/samples/bpf/Makefile +++ b/samples/bpf/Makefile @@ -219,10 +219,10 @@ BTF_LLVM_PROBE := $(shell echo "int main() { return 0; }" | \ /bin/rm -f ./llvm_btf_verify.o) ifneq ($(BTF_LLVM_PROBE),) - EXTRA_CFLAGS += -g + CLANG_EXTRA_CFLAGS += -g else ifneq ($(and $(BTF_LLC_PROBE),$(BTF_PAHOLE_PROBE),$(BTF_OBJCOPY_PROBE)),) - EXTRA_CFLAGS += -g + CLANG_EXTRA_CFLAGS += -g LLC_FLAGS += -mattr=dwarfris DWARF2BTF = y endif @@ -281,8 +281,8 @@ $(obj)/hbm_edt_kern.o: $(src)/hbm.h $(src)/hbm_kern.h # useless for BPF samples. $(obj)/%.o: $(src)/%.c @echo " CLANG-bpf " $@ - $(Q)$(CLANG) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) $(EXTRA_CFLAGS) -I$(obj) \ - -I$(srctree)/tools/testing/selftests/bpf/ \ + $(Q)$(CLANG) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) $(CLANG_EXTRA_CFLAGS) \ + -I$(obj) -I$(srctree)/tools/testing/selftests/bpf/ \ -D__KERNEL__ -D__BPF_TRACING__ -Wno-unused-value -Wno-pointer-sign \ -D__TARGET_ARCH_$(SRCARCH) -Wno-compare-distinct-pointer-types \ -Wno-gnu-variable-sized-type-not-at-end \ From patchwork Fri Aug 30 00:50:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 172659 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp3000386ily; Thu, 29 Aug 2019 17:50:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqyzvPql+uDqreBRfSqEq6x78y47ry2hB1Atdb7PPwGsFtvRnwt4yokeua9LOaSyV+Dxj+ct X-Received: by 2002:a17:90a:19c4:: with SMTP id 4mr13073209pjj.20.1567126258549; Thu, 29 Aug 2019 17:50:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567126258; cv=none; d=google.com; s=arc-20160816; b=iEJqNVnOKvo6qah6oPTDpVzpZ1wBqHPVQ+As+DafZERUrNAx2GBOV8OlF6KFkXXSCk 7n8XuwDm+++cpi4zvoMrWj8hP5P+ijny3ZR0tGPo/H4+HkjYqJcCesX6LseEmk0THBXG B0R3yMwdPYKO7DTWfOb/M4Vun1pOwpq24H2va4bDV+Ibk+Py3rNNyH3n0lS+n7PSRdDh qweNXBc0KqyMsWfCta7o+XJHjHxb0gfuDeW3xYfYkj38e8o3xdpJLfdp7xR0+amXh0Z7 GRN5iaWg17E0fqzcOTorDF9vsQIqkCkmCygiMfbWT7slDKmK6S6Sey9D4kpdFWHBr0vC 3ZQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=Ia9Iohgefzn/RbnoIHs2aN928PonhCPU+GJ0mIg1xw0=; b=Q4F1IDMx7SSXcSZOxpG2HAufT59qfIk8bCdRyHeglnqEDsYdDG1LzwZ7yw8BfZqE6n QtAYzqTSV1nUrdbnfvWmTkN/UBFse47K1XAdunB5h4ffTz2VoQL3wRS8ZnWn8e2ikTnN 637DnBAv/tlGfTIUgZSZ6l1G2YEyMQCiyByfwGr5Eqpf7RUxEVhSz2Qcv8sV24lH2ANU wn/+9ZZ9t7D2RoWPz3fLEOC9hZNmzX9crIYzWOp95BBnXGnOP8V657/GF+/QX81rUeva eb0OfRQOaCW93wwPoIfXjjSYoh110wmkNIkF82QXsPiS5Ao0MjrfkG05TLbo7KJFlSiZ W9iA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nauxkLeh; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f1si3150116pgn.149.2019.08.29.17.50.58; Thu, 29 Aug 2019 17:50:58 -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=@linaro.org header.s=google header.b=nauxkLeh; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727213AbfH3Au4 (ORCPT + 28 others); Thu, 29 Aug 2019 20:50:56 -0400 Received: from mail-lf1-f67.google.com ([209.85.167.67]:40340 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727756AbfH3Aux (ORCPT ); Thu, 29 Aug 2019 20:50:53 -0400 Received: by mail-lf1-f67.google.com with SMTP id u29so3963106lfk.7 for ; Thu, 29 Aug 2019 17:50:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Ia9Iohgefzn/RbnoIHs2aN928PonhCPU+GJ0mIg1xw0=; b=nauxkLeh1ZIxd8fP3xfh92I409w8DtNf/fnJmlw8/s9VqlgjubltPx0An1YWZH63Gp /TU66tFs3h09+jwh0GQFAkphSKeFfuTA4fyRKiDv+BGn8HEGJ0GQ8uWN5KtYMp4+0+Wt yeefhppCuIPIX3qDij/rrFlPldmQRE59HGCtjQQbAIwZDsunfz9iBC10S7GurulzO27V lVzBOobQwYJfYUmGpSLW5FCPoxlnTesIic63c8f9+TL2Fa3O+RTzLMrhS7+qwAGYHToD NhKirRP5II5myOl4O26T3M66TxYAY2Bdx9hqZThpHbkaBfucoIK/qhsrs16aksO8dxvB f0pQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Ia9Iohgefzn/RbnoIHs2aN928PonhCPU+GJ0mIg1xw0=; b=eJoglP73tI3erOG38/sNjx+/0AMXnksNG9WsyXI2D6F9iDcbfu+T/ZNylYEyd7eFSR ZtZ4PFQVMoH8MjqBBPV8hwlJLSxrJuLOyE22ATsRTdPW6NrJGq3PZISf7LOBZ48PY4XM 0fN5DHxD7TzsDJP4vEQYykKlkoo5lLNQgalsDM+gxfMGwDq0dzuAX/HFY14UDT5/jcb/ 13sa0G7cv0IEAAeCvfezf3xcoC58ClItoZmeZM+nAamUCsLWMuyBFdiNHjI9DOEE58vu iAvmH2KyksqtW8evJw3s1oMlzXTFy5LSSgt+RFNsgxDTCd7h3Q8pMDOoUgLa49FyC9xj 2FEA== X-Gm-Message-State: APjAAAVB6IiE9n2LsOy/ehTGZxCAgByz5/LBy7Cx/X+IAr6rodwx6sRS qXwb+U7G569Y5oag4TxDuBHCVg== X-Received: by 2002:ac2:5608:: with SMTP id v8mr7690120lfd.95.1567126250684; Thu, 29 Aug 2019 17:50:50 -0700 (PDT) Received: from localhost.localdomain (168-200-94-178.pool.ukrtel.net. [178.94.200.168]) by smtp.gmail.com with ESMTPSA id f19sm628149lfk.43.2019.08.29.17.50.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Aug 2019 17:50:50 -0700 (PDT) From: Ivan Khoronzhuk To: linux@armlinux.org.uk, ast@kernel.org, daniel@iogearbox.net, yhs@fb.com, davem@davemloft.net, jakub.kicinski@netronome.com, hawk@kernel.org, john.fastabend@gmail.com Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org, clang-built-linux@googlegroups.com, Ivan Khoronzhuk Subject: [PATCH RFC bpf-next 07/10] samples: bpf: add makefile.prog for separate CC build Date: Fri, 30 Aug 2019 03:50:34 +0300 Message-Id: <20190830005037.24004-8-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190830005037.24004-1-ivan.khoronzhuk@linaro.org> References: <20190830005037.24004-1-ivan.khoronzhuk@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The HOSTCC is supposed to build binaries and tools running on the host afterwards, in order to simplify build or so, like "fixdep" or else. In case of cross compiling "fixdep" is executed on host when the rest samples should run on target arch. In order to build binaries for target arch with CC and tools running on host with HOSTCC, lets add Makefile.prog for simplicity, having definition and routines similar to ones, used in script/Makefile.host. That allows later add cross-compilation to samples/bpf with minimum changes. Makefile.prog contains only stuff needed for samples/bpf, potentially can be reused and sophisticated for other prog sets later and now needed only for unblocking tricky samples/bpf cross compilation. Signed-off-by: Ivan Khoronzhuk --- samples/bpf/Makefile.prog | 77 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 samples/bpf/Makefile.prog -- 2.17.1 diff --git a/samples/bpf/Makefile.prog b/samples/bpf/Makefile.prog new file mode 100644 index 000000000000..d5d02fbb5e6e --- /dev/null +++ b/samples/bpf/Makefile.prog @@ -0,0 +1,77 @@ +# SPDX-License-Identifier: GPL-2.0 +# ========================================================================== +# Building binaries on the host system +# Binaries are not used during the compilation of the kernel, and intendent to +# be build for target board, target board can be host ofc. Added to build +# binaries to run not on host system. +# +# Both C and C++ are supported, but preferred language is C for such utilities. +# +# Sample syntax (see Documentation/kbuild/makefiles.rst for reference) +# progs-y := xdpsock_example +# Will compile xdpsock_example.c and create an executable named xdpsock_example +# +# progs-y := xdpsock +# xdpsock-objs := xdpsock_user.o xdpsock_user2.o +# Will compile xdpsock.c and xdpsock.c, and then link the executable +# xdpsock, based on xdpsock_user.o and xdpsock_user2.o +# +# Inherited from scripts/Makefile.host +# +__progs := $(sort $(progs-y)) + +# C code +# Executables compiled from a single .c file +prog-csingle := $(foreach m,$(__progs), \ + $(if $($(m)-objs)$($(m)-cxxobjs),,$(m))) + +# C executables linked based on several .o files +prog-cmulti := $(foreach m,$(__progs),\ + $(if $($(m)-cxxobjs),,$(if $($(m)-objs),$(m)))) + +# Object (.o) files compiled from .c files +prog-cobjs := $(sort $(foreach m,$(__progs),$($(m)-objs))) + +prog-csingle := $(addprefix $(obj)/,$(prog-csingle)) +prog-cmulti := $(addprefix $(obj)/,$(prog-cmulti)) +prog-cobjs := $(addprefix $(obj)/,$(prog-cobjs)) + +##### +# Handle options to gcc. Support building with separate output directory + +_progc_flags = $(PROGS_CFLAGS) \ + $(PROGCFLAGS_$(basetarget).o) + +# $(objtree)/$(obj) for including generated headers from checkin source files +ifeq ($(KBUILD_EXTMOD),) +ifdef building_out_of_srctree +_progc_flags += -I $(objtree)/$(obj) +endif +endif + +progc_flags = -Wp,-MD,$(depfile) $(_progc_flags) + +# Create executable from a single .c file +# prog-csingle -> Executable +quiet_cmd_prog-csingle = CC $@ + cmd_prog-csingle = $(CC) $(progc_flags) $(PROGS_LDFLAGS) -o $@ $< \ + $(PROGS_LDLIBS) $(PROGLDLIBS_$(@F)) +$(prog-csingle): $(obj)/%: $(src)/%.c FORCE + $(call if_changed_dep,prog-csingle) + +# Link an executable based on list of .o files, all plain c +# prog-cmulti -> executable +quiet_cmd_prog-cmulti = LD $@ + cmd_prog-cmulti = $(CC) $(progc_flags) $(PROGS_LDFLAGS) -o $@ \ + $(addprefix $(obj)/,$($(@F)-objs)) \ + $(PROGS_LDLIBS) $(PROGLDLIBS_$(@F)) +$(prog-cmulti): $(prog-cobjs) FORCE + $(call if_changed,prog-cmulti) +$(call multi_depend, $(prog-cmulti), , -objs) + +# Create .o file from a single .c file +# prog-cobjs -> .o +quiet_cmd_prog-cobjs = CC $@ + cmd_prog-cobjs = $(CC) $(progc_flags) -c -o $@ $< +$(prog-cobjs): $(obj)/%.o: $(src)/%.c FORCE + $(call if_changed_dep,prog-cobjs) From patchwork Fri Aug 30 00:50:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 172660 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp3000414ily; Thu, 29 Aug 2019 17:51:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqwcnhd4ws+pZxt3/WX26woH0xiSXfON9/snGLot29GHz2oYGD5AuupHwwIeO5zyuMnXlhBl X-Received: by 2002:aa7:84d7:: with SMTP id x23mr15019223pfn.53.1567126260653; Thu, 29 Aug 2019 17:51:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567126260; cv=none; d=google.com; s=arc-20160816; b=NSdzcaFNOMwANpFp8w0mnq1F5xFSV90zHE7FMOsQiHqGpQ/ovmk3OY9iRPYwJ5C7yT BknUBYnvjhQx/EZoDWCuQjfurK39po9/5SxV5JhXErMP2hTiyQNXcTSuOZiGB0hYBFqi 5mcFPkp6yczOa6vFWCnHs1NuBho/kcJ4+thcAKKyM2mlufEsxIB8P4C0x+nwNJkPtSac HIRWmGdo5qanxD4NE/RRta0F1YZ5ChuN7FsKwO35blHHlRfqrhsojU8RScGqQfcSnBIh D13G6bzc6qkZzwJwxnY05Gn1hepGceCQapE4ZQ4FPMi5yxPceQ3im2mwK5H8XpBmoo0T NRNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=eRu74lcVO6wVz56irfReRFgKKrKVWSF8s29xnt/RZAY=; b=blPE5tZuABG6nDXK8+jJS+NOF53W28xQ1l2T4qmC3yQpirhSfKHtiUbyd8iIEvY4d1 KAMtZhvZHG5QfuhKUVRZr0QldoXsceg+35uBygOQs+pTHGlntuN27ZsDZBh1lKKHAj/X rq/NROOEZaYIuQJAp76/uuIs0WjDISrOtl9l+kbmdderJNfBmwaGJ8y/CToYcOQnSzFF SZyNXqSgnyYH6uWOcQx8t+TsnCrlOUU00HOC8cvuqXD5S+nfvaM6irF5LJEigwZbTqjM 2JGVKWGY91IDCzLOxNcNw1i4wm0mxEzYmoNwEmHAxqHWKCMFoDBpXkbnu83jB+Cr5ySZ TAiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aGgIzR5s; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f1si3150116pgn.149.2019.08.29.17.51.00; Thu, 29 Aug 2019 17:51:00 -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=@linaro.org header.s=google header.b=aGgIzR5s; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727947AbfH3Au7 (ORCPT + 28 others); Thu, 29 Aug 2019 20:50:59 -0400 Received: from mail-lj1-f194.google.com ([209.85.208.194]:45477 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727826AbfH3Auy (ORCPT ); Thu, 29 Aug 2019 20:50:54 -0400 Received: by mail-lj1-f194.google.com with SMTP id l1so4767933lji.12 for ; Thu, 29 Aug 2019 17:50:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=eRu74lcVO6wVz56irfReRFgKKrKVWSF8s29xnt/RZAY=; b=aGgIzR5sxMevxwKrFIyIUyDYL1+Nx/1OC8zAJhAo/8dNBndVj2YmCvfj4i/zxgGBQ5 9edGcAC+kLpfo+7btqyQXLrPsDRjsU5GiMXrZ3F1bTwelUYM704o4c4HOhlb9i4g2T2G 46UcPIwAy05XmYLGl6WZEm82+FLAfxfQddpq5RM57C+zoFIgNj/WnvAj9M3P90P8JtVK fUQhcgTmih1w2KzIBZh2ceq9oweGUIxFdv9byIZH8yosJuMVvajEvIs+cuV9WSxGmoKX yK2E/F55R48zySZ4XYDK0bxU0szO5ISOj0W65i2/9aLaZho9b6vP+D9pYH9vnnHPIIXd /sVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=eRu74lcVO6wVz56irfReRFgKKrKVWSF8s29xnt/RZAY=; b=NUs5Lm3aIhDPGtZfbNYtewaHQDJ3l+A3TkKBhfo4pqtvFUgEzqBplTtKjKvU655egB bGVQ6c88+ZXz+vcyeV8AVgRB8Z3LDFEYEX6jo7Yqq0qzghUn5pDzrcfpxGdMRifh2wOA UacPv7nMhk76WH6ocNedruEK1X4RtO7QEX/nCWJbn93QKqbhfV35I5ga0sSuZaxQI7kI 8yBDaO/LjAXN13ZC04Pm/Sey9bhJ71UllqYgokZDw/Sb77Go8l3sMC8tvGj6v16+FK4M 1OuIC54+FFWQ/Ob5xu6eW/Ozn4v3Mqfr3gHlVfhMMRohrNpnyNFh+EJ8STGbKxDdSE3H lF+A== X-Gm-Message-State: APjAAAXZ2pzU7y/6KlJNmmbew0AG42JXOHuBcw/HJNcpP+WKcrUoiZS3 +Rd20AgCO8VGjPRJXx4li1Ct7g== X-Received: by 2002:a2e:9f02:: with SMTP id u2mr7121058ljk.4.1567126251915; Thu, 29 Aug 2019 17:50:51 -0700 (PDT) Received: from localhost.localdomain (168-200-94-178.pool.ukrtel.net. [178.94.200.168]) by smtp.gmail.com with ESMTPSA id f19sm628149lfk.43.2019.08.29.17.50.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Aug 2019 17:50:51 -0700 (PDT) From: Ivan Khoronzhuk To: linux@armlinux.org.uk, ast@kernel.org, daniel@iogearbox.net, yhs@fb.com, davem@davemloft.net, jakub.kicinski@netronome.com, hawk@kernel.org, john.fastabend@gmail.com Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org, clang-built-linux@googlegroups.com, Ivan Khoronzhuk Subject: [PATCH RFC bpf-next 08/10] samples: bpf: Makefile: base progs build on Makefile.progs Date: Fri, 30 Aug 2019 03:50:35 +0300 Message-Id: <20190830005037.24004-9-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190830005037.24004-1-ivan.khoronzhuk@linaro.org> References: <20190830005037.24004-1-ivan.khoronzhuk@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The main reason for that - HOSTCC and CC have different aims. It was tested for arm cross compilation, based on linaro toolchain, but should work for others. In order to split cross compilation with host build, base bpf samples on Makefile.progs. I've verified it on arm with adding SYSROOT. It's also convenient when debug is with NFC. To cross-compile I've used: export ARCH=arm export CROSS_COMPILE=arm-linux-gnueabihf- make -j4 samples/bpf/ SYSROOT="path/to/sysroot" Sysroot contains correct headers installed ofc. Signed-off-by: Ivan Khoronzhuk --- samples/bpf/Makefile | 164 ++++++++++++++++++++++++----------------- samples/bpf/README.rst | 7 ++ 2 files changed, 102 insertions(+), 69 deletions(-) -- 2.17.1 diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile index 043f9cc14cdd..ed7131851172 100644 --- a/samples/bpf/Makefile +++ b/samples/bpf/Makefile @@ -4,55 +4,53 @@ BPF_SAMPLES_PATH ?= $(abspath $(srctree)/$(src)) TOOLS_PATH := $(BPF_SAMPLES_PATH)/../../tools # List of programs to build -hostprogs-y := test_lru_dist -hostprogs-y += sock_example -hostprogs-y += fds_example -hostprogs-y += sockex1 -hostprogs-y += sockex2 -hostprogs-y += sockex3 -hostprogs-y += tracex1 -hostprogs-y += tracex2 -hostprogs-y += tracex3 -hostprogs-y += tracex4 -hostprogs-y += tracex5 -hostprogs-y += tracex6 -hostprogs-y += tracex7 -hostprogs-y += test_probe_write_user -hostprogs-y += trace_output -hostprogs-y += lathist -hostprogs-y += offwaketime -hostprogs-y += spintest -hostprogs-y += map_perf_test -hostprogs-y += test_overhead -hostprogs-y += test_cgrp2_array_pin -hostprogs-y += test_cgrp2_attach -hostprogs-y += test_cgrp2_sock -hostprogs-y += test_cgrp2_sock2 -hostprogs-y += xdp1 -hostprogs-y += xdp2 -hostprogs-y += xdp_router_ipv4 -hostprogs-y += test_current_task_under_cgroup -hostprogs-y += trace_event -hostprogs-y += sampleip -hostprogs-y += tc_l2_redirect -hostprogs-y += lwt_len_hist -hostprogs-y += xdp_tx_iptunnel -hostprogs-y += test_map_in_map -hostprogs-y += per_socket_stats_example -hostprogs-y += xdp_redirect -hostprogs-y += xdp_redirect_map -hostprogs-y += xdp_redirect_cpu -hostprogs-y += xdp_monitor -hostprogs-y += xdp_rxq_info -hostprogs-y += syscall_tp -hostprogs-y += cpustat -hostprogs-y += xdp_adjust_tail -hostprogs-y += xdpsock -hostprogs-y += xdp_fwd -hostprogs-y += task_fd_query -hostprogs-y += xdp_sample_pkts -hostprogs-y += ibumad -hostprogs-y += hbm +progs-y := test_lru_dist +progs-y += sock_example +progs-y += fds_example +progs-y += sockex1 +progs-y += sockex2 +progs-y += sockex3 +progs-y += tracex1 +progs-y += tracex2 +progs-y += tracex3 +progs-y += tracex4 +progs-y += tracex5 +progs-y += tracex6 +progs-y += tracex7 +progs-y += test_probe_write_user +progs-y += trace_output +progs-y += lathist +progs-y += offwaketime +progs-y += spintest +progs-y += map_perf_test +progs-y += test_overhead +progs-y += test_cgrp2_array_pin +progs-y += test_cgrp2_attach +progs-y += test_cgrp2_sock +progs-y += test_cgrp2_sock2 +progs-y += xdp1 +progs-y += xdp2 +progs-y += xdp_router_ipv4 +progs-y += test_current_task_under_cgroup +progs-y += trace_event +progs-y += sampleip +progs-y += tc_l2_redirect +progs-y += lwt_len_hist +progs-y += xdp_tx_iptunnel +progs-y += test_map_in_map +progs-y += xdp_redirect_map +progs-y += xdp_redirect_cpu +progs-y += xdp_monitor +progs-y += xdp_rxq_info +progs-y += syscall_tp +progs-y += cpustat +progs-y += xdp_adjust_tail +progs-y += xdpsock +progs-y += xdp_fwd +progs-y += task_fd_query +progs-y += xdp_sample_pkts +progs-y += ibumad +progs-y += hbm # Libbpf dependencies LIBBPF = $(TOOLS_PATH)/lib/bpf/libbpf.a @@ -111,7 +109,7 @@ ibumad-objs := bpf_load.o ibumad_user.o $(TRACE_HELPERS) hbm-objs := bpf_load.o hbm.o $(CGROUP_HELPERS) # Tell kbuild to always build the programs -always := $(hostprogs-y) +always := $(progs-y) always += sockex1_kern.o always += sockex2_kern.o always += sockex3_kern.o @@ -171,26 +169,51 @@ always += ibumad_kern.o always += hbm_out_kern.o always += hbm_edt_kern.o -KBUILD_HOSTCFLAGS += -I$(objtree)/usr/include -KBUILD_HOSTCFLAGS += -I$(srctree)/tools/lib/bpf/ -KBUILD_HOSTCFLAGS += -I$(srctree)/tools/testing/selftests/bpf/ -KBUILD_HOSTCFLAGS += -I$(srctree)/tools/lib/ -I$(srctree)/tools/include -KBUILD_HOSTCFLAGS += -I$(srctree)/tools/perf - -HOSTCFLAGS_bpf_load.o += -I$(objtree)/usr/include -Wno-unused-variable - -KBUILD_HOSTLDLIBS += $(LIBBPF) -lelf -HOSTLDLIBS_tracex4 += -lrt -HOSTLDLIBS_trace_output += -lrt -HOSTLDLIBS_map_perf_test += -lrt -HOSTLDLIBS_test_overhead += -lrt -HOSTLDLIBS_xdpsock += -pthread - # Strip all expet -D options needed to handle linux headers # for arm it's __LINUX_ARM_ARCH__ and potentially others fork vars D_OPTIONS = $(shell echo "$(KBUILD_CFLAGS) " | sed 's/[[:blank:]]/\n/g' | \ sed '/^-D/!d' | tr '\n' ' ') +ifdef SYSROOT +ccflags-y += --sysroot=${SYSROOT} +ccflags-y += -I${SYSROOT}/usr/include +CLANG_EXTRA_CFLAGS := $(ccflags-y) +PROGS_LDFLAGS := -L${SYSROOT}/usr/lib +endif + +ccflags-y += -I$(srctree)/tools/lib/bpf/ +ccflags-y += -I$(srctree)/tools/testing/selftests/bpf/ +ccflags-y += -I$(srctree)/tools/lib/ +ccflags-y += -I$(srctree)/tools/perf + +ccflags-y += $(D_OPTIONS) +ccflags-y += -Wall +ccflags-y += -Wmissing-prototypes +ccflags-y += -Wstrict-prototypes +ccflags-y += -fomit-frame-pointer + +PROGS_CFLAGS := $(ccflags-y) + +ccflags-y += -I$(objtree)/usr/include +ccflags-y += -I$(srctree)/tools/include + +PROGCFLAGS_bpf_load.o += -I$(objtree)/usr/include -I$(srctree)/tools/include \ + -Wno-unused-variable +PROGCFLAGS_sampleip_user.o += -I$(srctree)/tools/include +PROGCFLAGS_task_fd_query_user.o += -I$(srctree)/tools/include +PROGCFLAGS_trace_event_user.o += -I$(srctree)/tools/include +PROGCFLAGS_trace_output_user.o += -I$(srctree)/tools/include +PROGCFLAGS_tracex6_user.o += -I$(srctree)/tools/include +PROGCFLAGS_xdp_sample_pkts_user.o += -I$(srctree)/tools/include +PROGCFLAGS_xdpsock_user.o += -I$(srctree)/tools/include + +PROGS_LDLIBS := $(LIBBPF) -lelf +PROGLDLIBS_tracex4 += -lrt +PROGLDLIBS_trace_output += -lrt +PROGLDLIBS_map_perf_test += -lrt +PROGLDLIBS_test_overhead += -lrt +PROGLDLIBS_xdpsock += -pthread + CLANG_EXTRA_CFLAGS += $(D_OPTIONS) # Allows pointing LLC/CLANG to a LLVM backend with bpf support, redefine on cmdline: @@ -202,15 +225,14 @@ BTF_PAHOLE ?= pahole # Detect that we're cross compiling and use the cross compiler ifdef CROSS_COMPILE -HOSTCC = $(CROSS_COMPILE)gcc CLANG_ARCH_ARGS = --target=$(notdir $(CROSS_COMPILE:%-=%)) endif # Don't evaluate probes and warnings if we need to run make recursively ifneq ($(src),) HDR_PROBE := $(shell printf "\#include \n struct list_head { int a; }; int main() { return 0; }" | \ - $(HOSTCC) $(KBUILD_HOSTCFLAGS) -x c - -o /dev/null 2>/dev/null && \ - echo okay) + $(CC) $(PROGS_CFLAGS) $(PROGS_LDFLAGS) -x c - -o /dev/null \ + 2>/dev/null && echo okay) ifeq ($(HDR_PROBE),) $(warning WARNING: Detected possible issues with include path.) @@ -246,7 +268,9 @@ clean: $(LIBBPF): FORCE # Fix up variables inherited from Kbuild that tools/ build system won't like - $(MAKE) -C $(dir $@) RM='rm -rf' LDFLAGS= srctree=$(BPF_SAMPLES_PATH)/../../ O= + $(MAKE) -C $(dir $@) RM='rm -rf' EXTRA_CFLAGS="$(ccflags-y)" \ + EXTRA_CXXFLAGS="$(ccflags-y)" LDFLAGS=$(PROGS_LDFLAGS) \ + srctree=$(BPF_SAMPLES_PATH)/../../ O= $(obj)/syscall_nrs.h: $(obj)/syscall_nrs.s FORCE $(call filechk,offsets,__SYSCALL_NRS_H__) @@ -283,6 +307,8 @@ $(obj)/hbm_out_kern.o: $(src)/hbm.h $(src)/hbm_kern.h $(obj)/hbm.o: $(src)/hbm.h $(obj)/hbm_edt_kern.o: $(src)/hbm.h $(src)/hbm_kern.h +-include $(BPF_SAMPLES_PATH)/Makefile.prog + # 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. diff --git a/samples/bpf/README.rst b/samples/bpf/README.rst index 5f27e4faca50..6b5e4eace977 100644 --- a/samples/bpf/README.rst +++ b/samples/bpf/README.rst @@ -74,3 +74,10 @@ samples for the cross target. export ARCH=arm64 export CROSS_COMPILE="aarch64-linux-gnu-" make samples/bpf/ LLC=~/git/llvm/build/bin/llc CLANG=~/git/llvm/build/bin/clang + +If need to use environment of target board, the SYSROOT also can be set, +pointing on FS of target board: + +make samples/bpf/ LLC=~/git/llvm/build/bin/llc \ + CLANG=~/git/llvm/build/bin/clang \ + SYSROOT=~/some_sdk/linux-devkit/sysroots/aarch64-linux-gnu From patchwork Fri Aug 30 00:50:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 172662 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp3000543ily; Thu, 29 Aug 2019 17:51:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqx6PN1PCb0i9m7Og7/EYq+2YhbURiP92DOFFccQs6cADmGBKMgGe5rGHEdddn2hLMUeJlX+ X-Received: by 2002:a17:902:3:: with SMTP id 3mr13439104pla.41.1567126270353; Thu, 29 Aug 2019 17:51:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567126270; cv=none; d=google.com; s=arc-20160816; b=c589s0AGM2SwZxldCUXK6muQ7eQEDs7nSY3AGQJ6hkuRb//zIqDmUZ3FxmOEhFmdiw H0Y9NQBEzO5sDTrZrUX3ExJwT6iDfLzTbuQP5loqw79bp0R2OFqQLA3n8nURNFnhYYSY zVQVHOy8wC0igtvMucRfHXOvI2qfIaxXC9dzZIeRIbqnT6vuorZXQzvvoe9kiooNbkTD 4hWZonhFdNIikqLnl44ekIXXn+CHLK9B/b9rrCj+Rk431ffrvKSGVw/6biTYRfpyUzcA hnfYJ5iTG5spXF0jVTWF2woqFUmuYETaGdWUKEg0PwrqQjDlR7OhHgmvoqoJ4jmU5TXl cEUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=rseUd9y/GnXjRY8PsudxS8BEzI5o7BH/gE6GzGNAkz0=; b=pjqaZ1YbuWza1ydC06DLjspt3tHKNKK3awmgJoEAswaAsalbWPRdKB9XOwb94EA9iT WZJqpbdrLXDuHOzS08KAQF0LIlEATjnHiN4haAVmbLvHCgadx8MA0WRTeZ7kCak6AQUZ kyfIYZl18g2zj9gsgAVPhBbCDx6hB0L8O1llJzNYYkyMWf6/dLpmfzu+gQ+nOXqfqhWW npIR03/gGBxpXMmhl95KDhnrcHZDxNmMqrUDoE4SAvkAFazQPL9Csn1YDZMpiAKUhN5G FmI6r54rdIcmViFb96D2ARnZn80svdjjEVP6mq+zAFFXJBZeVMHwmwj5KVhUjJaAl1kO Y99w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=p+c78cGO; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h1si3274823pgd.443.2019.08.29.17.51.09; Thu, 29 Aug 2019 17:51:10 -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=@linaro.org header.s=google header.b=p+c78cGO; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727866AbfH3AvI (ORCPT + 28 others); Thu, 29 Aug 2019 20:51:08 -0400 Received: from mail-lf1-f67.google.com ([209.85.167.67]:38137 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727883AbfH3Auz (ORCPT ); Thu, 29 Aug 2019 20:50:55 -0400 Received: by mail-lf1-f67.google.com with SMTP id c12so3976329lfh.5 for ; Thu, 29 Aug 2019 17:50:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=rseUd9y/GnXjRY8PsudxS8BEzI5o7BH/gE6GzGNAkz0=; b=p+c78cGOyUo6huk/pdHK4LHWxY05E5DmCBl6Y9TnX0wvtYNQzK7/aTvz75AqmlPGvA lX3zJWWhAuFN7kMzRbIe4MIRTgqe2XNObWdcxwvAYdo9v+NHqraV4ztUXFoSctAfudEb 6iWjcDghz5Lkpmgx4rrpBe3K+94vUyybq7SVTJP0KvecAGtDjApjNEeFXlxu6wHYQ2nG Aia65Ra96zxOxrfifKlzHZK+MklKrHz3P1CXW6V1T+wu0gkWFEF3j5zl9WfXVvgh/7Iz tX+fup/gKLffQChanaOEXwwKRLJP/Zl4iC0qpnp9r8NCvX0yAmZFBiQuq5bIQpJinAgf 23aA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=rseUd9y/GnXjRY8PsudxS8BEzI5o7BH/gE6GzGNAkz0=; b=BNoyDJvlAgc74Exz6ywK/h8/6auM3ERw1Lliis7oJG2T05AIo1984XS+hka0PuJk08 sGUZXC91Qr17Guk/wicaxbz8LMIztmCOGTbrwscm5hnvKh4tAPkOjJ5GAqopOWUF8oe2 xf5n+o+9+c8cvEsRI9PeF1A5eHjEAC+mAECGEJi8BSdGHrCgwNWgBPm1dHtW7gy9EQ3j 3TZJtO16bsWCmF0HfniK3gcOx4c1hNnLTHRkB4YVL7dckbik3QJaUHkrDYmJW/Qag25v jtHAz6HXtossTMVxNFitt5foYwP/T3XXTuoTpDl1NXOm+WYvUEpeLWhTPnUrxnCa36EF dwlQ== X-Gm-Message-State: APjAAAWcXZvqhZvCh8PauTMicOrGAWZm3C1KK5lphk2V8ii6Khk9OELQ CNAl3ZygVByqndp08wSmrscxHw== X-Received: by 2002:a19:e04f:: with SMTP id g15mr7384740lfj.46.1567126253185; Thu, 29 Aug 2019 17:50:53 -0700 (PDT) Received: from localhost.localdomain (168-200-94-178.pool.ukrtel.net. [178.94.200.168]) by smtp.gmail.com with ESMTPSA id f19sm628149lfk.43.2019.08.29.17.50.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Aug 2019 17:50:52 -0700 (PDT) From: Ivan Khoronzhuk To: linux@armlinux.org.uk, ast@kernel.org, daniel@iogearbox.net, yhs@fb.com, davem@davemloft.net, jakub.kicinski@netronome.com, hawk@kernel.org, john.fastabend@gmail.com Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org, clang-built-linux@googlegroups.com, Ivan Khoronzhuk Subject: [PATCH RFC bpf-next 09/10] arm: include: asm: swab: mask rev16 instruction for clang Date: Fri, 30 Aug 2019 03:50:36 +0300 Message-Id: <20190830005037.24004-10-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190830005037.24004-1-ivan.khoronzhuk@linaro.org> References: <20190830005037.24004-1-ivan.khoronzhuk@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The samples/bpf with clang -emit-llvm reuses linux headers to build bpf samples, and this w/a only for samples (samples/bpf/Makefile CLANG-bpf). It allows to build samples/bpf for arm bpf using clang. In another way clang -emit-llvm generates errors like: CLANG-bpf samples/bpf/tc_l2_redirect_kern.o :1:2: error: invalid register/token name rev16 r3, r0 This decision is arguable, probably there is another way, but it doesn't have impact on samples/bpf, so it's easier just ignore it for clang, at least for now. Signed-off-by: Ivan Khoronzhuk --- arch/arm/include/asm/swab.h | 3 +++ 1 file changed, 3 insertions(+) -- 2.17.1 diff --git a/arch/arm/include/asm/swab.h b/arch/arm/include/asm/swab.h index c6051823048b..a9fd9cd33d5e 100644 --- a/arch/arm/include/asm/swab.h +++ b/arch/arm/include/asm/swab.h @@ -25,8 +25,11 @@ static inline __attribute_const__ __u32 __arch_swahb32(__u32 x) __asm__ ("rev16 %0, %1" : "=r" (x) : "r" (x)); return x; } + +#ifndef __clang__ #define __arch_swahb32 __arch_swahb32 #define __arch_swab16(x) ((__u16)__arch_swahb32(x)) +#endif static inline __attribute_const__ __u32 __arch_swab32(__u32 x) { From patchwork Fri Aug 30 00:50:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 172661 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp3000443ily; Thu, 29 Aug 2019 17:51:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqxJKagdeON3qyG171/XFEB30P8jDnqpFjHDvj8+KkS+7S6z+aqPvjtHUPbC1yT/bzHS79eR X-Received: by 2002:a17:902:a50a:: with SMTP id s10mr12854092plq.108.1567126262995; Thu, 29 Aug 2019 17:51:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567126262; cv=none; d=google.com; s=arc-20160816; b=0kTvjkYvMDjdb5SlFeQ7nK93m466OJhgYKW470x+81KDreYcTwscrXAKI3NYA0UOSk RZOe7pHRXqMFri/ktVXL6OLxlZ/E+AQ5dWjlFAWJbmRxOOIZcmxqYyr9OxixBAOc1+da BsHbOdCwBlFyZcs8xMYw9T95/YdKuReFW7W4UCveNTFXMnCywBp3zw1DlHNPTsH9RJYa +PNBNpXljrUjmlV7sbzA60qEKZfjzTz3Csa+VbubsOiSZd4dtZbrnAMyqIQ8CHMTum4O cSFkCRZeptTZOEvTeGdheTMmcfNR7Hz+I0QgMiGdSk7fwdX8VVpXHkz8khEircFihNXu Ns9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=mY025N9ZTLshq6bUASscJHYyFWN73WCKPGSueHP30TA=; b=ma+dTFSo93qcZdCY6BjObmTJeR0uFYV6iNkaONStRsLCt98bSn1k6nxFhSIBCXTa4p 8sU5fZYIRJCql0OV02LY/M/H0DcBq/qQHU4nH3bkV16X3nGIs12znzVvM6uA74IiD0jE GA/vMjOowRl8cgnk6DA5kAxO6qFvzhA23nxPi3Du9iSQY5kY8YTH/XBbdn0aTt0x8Zca iU/DQX8KFsTeHKt7KIc6Aw289zpeAQKKCLO9q0Oi9Ng/IdyNV6dCa0AF5H9qQJAvs0T5 X4Fawwjp9el6a9LuEf6m4Ohn3Ec8fdzXN4bQH20E1jzwf8w6sJnwPdZX37MNmUwWsgdc /1RQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Okdsp5Zx; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f1si3150116pgn.149.2019.08.29.17.51.02; Thu, 29 Aug 2019 17:51:02 -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=@linaro.org header.s=google header.b=Okdsp5Zx; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727968AbfH3AvB (ORCPT + 28 others); Thu, 29 Aug 2019 20:51:01 -0400 Received: from mail-lj1-f194.google.com ([209.85.208.194]:34882 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727892AbfH3Au4 (ORCPT ); Thu, 29 Aug 2019 20:50:56 -0400 Received: by mail-lj1-f194.google.com with SMTP id l14so4830761lje.2 for ; Thu, 29 Aug 2019 17:50:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=mY025N9ZTLshq6bUASscJHYyFWN73WCKPGSueHP30TA=; b=Okdsp5ZxNf0c0ZS1PgudZ1/Uzcx1vh+JyUHLIBaB4gA9eHqIu0am2+/xAGRamBrEmK qCvznYgVkMcSDDWdiuCGk34vVj8/mP+ro1bCTjA8Ka3xrOrkCNjL5U6xgrBRNELJmuje tp5PnYpAOK9+P7pd2AMtrpQ2VFUiwZgdf+VjTUiXBMwwiLm0B+wHxS9J4hkKQKTR1PMo g5JzQdW9lrRdG4QItLYA3aqHsMKgs2n4aIc4BsxCiDVNYjJ1gBnQXG5diF7z2I2DKLba 2UWvt484BgUsrYmmG+TmQ/bM0gM9QCmze3gdMrsQwFGwno6fmli/VeP2qEfoN4+I/6o0 LHHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=mY025N9ZTLshq6bUASscJHYyFWN73WCKPGSueHP30TA=; b=anAY+rkZy8HLJdcAay7AIkwcdOUEVml2xpd+zClcoyPtQOucTqD99EayhYz0+ORpd8 cMkiLTiTuac+ITdFIXc24EAKD04CBxbkKZ7nHXtwbPxVC0MdEQ0FKi/vYeW3W2D100TV fGSVLMjhb4Yg0zr/Ch36hO6jJJQRMqPMXJJ/CT2LIHGN5BXQWl6pFY6CAFghTMVwy1Ex VfqXZeLo5FAhGjT15BZiqXHkAKIdI8lS2bYPn/OvBXlCjooP7BZ324kjtJeg5G8JhvLW HRKcR1/TsmS2JZ3oXv+Q8i8ocp4wa5VTkHec4jE0gp9TZ1dAM+Hd3ZLMvfqyVY40O7fJ glKQ== X-Gm-Message-State: APjAAAUHlTGoRAv9bktXo9GrnNCy15XeqAQK+WVHdKYTvxEfVX+hl7Pe Mr7e3ur1yNWZdKdeDEVMOJjUnQ== X-Received: by 2002:a2e:2bda:: with SMTP id r87mr1097319ljr.3.1567126254430; Thu, 29 Aug 2019 17:50:54 -0700 (PDT) Received: from localhost.localdomain (168-200-94-178.pool.ukrtel.net. [178.94.200.168]) by smtp.gmail.com with ESMTPSA id f19sm628149lfk.43.2019.08.29.17.50.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Aug 2019 17:50:53 -0700 (PDT) From: Ivan Khoronzhuk To: linux@armlinux.org.uk, ast@kernel.org, daniel@iogearbox.net, yhs@fb.com, davem@davemloft.net, jakub.kicinski@netronome.com, hawk@kernel.org, john.fastabend@gmail.com Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org, clang-built-linux@googlegroups.com, Ivan Khoronzhuk Subject: [PATCH RFC bpf-next 10/10] arm: include: asm: unified: mask .syntax unified for clang Date: Fri, 30 Aug 2019 03:50:37 +0300 Message-Id: <20190830005037.24004-11-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190830005037.24004-1-ivan.khoronzhuk@linaro.org> References: <20190830005037.24004-1-ivan.khoronzhuk@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The samples/bpf reuses linux headers, with clang -emit-llvm, so this w/a is only for samples/bpf (samples/bpf/Makefile CLANG-bpf). It allows to build samples/bpf for arm on target board. In another way clang -emit-llvm generates errors like: :1:1: error: unknown directive .syntax unified I have verified it on clang 5, 6 ,7, 8, 9, 10 as on native platform as for cross-compiling. This decision is arguable, but it doesn't have impact on samples/bpf so it's easier just ignore it for clang, at least for now... Signed-off-by: Ivan Khoronzhuk --- arch/arm/include/asm/unified.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) -- 2.17.1 diff --git a/arch/arm/include/asm/unified.h b/arch/arm/include/asm/unified.h index 1e2c3eb04353..3cf8757b9a14 100644 --- a/arch/arm/include/asm/unified.h +++ b/arch/arm/include/asm/unified.h @@ -11,7 +11,11 @@ #if defined(__ASSEMBLY__) .syntax unified #else -__asm__(".syntax unified"); + +#ifndef __clang__ + __asm__(".syntax unified"); +#endif + #endif #ifdef CONFIG_CPU_V7M