From patchwork Fri Oct 11 00:27:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 175883 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp41374ill; Thu, 10 Oct 2019 17:28:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqzgSD3XVG0Zp3gfah0ZlelW2LViQZrq6L1Bv5kmjzb8CWXeBT8WoVMHaYJikIY+9Q/U/4vj X-Received: by 2002:a17:906:6847:: with SMTP id a7mr10986274ejs.261.1570753705724; Thu, 10 Oct 2019 17:28:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570753705; cv=none; d=google.com; s=arc-20160816; b=puOy+MEFntJRIrP1WS/mtbSdQrJi3mgkIIauIuq79+ZVP0CmtyJnkKbf2B1R/uKydz ZV1OkDhm6K0gRVPUXKLuAnJYuI5wLYwgYvfjPL8lcorCfB9YWnMEHh4INJZUr8JE03zq Wvg6Ae1FxIWRgMQClHFrXPY6fdeZC2JDFncTFDSzpuo2TusB7IPGv1Wtu2QQapayFekr l1pyzHadZ6Ko/JyMCDg9sdyC4uWFHcIYRhcdB01ONuquU3u0WzPtJ9yyyshf0Z1F719h XaWonCzGHHsKKZLIER09shzAMViBx5/1Ue2/tOi8M13+xBLh08gfHxmKKtK9rV+4ar8z EFjQ== 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=rC9SMV92VCkp1Gr2RjsUAyri6h3CbwRZLjtMRm5Ly2A=; b=u9Hu+yT1WJ7jQKt/bTWiLBVTBqeGzGbnyF1FEqMyVDamZd9Mxo3eVDgrJ0Cb9aD6/4 CA09YHxw5IKN21lxdte8PdaO0b0ZPHhYtBJlcQ/GaVP4p8D5AxVgkQTgDakHUCGU8kPf GK7wgXUzaaZb6C0dI3ALbR2eF4tw9+m18wEgTJ+lWngNxxwY7JOlBqnM5hqAzV2+Xurl XFXGf8CvAll1SnMsC2RU3F1POyf53fR4rJcMbdJAoQvYdFnASxWFcA/jLcmvYmnmWNEH wxhgqks0eqfSSSE4wnaQy4H4skChdQEfU7Qb5fV4PY8Hdnbfsm/WAledZvGYwx4W9wJB t1zg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=n7n7nGtk; 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 k9si4873076edb.56.2019.10.10.17.28.25; Thu, 10 Oct 2019 17:28:25 -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=n7n7nGtk; 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 S1727521AbfJKA2Y (ORCPT + 8 others); Thu, 10 Oct 2019 20:28:24 -0400 Received: from mail-lj1-f195.google.com ([209.85.208.195]:40308 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726096AbfJKA2Y (ORCPT ); Thu, 10 Oct 2019 20:28:24 -0400 Received: by mail-lj1-f195.google.com with SMTP id 7so8024661ljw.7 for ; Thu, 10 Oct 2019 17:28:23 -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=rC9SMV92VCkp1Gr2RjsUAyri6h3CbwRZLjtMRm5Ly2A=; b=n7n7nGtk8cu5ldPiMWOVomq4IEoWhI8D15Ro7zik+00sQm//xyM9I+QPGkMobvspt8 b8cREF9EORqoA5SWIjR3MntFr/B5gcO7egbGxamOkAZsyMLW4wsvjJ71ustx90ZW7Zox a26jCnVWe4t7ZpxHs374/UViRLdmkrOhijdiHEaWbSc3bSI0mR+ncJHp35MXgsx7pfO4 ZnIc3WwmA8pNB5cdja5tXOTrUIhlLhz4H3SNnNzvfbDOUIliSpXiriwzPFCNIAgENdY+ U9oQzLwdKI3K9JqLDHwYPTKvh7MSy3zHuNPKEd/9yOT21UMav04Ui0pWdf2di+uvaxi+ 7yuQ== 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=rC9SMV92VCkp1Gr2RjsUAyri6h3CbwRZLjtMRm5Ly2A=; b=krXtvibiJUB/YRZdXV6JfsIYUpjv0jo1BHI/Oh3Vkozv+8MbXtgy+1JM/FsKKhYxJ7 tqmC8arR5Cyvx3aXGd27YhS4M/OU2BuERM7S8LYoK//cmlTC6UcaB6/m1nd8E+QxUJA3 7/lrTn5ZnJyckomU8uAZNfC+rV2F06TRtg5rjCj7vJOswOYi1Qlx7UNnbCcjhTuSJJqB eDj0WlKym7ouVKXDQgJUhCQHj8g4GH2Zdlz9FrAvi0kjYPsr/yVhYsCBJQUNZpdqoqGC ZoimmgK9TitBOF6mh7kI8egBv9LB99HebqPqtENy8x4TTS8GsoQD9MvbfXEKwAc5toSP AAZw== X-Gm-Message-State: APjAAAUoqggMOFBdCUgJuA40vI4TJLWvlQhc7rclBNA1zZ+B3SORArji c1pY01rAO+unhSgsW02ybJmYUg== X-Received: by 2002:a2e:9a43:: with SMTP id k3mr7415360ljj.70.1570753702298; Thu, 10 Oct 2019 17:28:22 -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.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Oct 2019 17:28:21 -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 01/15] samples/bpf: fix HDR_PROBE "echo" Date: Fri, 11 Oct 2019 03:27:54 +0300 Message-Id: <20191011002808.28206-2-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 echo should be replaced with echo -e to handle '\n' correctly, but instead, replace it with printf as some systems can't handle echo -e. Acked-by: Andrii Nakryiko Signed-off-by: Ivan Khoronzhuk --- samples/bpf/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.17.1 diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile index a11d7270583d..4f61725b1d86 100644 --- a/samples/bpf/Makefile +++ b/samples/bpf/Makefile @@ -201,7 +201,7 @@ endif # Don't evaluate probes and warnings if we need to run make recursively ifneq ($(src),) -HDR_PROBE := $(shell echo "\#include \n struct list_head { int a; }; int main() { return 0; }" | \ +HDR_PROBE := $(shell printf "\#include \n struct list_head { int a; }; int main() { return 0; }" | \ $(HOSTCC) $(KBUILD_HOSTCFLAGS) -x c - -o /dev/null 2>/dev/null && \ echo okay) From patchwork Fri Oct 11 00:27:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 175884 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp41462ill; Thu, 10 Oct 2019 17:28:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqwrvltRdvQ5qc8ZHyTyHwnYQkrLicXNy/IYJMvz7mv2YVdGnNm/19qfg36+F0BY6fwow8Xf X-Received: by 2002:a17:906:474b:: with SMTP id j11mr11050143ejs.325.1570753711516; Thu, 10 Oct 2019 17:28:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570753711; cv=none; d=google.com; s=arc-20160816; b=FsVga11nqmtfkk8/3sN1YGAEik1vST7UQVxj/5kD+zNccLCFqrOYCCgYp43YMt1/08 xbzh8ULajFXdBVUPuBdl9J0dkVXiaEo3KspeoQPTNwZoVbGWMrp12K6x1EQ4sMDX/Pk3 xRxc2wp/rGIUd1/ZtxOEstj2PWhycGWIHsepehMguL5z9ZFO2GtgL5tlUvCIxdZRoZab R0yNCMvrasPmKbA4Vsiv35eFPvy1sFXogtaBkcMhK4pnM+XZVvJ3k9lETkjf7TEEAt8B 2QO9Zz19wvUp00JzrOoIcmyelMvVkoSd2v//Jhpa9XITAOtGEKFdk4eBVJNgC0jvwbLP zo1A== 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=y12OqUDXt0uUd8S/w/N9B4j5fJB9b6dEGe48WxLpJQ0=; b=qgscZobpVtnZl1CoAyKFMTlqCAi9sAh8QJELppuncQVd0hLIPYKFCaPB2VLBZJhGp/ 9mJjqtprN9wfjXHQWwO57JjxOrZrEvS1s7v00S714gIAx2L0qOBAa89W4p8Cmwxw30rC hJ3aFVZejQZWjA6l4K5lhq7R49Iv1qYMmCDSZb0u49ST2AnvPt2hYLiebJhPEgEiNqk0 U+CkqRjMII+tzbZDuA1EJ6T2v5ibq4JR8JGYaloWvzcAqiIFujDJUj4Kj3FgcvfMuF0M 5103QdteypO+MzmKn6eSRzsAW/0a2oqkwnNJOJox9X8IjbgQLjedgaIekBOOBfA/SHuf zJIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="deZb/gvn"; 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.31; Thu, 10 Oct 2019 17:28:31 -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="deZb/gvn"; 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 S1727576AbfJKA21 (ORCPT + 8 others); Thu, 10 Oct 2019 20:28:27 -0400 Received: from mail-lj1-f194.google.com ([209.85.208.194]:34280 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727528AbfJKA20 (ORCPT ); Thu, 10 Oct 2019 20:28:26 -0400 Received: by mail-lj1-f194.google.com with SMTP id j19so8070245lja.1 for ; Thu, 10 Oct 2019 17:28:24 -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=y12OqUDXt0uUd8S/w/N9B4j5fJB9b6dEGe48WxLpJQ0=; b=deZb/gvn8tRBWJ8EkwM4ZsgQbv8cKKMpAA2vf6G4xRFrYVAvufEMhW8txzk+WL8jog mRr7UCSlsEoukk0CBSI3WVyQH2ebrmaFhmUpX304VfwuEzwcBbYogWTqta96NzGab23d K4u1cCqe2+htE/tMhpH0wwPbB+TmlaC0g94WcpLpPrLjELHj2jJyPZ6ogY2MzYAw8D6P xiaMOcdpUxjpfkClJCQrCd/Z9r5gWMRFGbTxrsrxqzuBe9eeDepyP96MWN2DtWB+gp76 Dh5lfo5p3ACqIH0MOgfKt9xTZNOPlHqr4iAdNt7BnklttINOkT2odQBy2BjW8oPe/YK7 n0ZA== 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=y12OqUDXt0uUd8S/w/N9B4j5fJB9b6dEGe48WxLpJQ0=; b=oRfx1TWnKdsRbWgrDJrlaP7lihrz+3bWxg1LWZM0RuA9g/4c7imSTBepPwfFLjpdG/ PNDo191W0ONRzkJuP9CiVxtqx13Gu9Bh8Kap9vRg2GJsc4CPq9KYmSZ41CPvzZn22lcV ZIiVTKuKBdykHgdZzYs82ZbMAHfGYNF1b8sd2UYrT+KMZFOZo1HgxoaB9+gVl7GZkOyW qkpuli+iNEXPwgGJ/Y9kvFUAe5ggyxa7Y4ouD28xzMq7s5ojxwEnIVJPXOJUBQqcN+3D 7Zh2RS8H/Y96NtP+s7T+zf+O2Lvfm52vdib3l9SxHv4df+zxFOy6DwGFErbU5Pql5zxC ahDA== X-Gm-Message-State: APjAAAVKCjzRCQSVDhMgikoI0aQqLj7yfrAX+YyjpL/6m7srIll4sdku FcxXNMwROo17XdGbPzgKC0HfLg== X-Received: by 2002:a2e:82cd:: with SMTP id n13mr7735053ljh.116.1570753703648; Thu, 10 Oct 2019 17:28:23 -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.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Oct 2019 17:28:23 -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 02/15] samples/bpf: fix cookie_uid_helper_example obj build Date: Fri, 11 Oct 2019 03:27:55 +0300 Message-Id: <20191011002808.28206-3-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 Don't list userspace "cookie_uid_helper_example" object in list for bpf objects. 'always' target is used for listing bpf programs, but 'cookie_uid_helper_example.o' is a user space ELF file, and covered by rule `per_socket_stats_example`, so shouldn't be in 'always'. Let us remove `always += cookie_uid_helper_example.o`, which avoids breaking cross compilation due to mismatched includes. Acked-by: Andrii Nakryiko Signed-off-by: Ivan Khoronzhuk --- samples/bpf/Makefile | 1 - 1 file changed, 1 deletion(-) -- 2.17.1 diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile index 4f61725b1d86..045fa43842e6 100644 --- a/samples/bpf/Makefile +++ b/samples/bpf/Makefile @@ -145,7 +145,6 @@ always += sampleip_kern.o always += lwt_len_hist_kern.o always += xdp_tx_iptunnel_kern.o always += test_map_in_map_kern.o -always += cookie_uid_helper_example.o always += tcp_synrto_kern.o always += tcp_rwnd_kern.o always += tcp_bufs_kern.o 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 From patchwork Fri Oct 11 00:28:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 175889 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp41613ill; Thu, 10 Oct 2019 17:28:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqyweXn8wNeNboqDTaGQvaiBA7kstBJoP1H4dZvcCzyoAaTGpPM7tyzaYnOiow4jOpWu/9J7 X-Received: by 2002:a50:d794:: with SMTP id w20mr10992594edi.258.1570753723146; Thu, 10 Oct 2019 17:28:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570753723; cv=none; d=google.com; s=arc-20160816; b=GLBh64a1HwbNk8jaUV50IsVCSLrUgkELor4r1BBgXNGBNeDvDTgzVxmqQD3RYV6gfP 4DmK0IUe6DXcnt7zQNXcBrj7yD9ft78juYb7U6hkNit/Icw0Dfx2DJz2hE7VpVN3U3yG uf6gC/MITxE5Lw6b/cu9p2REq+qSFvlvsj2g9qJ8jRQNxmQP2eOhWkKNxwE35yQ9PIlZ nizwTT3sSlD+/x0UMtD9om5lFuT9ZO9sVaas26q1qzQZ5P9rJgOyePzX2Gi3glsTTdQC WKGUlvFk1SkORNeWF0IhpOhrmj5mUrza0oGGLE4IegayKcmZL66RL5m2ur6DvCH98LW4 hSIw== 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=dPicZ6dKiXggVDaTmZsHbexmmGF0NBX0XkLCl2NE9e8=; b=Rtn3XjesvZjxPSOfivM80NI3OEXjJucIAqE82x0F/wukjoosVyBkAFFd+N+F8JwwHU qiW35XgLBZzBGpkqtEC/5f8G8/bIKK/NGBYYfh+QRWqUvQS76cKiJEgQ00aqD2UO+3Co OMcUOlTUnva0KKl4O7xvtftkNsMlAFnp6f5R2vhKL9rioFkCjp32uUpIBzyv2cnr0RQh qdghbAs0p4QCOCT14tORL7Dag763+EiHtVDnmROhWecdyFV1sjG62S8m/D98iiqXPMKZ WPM2XWaf1yn+1t6mrzuC6xAks3nXVa0rBw9gIHAUE9sFpq1dgOgmcBrEvk0UssZ0sidz pA7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=t3MFZlp7; 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 y50si4737688edd.237.2019.10.10.17.28.42; Thu, 10 Oct 2019 17:28:43 -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=t3MFZlp7; 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 S1727743AbfJKA2m (ORCPT + 8 others); Thu, 10 Oct 2019 20:28:42 -0400 Received: from mail-lf1-f66.google.com ([209.85.167.66]:45460 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727768AbfJKA2l (ORCPT ); Thu, 10 Oct 2019 20:28:41 -0400 Received: by mail-lf1-f66.google.com with SMTP id r134so5712277lff.12 for ; Thu, 10 Oct 2019 17:28:37 -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=dPicZ6dKiXggVDaTmZsHbexmmGF0NBX0XkLCl2NE9e8=; b=t3MFZlp7JrKOCwmfn7u1hOiMi68CPBBmhejF5DP7FCApB0OUHnL1e1Vz0PnjgoLIqj wAkQ0GsgS4/ldLyAt8/zw9mgK+sFqHd4lVWktvbzEARep/C0sshXBBKSEaDAGcVo0/6V 8BTYD9LaGz/q/C5QeVOsLb/AKAwgJehXdhpIyM/J8HjfAaW5Btm4K7VJtZpNYWUEfCbY V7wShmtXIoIbmuXnBXoESSkwV7otaZ4ffWiRKF6rodq/UYfP4y6E9PWlD7sMelgEXZIG kjdyeC45fhvQOlabnZHkFElf7V9BeT+hBH7v0X8MgAM1mpO27+xgEXiqHAKtawGnSvK1 yzqw== 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=dPicZ6dKiXggVDaTmZsHbexmmGF0NBX0XkLCl2NE9e8=; b=GUqcOArrsRW9Gf1UKhKEvvtL4kDD/GA1t2xg0rAlCIIWLKHGC65H5aoWMXxGY9QG0/ wQhNfV3Tyzuh1hHJOkaCl4TN0NdEDfBKDfrHoiMGzhP71plMctruBJxYzo529vmI0+vk eNA8enN+71hhqk1I9UmX0ZFKVT0m2rKAK8UjcMKSnvRwPyHlVHNqkfQ/9ls/KzJ6Y/BF PRkIDkXepVCC9l4zn/Q6bC2X1cz8YKYVvV9ST7M4a2O6kf09i5F2tvGDfR9rFP9GPXzx g23O9Qjm8bA7xy71F6ZOP7+49kNOtKvz/zzKjKZ6mfp/tb8vb7j4vpUO9vXFdrjHUiE5 VRSw== X-Gm-Message-State: APjAAAXpuMOKjiI1Pzp/jZslRkhHEd+dcPmbSY/F1nK6usjL9ym8TgPZ G3QV+Aa4MoTtHQEe5dR6KSc/Pg== X-Received: by 2002:a19:c392:: with SMTP id t140mr7564752lff.156.1570753717149; Thu, 10 Oct 2019 17:28:37 -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.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Oct 2019 17:28:36 -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 12/15] libbpf: add C/LDFLAGS to libbpf.so and test_libpf targets Date: Fri, 11 Oct 2019 03:28:05 +0300 Message-Id: <20191011002808.28206-13-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 In case of C/LDFLAGS there is no way to pass them correctly to build command, for instance when --sysroot is used or external libraries are used, like -lelf, wich can be absent in toolchain. This can be used for samples/bpf cross-compiling allowing to get elf lib from sysroot. Signed-off-by: Ivan Khoronzhuk --- tools/lib/bpf/Makefile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) -- 2.17.1 diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile index 46280b5ad48d..75b538577c17 100644 --- a/tools/lib/bpf/Makefile +++ b/tools/lib/bpf/Makefile @@ -174,8 +174,9 @@ bpf_helper_defs.h: $(srctree)/include/uapi/linux/bpf.h $(OUTPUT)libbpf.so: $(OUTPUT)libbpf.so.$(LIBBPF_VERSION) $(OUTPUT)libbpf.so.$(LIBBPF_VERSION): $(BPF_IN) - $(QUIET_LINK)$(CC) --shared -Wl,-soname,libbpf.so.$(LIBBPF_MAJOR_VERSION) \ - -Wl,--version-script=$(VERSION_SCRIPT) $^ -lelf -o $@ + $(QUIET_LINK)$(CC) $(LDFLAGS) \ + --shared -Wl,-soname,libbpf.so.$(LIBBPF_MAJOR_VERSION) \ + -Wl,--version-script=$(VERSION_SCRIPT) $^ -lelf -o $@ @ln -sf $(@F) $(OUTPUT)libbpf.so @ln -sf $(@F) $(OUTPUT)libbpf.so.$(LIBBPF_MAJOR_VERSION) @@ -183,7 +184,7 @@ $(OUTPUT)libbpf.a: $(BPF_IN) $(QUIET_LINK)$(RM) $@; $(AR) rcs $@ $^ $(OUTPUT)test_libbpf: test_libbpf.c $(OUTPUT)libbpf.a - $(QUIET_LINK)$(CC) $(INCLUDES) $^ -lelf -o $@ + $(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) $(INCLUDES) $^ -lelf -o $@ $(OUTPUT)libbpf.pc: $(QUIET_GEN)sed -e "s|@PREFIX@|$(prefix)|" \ From patchwork Fri Oct 11 00:28:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 175890 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp41633ill; Thu, 10 Oct 2019 17:28:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqzPHbjPilkxfw0GluuqRN2NWM+6E9bxvDBP5aqKaS0UAQpRIKdWtWBguNgnKewMN4WeS31d X-Received: by 2002:a17:906:9aa:: with SMTP id q10mr10603781eje.93.1570753724213; Thu, 10 Oct 2019 17:28:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570753724; cv=none; d=google.com; s=arc-20160816; b=ymUb6Ff4RoEPP1yE6sT842L/JYJ1XoIQQYu757hjybIXC2wJFkfsF5gQZY3iNtBrx8 sot90BCBbHnfAMUzpo7PAECYL88Vtn0I2iULpzsLHaRzbNcZxgOQ4GN9ZhHrHSTWsKAu 5kVTTKj9YsfgtiQOndV7z6uhfBYPP0PFY6Yx9BMySst+8ZoItBhJxEvPsLa7R51Ro4f9 M53dSIdwP6yQ3UtDTUaR8jhukthUqJBMdxcLvEQDuxxEkZ1+zz/6Y+y5/D7cNBuuswFU uUhCBuDPyqYizQ5jfDYNEJBnrK53HGpo2VLgVINPB3ukeym32QvPffCQOTLT5cWexQiU ikGw== 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=LjUmR6syFZQTjTX+EMH7Sbgc4CwkKZT5NTkS4TQtAUc=; b=l7DWKa2EdBFktC7yYOiYXAZ/RZFLoxQmqi3oi1lRnCaKRvf40XmQyNlknfgosqXohq QJi3tGpgrARwg7ShB/5ycKpQdG3PaB87nacduq4An8MK4zyvZfspi5RwY8PuPMHxN1k+ QuWYh3h1fDfgcSQKWrR33vBXuRgwTI8A76h2SUlxyWwxnGmMuAUNEBw4fsZRmUDiE6gk yUSoDB3aClc0BZ9FSXrmzLw7bDLP4Orjz7V6hI5770AsjW6q3+bzrLSvUUK+6+l6s7FR 45uy79csARGncJjc/rtZLRXFAOSKdWZWAGA3MZ8oiyJOp225Sl/Wj10llaD5otWbLEp7 OGXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mnI2QbGC; 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 y50si4737688edd.237.2019.10.10.17.28.44; Thu, 10 Oct 2019 17:28:44 -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=mnI2QbGC; 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 S1727828AbfJKA2n (ORCPT + 8 others); Thu, 10 Oct 2019 20:28:43 -0400 Received: from mail-lj1-f194.google.com ([209.85.208.194]:33578 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727787AbfJKA2l (ORCPT ); Thu, 10 Oct 2019 20:28:41 -0400 Received: by mail-lj1-f194.google.com with SMTP id a22so8065865ljd.0 for ; Thu, 10 Oct 2019 17:28:39 -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=LjUmR6syFZQTjTX+EMH7Sbgc4CwkKZT5NTkS4TQtAUc=; b=mnI2QbGCo1NRiFTjyOBIqf6KabxlSsnPI4hdGenxjeIyJTkSXKVt+0hJS0M5neXKLA QBHDyXER/DRHnVa4ubnHrlLClZtvLAtNYFdgQF3rb4NcU4bmKJ0Lz2Ufxthc/b0bJ1+Z kW4AWWBQ2OqryumuH+jEK+ydtLRpiEzBtnHnm7tZaq6+hU/ItTonq/Y3xqyD177deZTS bDH08drSrEruU6qymWOgxylscRznlSk57CIdPAwhHWK3wTFu0VdkWrvR+s6lEse6B5Go 1vh0iAFOmgwbO1zArtb6aL2WFaJ1aR6YdgCcd9ExuDq4DEQiXiJOktqlD/av3XyosuSO f42Q== 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=LjUmR6syFZQTjTX+EMH7Sbgc4CwkKZT5NTkS4TQtAUc=; b=b5i4GoSgEBX9aGUauLjwLQpkbpI1kYaw5yBwBOVUH3Hjdr4UvudvaGqgZpSrZT4AN0 5uZSZ+vBEEMFprxd7cDOEml4tzY2vCk4Aq4eA0p43NbnMd9Ivvxtw0QP2TjT87lWpAGw OCi48TfRNbhQTCYPETD8C+QEHvjzV3ABdOIyxPNiBhNqs41JirwYJAWKEa0C/RSCLOsP H1PHUZCtoQ+6WxBug4o2lvQAMioeq5Ut9qm/zWZ/mOS3i0T+1fBD5SX5TUxvkuj2SL4w qmc5R4nZo80dg+VZPZoTJALvqrdRacuPMQ8H/QdZF0eEZw44C0Zt8SPdy8jidxLzVmha D6dA== X-Gm-Message-State: APjAAAXPqseCUqS2XlXEkzBw3myiyHb9jm7oHqSNiN1hu1+zqAk62spI I4F1L8MJ4q6ioCmmGFzQ7BjCqg== X-Received: by 2002:a2e:9cc9:: with SMTP id g9mr7896959ljj.160.1570753718464; Thu, 10 Oct 2019 17:28:38 -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.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Oct 2019 17:28:37 -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 13/15] samples/bpf: provide C/LDFLAGS to libbpf Date: Fri, 11 Oct 2019 03:28:06 +0300 Message-Id: <20191011002808.28206-14-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 In order to build lib using C/LD flags of target arch, provide them to libbpf make. Signed-off-by: Ivan Khoronzhuk --- samples/bpf/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.17.1 diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile index a6c33496e8ca..6b161326ac67 100644 --- a/samples/bpf/Makefile +++ b/samples/bpf/Makefile @@ -248,7 +248,8 @@ clean: $(LIBBPF): FORCE # Fix up variables inherited from Kbuild that tools/ build system won't like - $(MAKE) -C $(dir $@) RM='rm -rf' LDFLAGS= srctree=$(BPF_SAMPLES_PATH)/../../ O= + $(MAKE) -C $(dir $@) RM='rm -rf' EXTRA_CFLAGS="$(TPROGS_CFLAGS)" \ + LDFLAGS=$(TPROGS_LDFLAGS) srctree=$(BPF_SAMPLES_PATH)/../../ O= $(obj)/syscall_nrs.h: $(obj)/syscall_nrs.s FORCE $(call filechk,offsets,__SYSCALL_NRS_H__) From patchwork Fri Oct 11 00:28:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 175891 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp41651ill; Thu, 10 Oct 2019 17:28:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqwTgccLcxkKvkHvH+AF3u3L8URAql3ub9i/bX8AOVDlLTCVKw5tnJUzhr3qr80jGEdKVqVd X-Received: by 2002:a50:ed84:: with SMTP id h4mr10616621edr.124.1570753725482; Thu, 10 Oct 2019 17:28:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570753725; cv=none; d=google.com; s=arc-20160816; b=QdXWc64EYSHBPq6XIPA3sUJDSA2zXi3h+cpvZnQxkjjMrtZ3701JKWgjVXKoPz1x4/ RcucG1u8B506OIF0ypSgH3IRBXcIhPomleBoxl2GfkNSngzNS37GwxC8RtWCWt+iz9Hn E/9D9qg34rWzEYsjldxoKvC6veBtI5BQTO5wN9udWt9Se5/h8FJWzd+SzAlcR/wkXqIN WmgaXjDOvAVt5+YGoFyHbXIqrvyVOb3emoeQMCxA3f4Uh11uRvbvjWsJ/YVs7DLrfqQO os+eQlL5gPz2tjDs54GPsDVK0K6AgOJtvGO21K0wTrUCz2v+bSvBKBXBBD6RYI9qXXJX H3SQ== 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=ZSbYJ+tLtfDuMSVqb7LwJbRD3u314/MfD3p1keHf2Mw=; b=OpS2tV5f+v/wVr6CecLyi4YwlMHhoFQLfseJXn0bZ0Dl95+LAEDscotvY5w+LKUnKI +UHdmRnto2GnrV/6eR2sQCerjwqltIptq8yjcoe7fyXYYpV+8I2E6ibhlYHvkEJCPElw YGibDjE7WJ2a0HyMr8xUtw33naxV2o7KIi6PmTyeIFCW6dm9iW1ZrY+QHXhtr4pNt6qi he+Ob421DWjHozq0j6Nxl8zY3BEbulYgqcT+0gC4atyDaoB+uzXHehyTKyXhpmRLhNlz HHBR+pUKeRpcnNXXeiru97pW5eytG14ylGkVvpw6AT/mdk/31puJgLOdyGCqJRpQ7AuW sFzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YEWRAAeP; 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 y50si4737688edd.237.2019.10.10.17.28.45; Thu, 10 Oct 2019 17:28:45 -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=YEWRAAeP; 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 S1727833AbfJKA2o (ORCPT + 8 others); Thu, 10 Oct 2019 20:28:44 -0400 Received: from mail-lf1-f68.google.com ([209.85.167.68]:42486 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727810AbfJKA2n (ORCPT ); Thu, 10 Oct 2019 20:28:43 -0400 Received: by mail-lf1-f68.google.com with SMTP id c195so5710143lfg.9 for ; Thu, 10 Oct 2019 17:28:40 -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=ZSbYJ+tLtfDuMSVqb7LwJbRD3u314/MfD3p1keHf2Mw=; b=YEWRAAeP4o9HHLefGfaSlerG740LF6GtTrZy66djivNZSPXT2LBKGX5D/yhlmqrqM+ L34Z9JhgWajti0FN3n8kYiabDXezUUK4PqM1gd8sR+MKr0ChD9NupqJwZmQTj7twHTdF dHgGXTZ2cHg7b/c8pXz6c8Enr6iA/I+lnsC3C+lrCF+LHqDLQy7x2dRHtJsVOrbqDS3j daeTThbrpUYNT9YcwYABSYd1h1z/INp//Dh+VQW26ASB/eSFZvjaRl4W3m3yBL3cMnJp udb+u8gkI9g3tPg+Jv5fVOQHAUlMKfUTubwdRuExHcN3URxlHoKGRLzwD696KoEF6F1M 4HBg== 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=ZSbYJ+tLtfDuMSVqb7LwJbRD3u314/MfD3p1keHf2Mw=; b=a/I22XVOK+UZ88CTDn1FLz7XPoHzLAZwHly9diqHlcMCCI6R8r7VxlNASZdHK2EMR9 cQyO4bmhRGSb6cyQrM8fumjKj94xx11Xn52sNqJmVsqbQBsZkvWxpY6UcPQVS4eeGkw6 LZPs3jlKy/rcCfmoH/xCYYeTB2Mkn1VP6ZXH5TrYq1qTp/T/oH/Np2Lju4FBaxpwZWBJ 3GLV8iD7VSwJ1LVXnATShWs/xY+lmsEoOgCp0OL6n9qWOTHJdVVAvcQiJRAj+o/V1h8K 4QdXFjsowsHbffdDklOXLYBvPVM78K+LphE3SVBSUIHXpX9aKTlKmwzpL4sv0CMB0/Kh TxOg== X-Gm-Message-State: APjAAAV+3/TpbAm5N+MFC8soFsnHlTeSOmn81f4ROwmlWlkdPRqiDeya SgPkNv86luX7LmvqoA++TrMQvw== X-Received: by 2002:ac2:5468:: with SMTP id e8mr7357520lfn.12.1570753719752; Thu, 10 Oct 2019 17:28:39 -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.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Oct 2019 17:28:39 -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 14/15] samples/bpf: add sysroot support Date: Fri, 11 Oct 2019 03:28:07 +0300 Message-Id: <20191011002808.28206-15-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 Basically it only enables that was added by previous couple fixes. Sysroot contains correct libs installed and its headers. Useful when working with NFC or virtual machine. Usage example: clean (on demand) make ARCH=arm -C samples/bpf clean make ARCH=arm -C tools clean make ARCH=arm clean configure and install headers: make ARCH=arm defconfig make ARCH=arm headers_install build samples/bpf: make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- samples/bpf/ \ SYSROOT="path/to/sysroot" Signed-off-by: Ivan Khoronzhuk --- samples/bpf/Makefile | 5 +++++ 1 file changed, 5 insertions(+) -- 2.17.1 diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile index 6b161326ac67..4df11ddb9c75 100644 --- a/samples/bpf/Makefile +++ b/samples/bpf/Makefile @@ -187,6 +187,11 @@ TPROGS_CFLAGS += -I$(srctree)/tools/lib/ TPROGS_CFLAGS += -I$(srctree)/tools/include TPROGS_CFLAGS += -I$(srctree)/tools/perf +ifdef SYSROOT +TPROGS_CFLAGS += --sysroot=$(SYSROOT) +TPROGS_LDFLAGS := -L$(SYSROOT)/usr/lib +endif + TPROGCFLAGS_bpf_load.o += -Wno-unused-variable TPROGS_LDLIBS += $(LIBBPF) -lelf From patchwork Fri Oct 11 00:28:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 175892 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp41677ill; Thu, 10 Oct 2019 17:28:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqyEnPLgALV0n+xiZegAEhzWrkIAtv4I4qjdvOOqu2MehWDaEmktFwFdQKzl020G8auCCwDY X-Received: by 2002:a17:906:f847:: with SMTP id ks7mr10993015ejb.213.1570753727769; Thu, 10 Oct 2019 17:28:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570753727; cv=none; d=google.com; s=arc-20160816; b=ZP/I1GDaaBxcKLy3VqfW04I8qFAghjoRmZKxmDsxCjT6LWJ8ZiyEertKVDmqkUqGrM ej2lOodqTODn3sFhWQcMted65KhQGSS/pKJUvWTKTnzpqFN3dO3zQWfEmicqYs4jXiro ATpH2XjeRoFCLmXbGI2yJWEyfilM0xRo8vd8RmW3YXuvngtklQslqAuFHxzOZJvNAk0t jipftLzu4S9muLwkcvfHVgT/ecS694Xn/6wNDouyOQKgl6I8A/0X7pe/su4jeHwoAIVB byhnqUTUtLWJPx2ifMd7QBgU5fGj9G9eeETv3ZyGGOwezFMqMc5gqJRXdT5oyn/uXXhv vkIA== 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=pOlOkzzU0bwqDGQkGWa87uAZFQ6B6XzFeEn3c66o8lU=; b=qjMuQ/cvlkZcjcVV8cn02IhjxrggRNSRGlWqLsw3j5HLfPpCPU88L4ooh+ybDLFR2d Nw/40GE0IZ9sLDxK1MpthhE9t2ZggAsGGxHC4rrfuXyc1T6UTO7fj3wWChSMUnlyctKX 7MkUhefkBW68tuiQdpwkYY0xACxewCOgGjAwx2raBkLeKZdnI+ZkAfZnMmLKjtPZwmy6 2axaWcCsfggsl+ypcG9zWgdPQ8Snavs1WWdlZ368YARvo38PqcPRQxmqldosSSwmvcXX L0T0pMYLL21jwlWkE/aw8qpbMsQBq2r85/YL8McgPoMFV0ganEkE0eBnQJi91ch4m0lr q1CQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QHN9i8uk; 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 y50si4737688edd.237.2019.10.10.17.28.47; Thu, 10 Oct 2019 17:28:47 -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=QHN9i8uk; 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 S1727848AbfJKA2q (ORCPT + 8 others); Thu, 10 Oct 2019 20:28:46 -0400 Received: from mail-lj1-f193.google.com ([209.85.208.193]:39035 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727823AbfJKA2o (ORCPT ); Thu, 10 Oct 2019 20:28:44 -0400 Received: by mail-lj1-f193.google.com with SMTP id y3so8029970ljj.6 for ; Thu, 10 Oct 2019 17:28:41 -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=pOlOkzzU0bwqDGQkGWa87uAZFQ6B6XzFeEn3c66o8lU=; b=QHN9i8ukUhuJBaTW1UkwsHCf7J5j7HE4qIMcwKRdrirpcaAonzp03YiEqPSRwe3zx/ xA0MoKbGih4p4DFXZwDwFBVobJyP2faVBo7sSRFrH+xMkpC/PIjgjau5tDOW+sFmwLwz g1hsnFO0QNDJkY3FkwUuMwhUKVchwkKKVMSTy0IBQDH2rghXK2Kb+YMjb+e9v4KFDu0l 5++1qegXGXuL7utw193IWXAe67LN2wicnj/KIR+LUI+F5L2i9Y7eBDqDrS+Yn4GQu+Dy 0MUQU2rjtqKV6psnZKCzGon4ksn3ln70MKD8EGIAdfYhyEuOTccCJajTz1HJ7wxhCkN3 Ez7w== 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=pOlOkzzU0bwqDGQkGWa87uAZFQ6B6XzFeEn3c66o8lU=; b=ezL/qn+jDwqP/qpYAGv8IJxxrFM3v7k3D+msPpBbGKk+ZkJan0st+RnGPeE30yVk/D We7HIm00FaxudN+y+dGKsaqtsHYjVOyz8A6RjWMzucY9dZDqKS7c60269ZyV6NnHyc1x bV8xOA3gpq2sSWHo67teQN3UL+3mgaksWmeIQhqMvf9h90Sac+krgNqUlteqk70Ze9C9 iv/2K6AlVzFC8Se50DUVzmFq2ML8K65J8paONJyDfI6Qv3UyJ7Bf+5w0XGtPhWQoUeCG Z2gyr2W3BJbHU/F6Pe7UZMcEZ/NS+vYaJeK3pYbpGU2OFH4p0jBZYwSJGl5E67D0X8aQ VTeA== X-Gm-Message-State: APjAAAVpWZT1gbcHJDTuN3Zm06HcYS71fqICWMz9ut94lFxJDFrcGRbn nL8WFvscpf0yDZ5oVK9R+oWvoQ== X-Received: by 2002:a2e:a0ca:: with SMTP id f10mr7479171ljm.83.1570753721062; Thu, 10 Oct 2019 17:28:41 -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.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Oct 2019 17:28:40 -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 15/15] samples/bpf: add preparation steps and sysroot info to readme Date: Fri, 11 Oct 2019 03:28:08 +0300 Message-Id: <20191011002808.28206-16-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 Add couple preparation steps: clean and configuration. Also add newly added sysroot support info to cross-compile section. Signed-off-by: Ivan Khoronzhuk --- samples/bpf/README.rst | 41 ++++++++++++++++++++++++++++++++++++----- 1 file changed, 36 insertions(+), 5 deletions(-) -- 2.17.1 diff --git a/samples/bpf/README.rst b/samples/bpf/README.rst index 5f27e4faca50..cc1f00a1ee06 100644 --- a/samples/bpf/README.rst +++ b/samples/bpf/README.rst @@ -14,6 +14,20 @@ Compiling requires having installed: Note that LLVM's tool 'llc' must support target 'bpf', list version and supported targets with command: ``llc --version`` +Clean and configuration +----------------------- + +It can be needed to clean tools, samples or kernel before trying new arch or +after some changes (on demand):: + + make -C tools clean + make -C samples/bpf clean + make clean + +Configure kernel, defconfig for instance:: + + make defconfig + Kernel headers -------------- @@ -68,9 +82,26 @@ It is also possible to point make to the newly compiled 'llc' or Cross compiling samples ----------------------- In order to cross-compile, say for arm64 targets, export CROSS_COMPILE and ARCH -environment variables before calling make. This will direct make to build -samples for the cross target. +environment variables before calling make. But do this before clean, +cofiguration and header install steps described above. This will direct make to +build samples for the cross target:: + + export ARCH=arm64 + export CROSS_COMPILE="aarch64-linux-gnu-" + +Headers can be also installed on RFS of target board if need to keep them in +sync (not necessarily and it creates a local "usr/include" directory also):: + + make INSTALL_HDR_PATH=~/some_sysroot/usr headers_install + +Pointing LLC and CLANG is not necessarily if it's installed on HOST and have +in its targets appropriate arm64 arch (usually it has several arches). +Build samples:: + + make samples/bpf/ + +Or build samples with SYSROOT if some header or library is absent in toolchain, +say libelf, providing address to file system containing headers and libs, +can be RFS of target board:: -export ARCH=arm64 -export CROSS_COMPILE="aarch64-linux-gnu-" -make samples/bpf/ LLC=~/git/llvm/build/bin/llc CLANG=~/git/llvm/build/bin/clang + make samples/bpf/ SYSROOT=~/some_sysroot