From patchwork Wed Oct 9 20:41: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: 175693 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp1264971ill; Wed, 9 Oct 2019 13:42:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqw8AVTNt8iBcGBW9+Y6tqvdlczsNIY3hD9XcYqyncD1i7dkYJZFAsNbXVahhrQme59zWZ06 X-Received: by 2002:a17:906:6b88:: with SMTP id l8mr4736178ejr.26.1570653770512; Wed, 09 Oct 2019 13:42:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570653770; cv=none; d=google.com; s=arc-20160816; b=HlqrMJyz5/T3KRoFSRZtIsHF9/o3DDLKlRJGuIuvdEUtRHanWadxMtwPZd+pSb2uQ0 lMm8KGon0u3fVPAAoWJhmATPclnMU3pG/yXKGbCOJ4KOstvHPxVEEVeGiK0NOQGQfPRr U84PdN6ml9nkG+upsYVXf7AZXi2S+GHi4cVR/csZ6q54iKGJdS2yScW/EnzEghfTWaPQ TCDgG5a2R9UFW0Q2ePhw73KY+69UQi3xxOAUiZgDt4evkYJvEc4NIwKxWCfKO4J79Kay 6l77kkYmk4TGsfToGS8OB+UbCJfw0UXnCEmwd+AUrgHIfMOMkGcECp3v+FybkKgMOzNZ LnkA== 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=Q8GViA3rslKXoIblVB14HOdim3G08AtxcYrIekVeHcE=; b=bp6K5x9TlyUs1DVgpfiEoRzyh3QgFF3XFz6v2wHnpthKcdtkZ2gNVdEJcuMbs8szwX XtuCY2xAqvoCH8DwHnCHiQWVLnkJeqb2XSugtAwJYvhdaPUFo3BNMjFMdtoNIAChuSa3 mxBB6FJouFbaJgf83vdQIc+MjbSh6EP4khMvSREyFqO7gPBYZFB5AU8jQwkiMj0zhj+t sEjoel9HUX8VqVsn+tJ8fY3U8XCP3k+iUabxnyUn7yzG8UnU26Cz/zXX5FKWfxUf3svz 9MOOPSWrQAdvmrSHKXUzP0KAiuzN/eEGiqT1KojItLyZc2uK4phipfb3824B1acTTe4d L4Cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pfrCF401; 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 sb7si1878178ejb.321.2019.10.09.13.42.49; Wed, 09 Oct 2019 13:42:50 -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=pfrCF401; 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 S1732326AbfJIUmt (ORCPT + 26 others); Wed, 9 Oct 2019 16:42:49 -0400 Received: from mail-lj1-f178.google.com ([209.85.208.178]:40764 "EHLO mail-lj1-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731952AbfJIUls (ORCPT ); Wed, 9 Oct 2019 16:41:48 -0400 Received: by mail-lj1-f178.google.com with SMTP id 7so3868528ljw.7 for ; Wed, 09 Oct 2019 13:41: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=Q8GViA3rslKXoIblVB14HOdim3G08AtxcYrIekVeHcE=; b=pfrCF401TvMKnGGNl+mGcNqDCp2vUaNFpxEHOZUq1XK5MSPm3P1fYAf7wPUa+ETpQy VOVS4CBzr+1pxsUk6OaY9H5cdbJJGJ79afBvAVM7dhtqB3p/rgd3mhnIdLqFLvDK0mTd g0BL+HT0f/ysat5klwdZ82W7ujyD7W84PDhXsN3PpZ6AVA+ItryF/xgSXb9ZFPZ0XQH8 bbDmHihjaFmyodxwsKWZK1D9NAxKeEqJpo8wMBZLQH4UaAtgHRCn4mApNkvdxUcnXGbV DQg/S8s66IiuaM28TVfm+AHtC3W49BgIRvSedebxXVHbJ/nrr4jh4KffMFSzscaK04Ud MiNA== 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=Q8GViA3rslKXoIblVB14HOdim3G08AtxcYrIekVeHcE=; b=iTSMGegNcGmV5ZL2s1ta3rW9GHUzoFzqkgco1l6qKEFzCQavWvI9CzYEPGr+7jK4BB kUOClbnpFlNHl5Xg4+WYb3PlGJycX52wIAhtR7++b5IDhxvXaKGVXjd3i7hxQtODE4Ok XlnYpruxGrcsHyRYILR414BIsTZjdjXQC8COajQFyeyhp/uYjmPA8PMtWjilv0PzI5ZG P3Wj48oqKeiakN2TXm9MD3rxQ194iNTn558NSPkctgfPop8ot5UGfgcPhGt0uM0mC8+b Zi1wkbPLKkBA/tpWfmZH7i1VrmfWH1/olN+LwU7Nm91NY05xL31sJXJEZgLB0UGyFapd aZJA== X-Gm-Message-State: APjAAAWgRLHUk4kvMmlh4uHtxpDjy8u/AXkVINFDazrLZrdQDBbSjJMR qXZurlCZmcOufczeXhFHAo9WHQ== X-Received: by 2002:a2e:9890:: with SMTP id b16mr3652941ljj.4.1570653706617; Wed, 09 Oct 2019 13:41: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 h3sm730871ljf.12.2019.10.09.13.41.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Oct 2019 13:41: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, ilias.apalodimas@linaro.org, sergei.shtylyov@cogentembedded.com, Ivan Khoronzhuk Subject: [PATCH v4 bpf-next 05/15] samples/bpf: use __LINUX_ARM_ARCH__ selector for arm Date: Wed, 9 Oct 2019 23:41:24 +0300 Message-Id: <20191009204134.26960-6-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191009204134.26960-1-ivan.khoronzhuk@linaro.org> References: <20191009204134.26960-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 | 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