Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp3935539ybe; Mon, 16 Sep 2019 04:02:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqwVIUyTi2VBOxzWYQYD90CsdpHQJ4xxSqR/RFLtjGGae4mz1TOZGXnY+G0ZK8CB3bOFefQY X-Received: by 2002:a17:907:40bc:: with SMTP id nu20mr2661391ejb.309.1568631757514; Mon, 16 Sep 2019 04:02:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568631757; cv=none; d=google.com; s=arc-20160816; b=KaM8ls0pXH5NPhE45D6jetfLfCmjOnqnYXYKYut9Lg+f66DF9SmcpIHdM91nlOTFbh NC2lLZCxzwrHFcCqYRZRJhWfEyE8M2Z9Af0rZtu4rYlMgej5nDu8jfowJ4kxzKvNyId8 zW6ym2nydjSJAZZ/4WMpxACDdq0J3CEHod/wCreVXjOmTB0nMCqUvqB5vxW38Ix8WvWp XhRy5z+MWLfKLbMMzxslu2rxe2L9rTVVDiTTWS+RaHJHKSp9lALZ3vydY3AJuQsuwWp5 1kq6EhOrqSF3YsvRxhR+y5xP1/vSaRGu9QyDJXCI8rJ3GbV0ID2GUESvp9VJtE72v1T3 p3Lg== 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=H+Oq4KltqpOb9wzu+L9OzY4bSDO7cEMe/MUjYdSZoPU=; b=RdKE+ZvDUSQJdKvXJn6D+qF6KgXsBUG91dbTs6YxBSjSgCDgfry37x5736Pi3GwsAa 5aKWUSJnvK0gh/iGsd3txhOTwuI0oFfU0lVi0JdNKaMwfUr+JsHc2OZBH13P576OrqZx lpDPjvT9C+5k8gRHWekpaRJUvN19ba385deisL7JyJmC3EbhB1bC8avxItZcaopr81/I OCKINxndLI4uR7xcH3G8wV+uy7VBht8xBRydmETPqS8nJmqM0EI/drVI7MphR+cvxJDu 8QRdaL12ACjr/DLQvtvteMtmlSpCABakEJfWRuQaqNmtTibd1z/b8J714/uG2jNnzZQI Yyvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UrB84xhN; 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 c14si24477339eda.8.2019.09.16.04.02.14; Mon, 16 Sep 2019 04:02:37 -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=UrB84xhN; 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 S1732515AbfIPKyw (ORCPT + 99 others); Mon, 16 Sep 2019 06:54:52 -0400 Received: from mail-lj1-f196.google.com ([209.85.208.196]:45316 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732442AbfIPKyt (ORCPT ); Mon, 16 Sep 2019 06:54:49 -0400 Received: by mail-lj1-f196.google.com with SMTP id q64so22747244ljb.12 for ; Mon, 16 Sep 2019 03:54: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=H+Oq4KltqpOb9wzu+L9OzY4bSDO7cEMe/MUjYdSZoPU=; b=UrB84xhNOOGhDmRHN4tEy21BxZte/v8W4CZVHuwaeoMKZensFssyvROhnk9udXZAWz JReS0yZSuYH5mPKKBCWNIaMerRcfSF+DPnCTQVKPlPwrFyp5Oe8NoO4Y9InriRYX05eg QrgslNhgph2Jw9DXJ5YHj96hldOtquP1+z33zTZKJDg+32Gxz59xznVRAdUl+l7//C2/ eatPjrGBSFUM3gi0Ov7oJ1/yjdBVMoMGc38yUqD6zyZH446H0JDswC/cboiHLROsjxj2 MaiWKvwY0xGH+DLg6A40H0Ta+e6uQZ9fGECdAQkuo2REdw7Cn/aEzLOnuAzM66wputxt 6IAA== 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=H+Oq4KltqpOb9wzu+L9OzY4bSDO7cEMe/MUjYdSZoPU=; b=qrTRcUTNyugU7BGR/Xj1K5YuGurvE3dKjGidZicKTXN22uDbcIonmru49oC+Fh0B/d 9dborPT4SKq9HAAMrOEuexcb0xOXiXv9atP71v8pF6R/sVN1HEahxnpPDk6JKWivEuI1 7DzTcVfhfidslOjnQWuMH1P35shnVAZZebENPeLB9JEQvfImfimwxaQUmjxLDvZQSli4 iJtHtpMFjDhu7l0I105kW/GbZsdD8So3/dXhYMUirPm8Bai7xvKeN6J3wxWJcirYR/SM PfHriaS54RI23xQ4Z7dcXHzFm4YfMM5JuGhZpeKx2rmKBc/4EPdFAxrqJdn1WCYdacq5 Hnog== X-Gm-Message-State: APjAAAWQSx5GmX4kMwFA+f+8UK2EAc3NvHYsJ5iVKljbn7iQseXaBImR fzsUyAdhmpnvOKSapGqop0Sq4Q== X-Received: by 2002:a2e:2bdb:: with SMTP id r88mr36236050ljr.82.1568631286844; Mon, 16 Sep 2019 03:54: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 v1sm8987737lfq.89.2019.09.16.03.54.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Sep 2019 03:54:46 -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, sergei.shtylyov@cogentembedded.com, Ivan Khoronzhuk Subject: [PATCH v3 bpf-next 05/14] samples: bpf: makefile: use __LINUX_ARM_ARCH__ selector for arm Date: Mon, 16 Sep 2019 13:54:24 +0300 Message-Id: <20190916105433.11404-6-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190916105433.11404-1-ivan.khoronzhuk@linaro.org> References: <20190916105433.11404-1-ivan.khoronzhuk@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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. --- samples/bpf/Makefile | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile index 8ecc5d0c2d5b..d3c8db3df560 100644 --- a/samples/bpf/Makefile +++ b/samples/bpf/Makefile @@ -185,6 +185,16 @@ 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 = $(shell echo "$(KBUILD_CFLAGS) " | \ + sed 's/[[:blank:]]/\n/g' | sed '/^-D__LINUX_ARM_ARCH__/!d') + +CLANG_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 -- 2.17.1