From patchwork Fri Oct 11 00:27:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 175886 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp41482ill; Thu, 10 Oct 2019 17:28:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqxwFjBbybX9atSeDKIpJJX/NUQdssHKRexRD7ZKlbrJoch5I9AYBlSmUZqbp9B/5+feZcd2 X-Received: by 2002:a17:906:298f:: with SMTP id x15mr10862359eje.50.1570753712588; Thu, 10 Oct 2019 17:28:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570753712; cv=none; d=google.com; s=arc-20160816; b=jNEtK9bSuaJXPXeLnQ5OVH9N5BPCaoOq1b0SYLLZj78BFv8MpvzF51VcjtNxpKEaD7 HMSDXDsQrZ7w3680JZxsWol/o8LX5KimD5HHWCAjB2NaFYHi+UtDtfN3cyZprgNCWmsM NUzZtZzJVWKOXxsk/WjbEJD6nmqQ8nhxzlJLroDLVPBrTniEhsFJECiPY7qJqmaKIrAi 8gA46LErFzyP92n2NyOedVM62smLaqwnGBXi7tiHlJl5cd2KU+a0lqNlKbhf/b64szGL ujDqKFPnjrkLGMgc/gp8odEIjcKlwz7yL4ZkYRep7SoJGzv2bWyPczSHhHRRbHEnyZ1L oSTw== 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=dRRusRl3mddScRkdUTvMTuf5U4XldYcoWbxA4ajO70k=; b=kChwC8okIYqwZa6XSnE8x1agYEoKjNxw5vmu8Q61bQ09dQeuU+wcSS6iKUCf0O9Bev yq1Gc0bCs+ZFaIRahsNZ5qL0+nlsDiGHMCqsbP1qrHv3Jq3t0w36kP7L4xOO4UCQ/F9Y Bx9HLN/ah0Yz0OXqSvtcVMSb6m44rrF88xz74CK11v7YaVLYWgHluyaAVQNb47MeYDaA KLWiEkt2e4H1uKTEdzIklTfgGrcsqV616V4seZyZJVWYGfBDc4e42CKr7LFXvlN7Ha6Y XsSs9tWvjOT8PMNJYh2v38k+/DKPe+zVzaQi16ObayihCa9DmfZOjCWBgcdzKjodHM/W fhKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JiDnktEV; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-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 w5si5098961edf.283.2019.10.10.17.28.32; Thu, 10 Oct 2019 17:28:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of netdev-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=JiDnktEV; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-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 S1727641AbfJKA2b (ORCPT + 8 others); Thu, 10 Oct 2019 20:28:31 -0400 Received: from mail-lj1-f176.google.com ([209.85.208.176]:33672 "EHLO mail-lj1-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727577AbfJKA23 (ORCPT ); Thu, 10 Oct 2019 20:28:29 -0400 Received: by mail-lj1-f176.google.com with SMTP id a22so8065615ljd.0 for ; Thu, 10 Oct 2019 17:28:28 -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=dRRusRl3mddScRkdUTvMTuf5U4XldYcoWbxA4ajO70k=; b=JiDnktEVbjGXgr5jDkjz+nyzDLWoFzL++RSonmBJ1+BCVuJHjKwvQRzKF2N/0yd6X3 rRShXLxxe8luonjB3if8Jju9/CgVbuDGlKy/tg8MSeZioRHeKgP5R4sAwJ5pVtugVZwQ JLSmYuNW4Tkf/qJPHii/E3gkbv2vFALS202fCqRZBL05OL+6ne+UYEpmQga9PbjCPqSN 0nWRvKpvNQVVfZbRUm6eOPYne/3Ur1hzKNikB6xuy0ht798+2g9CoCrzv5U9X0ClflYt bD2ySMU/NdPjLvXb8qgPsw5CokeevbTK2D02ulcZeGt2HKfrL+qGbxbpXdo/hefjqt84 jA9w== 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=dRRusRl3mddScRkdUTvMTuf5U4XldYcoWbxA4ajO70k=; b=V5AfoDaOkcwTxHObFWtzQl/iCaFxCuuw8tDcJf51PMD/rlQKOcfYttXBT/EVg6E3Wr iQcnWvW39IJMSmR/scluOZfpjVGeJYBgUIB6mvVsG6y0FsFWLwb/6bRXkd6aEQIjcrdQ H6rpppI4Z0+ynyJQEI6Em3oXAfBzc2bbSg9xsaMgFJLOclZCwRRYJFON3LBeWZZjTVtP wcIHVnewFDjQmftdQVJNmVM6tG7m8TMo3NDmfzLUt0ecB+T9F+vGSFet2+wBEmnpaxdE 1pA8OvPqWaoxvSCwlXDpdRxxnTeNZ+DHBwz/r1xh6xTkgQOBB6lZBBVEFdMWTTmWGjR3 Kxhg== X-Gm-Message-State: APjAAAWWNexHShDShc6HOTF5prhn57sMK0pCVDchdUa4r4zdL9E1pph/ Tx0+GxDPRGUpKSg6yMzGecZWH7uOrCM= X-Received: by 2002:a2e:a211:: with SMTP id h17mr7749678ljm.251.1570753707769; Thu, 10 Oct 2019 17:28:27 -0700 (PDT) Received: from localhost.localdomain (88-201-94-178.pool.ukrtel.net. [178.94.201.88]) by smtp.gmail.com with ESMTPSA id 126sm2367010lfh.45.2019.10.10.17.28.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Oct 2019 17:28:27 -0700 (PDT) From: Ivan Khoronzhuk To: 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-kernel@vger.kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org, clang-built-linux@googlegroups.com, ilias.apalodimas@linaro.org, sergei.shtylyov@cogentembedded.com, Ivan Khoronzhuk Subject: [PATCH v5 bpf-next 05/15] samples/bpf: use __LINUX_ARM_ARCH__ selector for arm Date: Fri, 11 Oct 2019 03:27:58 +0300 Message-Id: <20191011002808.28206-6-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191011002808.28206-1-ivan.khoronzhuk@linaro.org> References: <20191011002808.28206-1-ivan.khoronzhuk@linaro.org> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org For arm, -D__LINUX_ARM_ARCH__=X is min version used as instruction set selector and is absolutely required while parsing some parts of headers. It's present in KBUILD_CFLAGS but not in autoconf.h, so let's retrieve it from and add to programs cflags. In another case errors like "SMP is not supported" for armv7 and bunch of other errors are issued resulting to incorrect final object. Signed-off-by: Ivan Khoronzhuk --- samples/bpf/Makefile | 8 ++++++++ 1 file changed, 8 insertions(+) -- 2.17.1 diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile index cf882e43648a..9b33e7395eac 100644 --- a/samples/bpf/Makefile +++ b/samples/bpf/Makefile @@ -185,6 +185,14 @@ HOSTLDLIBS_map_perf_test += -lrt HOSTLDLIBS_test_overhead += -lrt HOSTLDLIBS_xdpsock += -pthread +ifeq ($(ARCH), arm) +# Strip all except -D__LINUX_ARM_ARCH__ option needed to handle linux +# headers when arm instruction set identification is requested. +ARM_ARCH_SELECTOR := $(filter -D__LINUX_ARM_ARCH__%, $(KBUILD_CFLAGS)) +BPF_EXTRA_CFLAGS := $(ARM_ARCH_SELECTOR) +KBUILD_HOSTCFLAGS += $(ARM_ARCH_SELECTOR) +endif + # Allows pointing LLC/CLANG to a LLVM backend with bpf support, redefine on cmdline: # make samples/bpf/ LLC=~/git/llvm/build/bin/llc CLANG=~/git/llvm/build/bin/clang LLC ?= llc