From patchwork Mon Sep 16 10:54:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 173833 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp3338372ilq; Mon, 16 Sep 2019 03:55:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqyVKSFabCR6ifEoYQHdrdBtJe7Zax2+yNiTshbbN1FFSJXb2eTPnteckKXc7Odc4aCNste3 X-Received: by 2002:a50:d5c5:: with SMTP id g5mr58222689edj.57.1568631342906; Mon, 16 Sep 2019 03:55:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568631342; cv=none; d=google.com; s=arc-20160816; b=sglvQF4P+wnc69y4ByC9H7xV3ycQncD2mCD5QCEsTLR+WuqFM49/iDHD/BS4oabaMd UE2S31nineTXQ1oP+JnkEECCRB3bR6XGYgdclWJ5+BH+kFfmXmkypkWZUTEz4ToSODfc NAJ9AGkfwpkMq/E50+KjiCSO9HOr/+EvV8bNbP06p22fJyYuFD5BOWcOv16EQnIRYnhB MVtFcikaJzMj7j6FubHqutLvAtVo0K0t999oPR2xw0W77ls1qb/wz++EN/iVfIycVyRc vfXGFfIlP8MZBBAZysJ00hiBqhwDSDxYpiXujDhYeC/d2AuW3MMSNmAkE3IKje5jC45Q 23nw== 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 c8si22887515edb.82.2019.09.16.03.55.42; Mon, 16 Sep 2019 03:55:42 -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 S1732518AbfIPKyw (ORCPT + 27 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(+) -- 2.17.1 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