Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp5064659ybe; Tue, 17 Sep 2019 01:53:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqxR9v+fS2VS50nobe0ELiOIupL5iXu/Xo4PBQvG2+Coj/btRqQFk5qWb0+yp8nyXxHnMDwl X-Received: by 2002:a50:ac0d:: with SMTP id v13mr3367806edc.189.1568710425796; Tue, 17 Sep 2019 01:53:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568710425; cv=none; d=google.com; s=arc-20160816; b=Q3vPf/cIn7i2RHd8NdQu2cEPjgGY75Y0efHsdCgQAVPG9a6XT0Rf6FQZJL5UIKvITh hz3u7ky/88Wd4bPVfCsPylPyrnaxsLoEER7ndY/j8Wb8C90CZtg+xNAkqciixTKtR76J pc2sGTMkuT5ymTNkB+ubJ7roz7x+thtqnWdd3eM7GVbxEuKzrIt4kYD/C4VwdkAH3Raw cfD6bLuHofQol6DPAVJam9j0lMqGrxhD0dyckQ/3ZXMrJzKb+UOGPstgo2cDmR0pXVxT V/zYLoU+2zeQis++CUYG5ln4jj+z+O5xPa+0PizDWsBvXdRxEoVGK+Q9wLy6mIHuhbf2 os6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date:dkim-signature; bh=an8Tg0keAdSMZgI1pA83USwohPIWdfUkBfCw/Vxa0hM=; b=DSSjyMOtNvA6VYc+7d1zR2KLRjv5YIEtEiOhKWgavUcqOcZ7befA1sn5wSWzkJfT2r vn2GqvDExUT+KlNZOCr5mJMtH02px5+Y+CZ3p/maS5VQj6Ms5zl3+qUAUGnA+EYnDtks YET9UC3xJxdPdfvQKjm+9E+fv1pJWm9XydzTpXQKy37da2I6P9NNK+Q6ZGSXcUTjx5Pz d/KE7p1hA9c80ftzPFE7hq/rWv/MiOz0Y86b8AcLTIBTGpHYAU1UkYsX+ELeBcIVgQzX J6TP25aP4LlZ94m0D8KZUJmNqXDf5gefUNcLfOn0fmW9CldbK0QQ42a1nagF1N/lMy9P 34XA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hv59pXfy; 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 j10si983475ede.70.2019.09.17.01.53.22; Tue, 17 Sep 2019 01:53:45 -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=hv59pXfy; 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 S1732722AbfIPWES (ORCPT + 99 others); Mon, 16 Sep 2019 18:04:18 -0400 Received: from mail-lj1-f194.google.com ([209.85.208.194]:44015 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730425AbfIPWER (ORCPT ); Mon, 16 Sep 2019 18:04:17 -0400 Received: by mail-lj1-f194.google.com with SMTP id d5so1395807lja.10 for ; Mon, 16 Sep 2019 15:04:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to:user-agent; bh=an8Tg0keAdSMZgI1pA83USwohPIWdfUkBfCw/Vxa0hM=; b=hv59pXfy2WeDYAVOITvOqi5pmbivkfyJEmrsWkFDXA2OijgH8E4ceqm8i61GPbaYML yt9Rep1apYmMxAzvW1DoX+b7veawQc/j2oFXjXkwmVjtq07PKyGqvuH2mWXFLHqRti9e 3eVbV5UIW5nxPj0SkRdCrVl2+wMPJBwBCFaat2EQkV5GKKP1LErG3HPgMzKFhCufxgMo 2ZMu/4tuqbmWyu4sz+HCEKd15qrvE87rZ2rb6G+DdjFRte8KPenKCtqx4OF4GLUb0HR9 f7YPCEv9ct/lZBQmB0Cotn4PpnNpMpvzZP8gqAoVU0npRdfwXqHau30dIoce7ygjSc0r G6IQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=an8Tg0keAdSMZgI1pA83USwohPIWdfUkBfCw/Vxa0hM=; b=e+AeS7UllyQPsTzjciusdDFbTWPfyFKhMfmjk4YQv+LAGBA6Q9AZZlXJKZX1+e3A0H VfJlPwrU+yKBp/mhgHz28sm/USTfr8UMC4+5PaBxn7nNNpStFydS8QJ8A3Gkr4cmdCpi ABLd/T6pd3nkxA+qsp5nXhCmqoLPvsCoaXqbu59vHUYGReMiks4EBz19P9UYveMKkM58 /Jny3jm+XIuNzh8/Pcno3HClDzcq+lzRPmfw4uT1l3jF5IQILKOcTajStOY7VIrGMj6i mAK7KDI6T7v8zIggMV0/YcDMB1609k+YeuVdsky2hBp3XOLDqhlrmYzPfBvai1nsGPHa XH7Q== X-Gm-Message-State: APjAAAUD91NDujW8w5MqcMDXTlvEKzFwbZXbtL3XCk69OVR4tpL61eWK w/09NG21p44swKCUFs0kaZpn2g== X-Received: by 2002:a2e:958c:: with SMTP id w12mr67916ljh.98.1568671455527; Mon, 16 Sep 2019 15:04:15 -0700 (PDT) Received: from khorivan (168-200-94-178.pool.ukrtel.net. [178.94.200.168]) by smtp.gmail.com with ESMTPSA id e8sm40562ljk.54.2019.09.16.15.04.14 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 16 Sep 2019 15:04:14 -0700 (PDT) Date: Tue, 17 Sep 2019 01:04:12 +0300 From: Ivan Khoronzhuk To: Andrii Nakryiko Cc: Alexei Starovoitov , Daniel Borkmann , Yonghong Song , "David S. Miller" , Jakub Kicinski , Jesper Dangaard Brouer , john fastabend , open list , Networking , bpf , clang-built-linux@googlegroups.com, sergei.shtylyov@cogentembedded.com Subject: Re: [PATCH v3 bpf-next 05/14] samples: bpf: makefile: use __LINUX_ARM_ARCH__ selector for arm Message-ID: <20190916220411.GC4420@khorivan> Mail-Followup-To: Andrii Nakryiko , Alexei Starovoitov , Daniel Borkmann , Yonghong Song , "David S. Miller" , Jakub Kicinski , Jesper Dangaard Brouer , john fastabend , open list , Networking , bpf , clang-built-linux@googlegroups.com, sergei.shtylyov@cogentembedded.com References: <20190916105433.11404-1-ivan.khoronzhuk@linaro.org> <20190916105433.11404-6-ivan.khoronzhuk@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 16, 2019 at 01:44:23PM -0700, Andrii Nakryiko wrote: >On Mon, Sep 16, 2019 at 3:59 AM Ivan Khoronzhuk > wrote: >> >> 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') > >Does the following work exactly like that without shelling out (and >being arguably simpler)? > >ARM_ARCH_SELECTOR = $(filter -D__LINUX_ARM_ARCH__%, $(KBUILD_CFLAGS)) > >> + >> +CLANG_EXTRA_CFLAGS := $(ARM_ARCH_SELECTOR) >> +KBUILD_HOSTCFLAGS := $(ARM_ARCH_SELECTOR) > >Isn't this clearing out previous value of KBUILD_HOSTCFLAGS? Is that >intentional, or it was supposed to be += here? > >> +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 >> Just left from previous version filtering all -D options. Will update in next v., SELECTOR also. -- Regards, Ivan Khoronzhuk