From patchwork Wed Oct 9 20:41:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 175680 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp1263951ill; Wed, 9 Oct 2019 13:41:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqwjWV8ftqIhJbSQZoSurINIdxIRDhM/9rKyIFBvrWxsh6wVjNnqd9EYOjhWl6ga1apvcvdW X-Received: by 2002:a17:906:c4a:: with SMTP id t10mr4762553ejf.290.1570653707494; Wed, 09 Oct 2019 13:41:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570653707; cv=none; d=google.com; s=arc-20160816; b=V1U5u+rRnmyE6ny4eJNCOnWvnFpkYXOJzMBE+Pinds6HSrYN6LzV3ALALM0cHRvxPX o6XVV/A10a3Cx0N0vePsTO4mXhzAc3ulcrr/2LyaSy5qE9kh/ZG6S1IrDWekrBBImQ7d N6kgdD4DuOEx7NnSbXl/PkkkJJKO4HIALLf6ZtbyVVZKQPaMzcLzP+FPBNIX6zMj/eXr aVEDMZZFAFoJ5xBzWLCHZ38v/CS+Y3lWy9a6/XO/OfGq6rsXlDfkzdq5MBWOhL2rUvFz tCgEgESKIV33gqfkN8/AqqLkfcrH8p/iLUrjYkAFADxdgzkD/eOFebFggDsJBhJ7RVs5 8b2g== 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=2DEOdiE8/KIZvnfCC36ibwWDO7fSHTP8+q9sblSZNeo=; b=wvS4LiTN9EPxjVlb+RgGkXs15Hh+tMxUKYRtu+Eqnex1XWweB9Cl2bnEEOWIcPvM7H ldnUsAEmUNME9RYYBGmyUBUuhkMwhpRQQ4ySluNJFieGBPOirpE+cEvJ6x9+CjoaDA43 v1At22aNAxbSdKZ7GYnK7pRjc8bwWf/u5/9xTikIVOaUb3qaXBsCdLVh1fzROPX0oLuG 6CvX+FK1JPkX9qjbdfAy+aGDIdBxhUJy7X+D8dTOvFByaKg7qAMuNOka4XvkblMNMnEz igExzeiAz9sjMgzg80dN3cEUmgcIWy13AdvuUN7ZbTZ0ily7ehGO+m889KO/AxT/UfK4 Nnig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="wpG/4/be"; 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 l23si1802319ejr.296.2019.10.09.13.41.47; Wed, 09 Oct 2019 13:41:47 -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="wpG/4/be"; 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 S1731947AbfJIUln (ORCPT + 26 others); Wed, 9 Oct 2019 16:41:43 -0400 Received: from mail-lj1-f196.google.com ([209.85.208.196]:40758 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731763AbfJIUln (ORCPT ); Wed, 9 Oct 2019 16:41:43 -0400 Received: by mail-lj1-f196.google.com with SMTP id 7so3868291ljw.7 for ; Wed, 09 Oct 2019 13:41: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=2DEOdiE8/KIZvnfCC36ibwWDO7fSHTP8+q9sblSZNeo=; b=wpG/4/be0Dkrcg2e3d2Y6P+Upb+QU97CDfnDDCAn0RZufZUtdAx4AGsbcIMxg82aDO hw0WOfvamsi/rNt1zNO5fb14dk0jx3eyiTZFvuTkb0d9KpIqNcCWRxb46uHn5Qil4BlD q6vA7R/HM5QpM2awInIHF3ZgnYuF8dILcbK676IpP36a7RSZLIpipstVdglbWxnYbUD/ /JNFNNkTlXTtk9xHGsIqLXwztiHgyArDwz2jGOpFIVC8hw+R8sN7gXdyvC8M9qowpQ6A 9Z2k0uxxen5TorR1/0SCZlZ2ku4Exm6NIObX4s/A/Zaq3jcK8MtfnX3qBOM/6QSXGZ4O nmEQ== 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=2DEOdiE8/KIZvnfCC36ibwWDO7fSHTP8+q9sblSZNeo=; b=LYhyNU1+YenQQDQC4wh99RWjNOTqtMGGLOFLokK5PxAwJfTncYtnoImVRPCBmcOrUY G0BGgVu7gevd8fvx0glq9/R5Sw8ql/pXlktoDrO6DXpupsldwJfj7LITfn52KFKkj4oy stdXOI3Lts725MOCaCehgI6OA0EvyZLvjpkn78srQ3UEikFVyvkepIHkuaIhNctR4E1Q UcwVcUZil/r1zbApUdq93tVElsPezmiZwrBCTeyBptuFQNJZwFXesiOsEatjWa6IKZpv bGKontH/EQ7HQLjmin5fnm8ZF4eoZmxxSTnAejld5ysHt/8vdtzkv7/KtpEuxzoJPlo7 oSlw== X-Gm-Message-State: APjAAAVHt+nPqPrRESMgiSuPAv/FNJDZu/zBTS49XSeTnr/z6xiLySzB G23gHA9K8lnP4ONhMeu4xmPgUg== X-Received: by 2002:a2e:286:: with SMTP id y6mr3679786lje.184.1570653701016; Wed, 09 Oct 2019 13:41:41 -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.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Oct 2019 13:41: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 v4 bpf-next 01/15] samples/bpf: fix HDR_PROBE "echo" Date: Wed, 9 Oct 2019 23:41:20 +0300 Message-Id: <20191009204134.26960-2-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 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. Signed-off-by: Ivan Khoronzhuk --- samples/bpf/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.17.1 Acked-by: Andrii Nakryiko 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 Wed Oct 9 20:41:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 175694 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp1265127ill; Wed, 9 Oct 2019 13:43:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqy5ZHwp8IYleUE8bN6Ui8sLZqnCEWZdkvoUPp2RSAbVPFO8niJJslZ3Emc4Z/dLfVqqHaxf X-Received: by 2002:a17:906:3009:: with SMTP id 9mr4833394ejz.124.1570653782521; Wed, 09 Oct 2019 13:43:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570653782; cv=none; d=google.com; s=arc-20160816; b=StO1AAwX5atimA3XmaIlFooRta6OCQpPXQXjCFkNN53KCsJmq0gvItRjnbD6oXVvkC H9FDXCL1qZ26swSofD3fZiMkkkqdNjbS2KG10fI8sDv61hQW/JlcOpg8rpOG5tZqacQ+ kvH6sR9pd946zQ82vBQSTAAuBuVXo+heGVmEUyf1KeK3bygtpk3blAQ1RPlRDs02oiBA PH4ZYYPTTRVyEike98jKjFmHGE+A67zC3G9y+jyV3XqwWy9IBTaqEAGToXiWP/gIOxxm uXCf5feCL1quo68K01w1F1ABBhnrtWHfIyN7AcLLGRwUzhRIjzaHw5PdSgtW3gGYQsii zHug== 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=KuWqxLmC8R+dekKx5FIImtJPYIZ2P+4zBcv+UVWUoryNEkHB7OZ+aWm1zHd0OiwN78 ycB2OAqdUI7Oe7kWgjbW4sq76QiWnY+CQMBAXXrtRclT+lCh5zzOTjEiKnStZObd81t7 vRXyGedczX9AVRRi09fDjFdQJP8VdduyvcnmqftTGSNBXtAMSHB3CV5CTmG5UWdjtdtC ZFWu3D4Kkky/uF4EdI4Uam+3Gk2y31N6u/2N2HnsTorS54RIK9Sfw6y0y82NfMcpmAQ0 xbivbnrpR0Er5M4vP3m0X3D/WecPwq6V7yogkhm2LhY6cZochUQ8ucHK4AKmin+idr3F Iafg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=b82CPx+f; 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.43.02; Wed, 09 Oct 2019 13:43:02 -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=b82CPx+f; 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 S1732362AbfJIUnB (ORCPT + 26 others); Wed, 9 Oct 2019 16:43:01 -0400 Received: from mail-lj1-f180.google.com ([209.85.208.180]:34767 "EHLO mail-lj1-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731884AbfJIUlo (ORCPT ); Wed, 9 Oct 2019 16:41:44 -0400 Received: by mail-lj1-f180.google.com with SMTP id j19so3921592lja.1 for ; Wed, 09 Oct 2019 13:41:43 -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=b82CPx+fPly56w9MPycjqjk9NJFrcqTUC+lMTY5z15BMRw4pELbH/XPZ+RJefWuxPY Ve+lIxc6pQd+2yDHo9zcMjT2RLJUqoXNChE9oUJ1xBcEkkjBJsESNa9GWmIK6Li9Rbkw 2gsZITjElYlpNfxDj0t7SIHmbzIKhfrXgQQ0eutD4pIHkl55qf+nSBf/bZYmQNvZSkgO bLliGWmkU+bpjvxPedusjcxCZqk6Z8tNN3fiXpA9lu1SC9hixLlHu7am+/BzaOY0OlQc nx3uyOZj9pepIabNtCEHnzksYGri285CEa6jAL/ZaogaUkfB9TcjD1KrdFRk5hVdInNL Q7yg== 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=Qb6DyYxqfqK14IPhvXt19tahb9ijPNOd1QNnA8Gi8NZ73wwpHDUHl7pGoAqnJjZ9zc JfXKQyIJMJ7Zzdgiz2C3CMwwNHqQ00etJSRmyyMayaGtQ6nWcJmTX4XIzOK9DqsNrv5h LF0Vu/WA35XTClyYHHoB0jwuV75JGHtYc7yaTzb1W5SgiPRhe2b21c7nsNXRSlyVmqm/ f588BbuYvGbnQojNyJ/Vea3BwyH8g9f6W/S6P47F+mvCucMUNNL9nBQWQ+kX4+jgYUL8 HPBk/XQXljRSlDlt3uYqVUCgk9gemoxxVqyFSaf3XX6Eq8H9Pu890tu3aZCxS7J7+M7T pEXw== X-Gm-Message-State: APjAAAXeiDDAt30Kkhbo0Bk+x2dAtrp73cBnLcEuRrc/wIPIid6Di5Hj 0FrqNECI9LFToOi2k6eA3OYYYg== X-Received: by 2002:a2e:7e05:: with SMTP id z5mr3623227ljc.120.1570653702474; Wed, 09 Oct 2019 13:41:42 -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.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Oct 2019 13:41:41 -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 02/15] samples/bpf: fix cookie_uid_helper_example obj build Date: Wed, 9 Oct 2019 23:41:21 +0300 Message-Id: <20191009204134.26960-3-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 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 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 From patchwork Wed Oct 9 20:41:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 175683 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp1264129ill; Wed, 9 Oct 2019 13:41:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqyzg+WbBoledOQ35Vc/C3270yXMPf37GPVwlvzBtEMh0rOFz3F7If840K/KhoPclVXQqHBn X-Received: by 2002:a05:6402:7d2:: with SMTP id u18mr4936105edy.23.1570653718885; Wed, 09 Oct 2019 13:41:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570653718; cv=none; d=google.com; s=arc-20160816; b=I8FwRIqW1F9NuaCXPnBEToEK9JCTUVI5Kac4v8iyLou/0KzpLL4hputWnoo9TxEGMp y3rDbmAsV2o37wgAhUcr3feh11vFR2AomSChc7E/ALvQk1b12xB6cQA0ibCfp3ZEoyq+ 8/R3cTygVSD80sCQcKfpMvpNdDGkhuO0/8aZzsNeD4xp80BOHRfgaOC7iD1S12SHomZ9 ifA0gtUNn580qAelHK9Q6N4GadoukT9YPEuOQkS4BCqELGqJhZC1rZVqwdXypYU1uchh Csa+KIXPEntFTgxck9WoDVAoIUMHkkEUnj9MZ5V1m6XDd7cu6wmI0aCODxn6RrMgvg5j N79g== 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=ZXAfjdX+WvsCZ4Putv4iaBG542bdy+GxK4sst7rF5S0=; b=NwMxpijOhx/QG5oFt2FHy8o6HbylXikbuQYC1mLEoWEE250knKvl/7seh2bhg0VQMz RBP6Yem6/YkrbDVzLRkmGPeptliN0/ml4uCz8JIEGRhLAgfjouZuzVdrv6ZucBYI5NFC 5A4codCyI0hfTO6cYJ72RKEOvHexcaK8Jkn3jgDZEBuh/dIdG3i+aE+aegkP3GXPvCQ/ gxodjatapQBHiqNbX9DHI8odXBUvdnoWfVfnB04ifnWWygGUesyk1nYo1JUgD7dEjebS EQD/oXBSguTBz6Xut5nrLfrCgajcgjnMTKeyqGBXAGa32CcT0xv9tU8o9VoaR7vbDrrS b2HA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qkf+hcum; 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 i33si2126486eda.205.2019.10.09.13.41.58; Wed, 09 Oct 2019 13:41:58 -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=qkf+hcum; 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 S1732057AbfJIUlz (ORCPT + 26 others); Wed, 9 Oct 2019 16:41:55 -0400 Received: from mail-lj1-f173.google.com ([209.85.208.173]:41397 "EHLO mail-lj1-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732018AbfJIUlt (ORCPT ); Wed, 9 Oct 2019 16:41:49 -0400 Received: by mail-lj1-f173.google.com with SMTP id f5so3865227ljg.8 for ; Wed, 09 Oct 2019 13:41:48 -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=ZXAfjdX+WvsCZ4Putv4iaBG542bdy+GxK4sst7rF5S0=; b=qkf+hcumHsQI6T6Bbst2NXrX6p/4qw3OeD4CpV1jU/++8iHkhW3cMYtNH9mREMkDZY dw0k847/GZ3RsBrIo6fLNuSBl+IS3TYL5uYngPA39KkRaREOxcb7fn1Lm8U6nxkyVzpp kKHLIGY97UeNipi308i0NGdVLMg6MXgyvQFiWlqCpjL61Pk2JwLpqqKnCIr76E8QFXcx IIO4JkEUcrZxZ2lYIBVT9plAKyNyRif7shOotjWAv8xJ5mPhfMT+HN9YA5uN/dcMnf6o S/Nk38iowj23/tgkQKaz6riDTwBDoyPL2cpRnWLh++wojn81jeid5itZbrGgJocTdlw/ 9LFw== 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=ZXAfjdX+WvsCZ4Putv4iaBG542bdy+GxK4sst7rF5S0=; b=rZ8mwtGCXcj3dnqc7s3uYhDxjdzJ4QQ15fHvfnWwIxYmB94q55jCSJA/XmhwZmpB5q wxF0wIXZmGj58SdH+XI04gdn19HWfRC8dWSBsDJeYSIuW1CffRnrPSDqDVjXJD1fCJb+ 9deQJpFJCQj+Nb/AKmO8Lbn3UMajhtoGrUTnBfQqVyjh3doYgYdc2rd2BAztSpSLgECX DipqyVUSEp3EFweRoPfICRMT+iB3uPt2SCq2mHiELIuK2LdwhEAycPYPBs4uvoFAgyuj k1Om1G05QYgq9ArEYvIN1+TQ6fJ8aMNJRznCONgROk+IrshEewcIgGTKenEoO2tBICFH bB9g== X-Gm-Message-State: APjAAAV7F+40XiBDIumsm8B2mwR1Tf+Wz7rhDpFk5pbmeUc+XaJvKgVP MwuyFTp5Vb0QHcUbylH0vIswyg== X-Received: by 2002:a2e:89c9:: with SMTP id c9mr3470319ljk.108.1570653707934; Wed, 09 Oct 2019 13:41:47 -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.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Oct 2019 13:41:47 -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 06/15] samples/bpf: drop unnecessarily inclusion for bpf_load Date: Wed, 9 Oct 2019 23:41:25 +0300 Message-Id: <20191009204134.26960-7-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 Drop inclusion for bpf_load -I$(objtree)/usr/include as it is included for all objects anyway, with above line: KBUILD_HOSTCFLAGS += -I$(objtree)/usr/include 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 9b33e7395eac..bb2d976e824e 100644 --- a/samples/bpf/Makefile +++ b/samples/bpf/Makefile @@ -176,7 +176,7 @@ KBUILD_HOSTCFLAGS += -I$(srctree)/tools/testing/selftests/bpf/ KBUILD_HOSTCFLAGS += -I$(srctree)/tools/lib/ -I$(srctree)/tools/include KBUILD_HOSTCFLAGS += -I$(srctree)/tools/perf -HOSTCFLAGS_bpf_load.o += -I$(objtree)/usr/include -Wno-unused-variable +HOSTCFLAGS_bpf_load.o += -Wno-unused-variable KBUILD_HOSTLDLIBS += $(LIBBPF) -lelf HOSTLDLIBS_tracex4 += -lrt From patchwork Wed Oct 9 20:41:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 175692 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp1264786ill; Wed, 9 Oct 2019 13:42:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqyX7Fr4IxHpSNTOdFzUJeR1Qd+oKzQ+8e7wS5XJRQaIkE1PtkhgOuL/qyKimHlku6vhHjog X-Received: by 2002:a05:6402:1a3b:: with SMTP id be27mr4731855edb.210.1570653758814; Wed, 09 Oct 2019 13:42:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570653758; cv=none; d=google.com; s=arc-20160816; b=iJISK0T2jUxV7fpMP7xHN8f/xn7f/Xn6CKirf/46QyQEX2Q6lhUs2+C9Q3fnIM4BcN SOI/LxGHjvB+tzX+XEQE8mAMcUjWE9skywsUCuxyxldN3rQaBr9FIRwo2gV9O7mE7YJQ pqqeFgNCdlK7/BC60e7p9j/NqTP4IePB3sQJ/hUv3pUAfJLLy9fxPlhhnPzkLc5SYOQv d1jWfx/VF/fseUZNSrUilpKkUCkeRI+IomDYcAQwR7imjUvnBenvV8P8Br49WD/fBX1/ eJjad0kA0zkxTL+C9/1IlE+6afcda5k3IUPLuqVua6JxXgyBa8sv+0gKmBbJIbiwVpHH jVLQ== 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=IxUitNmcKfvxEmpW+0pRzzeuEr0YPZuYrEHpJHWrZps=; b=sTlwqGOte5jOCqaKvAWLudGtRquDSFFkXgsYCWu2Fqet6rrNkWNNKQH1jfNEE1bycs FRrJkf7p4SLa3LY6n+SK125y2RenjD4nOgTbL5SPOTi4Onv6kVW7cy4ZcBPFU2oBb5Fg jzDSv5cOF6Z7NmEaO2FY8G1AUc5saXdG8m+g1uJxWAYIpQNTJuy8kYIyqQ0oGthChavO 8YadEyApw/qLv0J/agfScaQLOSsnEYMM9f8kWzdjtfV3OXQK0RCBrKl98oSi1G6V6Gux NfrxWVhuNzLJyay3Nd2xkHtARsOFG2tI/ymL7nyzvdCHyT4wVISnc60itBuirZj7KwE1 VHpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XxRSaB97; 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.38; Wed, 09 Oct 2019 13:42:38 -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=XxRSaB97; 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 S1732074AbfJIUlx (ORCPT + 26 others); Wed, 9 Oct 2019 16:41:53 -0400 Received: from mail-lf1-f68.google.com ([209.85.167.68]:46253 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732022AbfJIUlv (ORCPT ); Wed, 9 Oct 2019 16:41:51 -0400 Received: by mail-lf1-f68.google.com with SMTP id t8so2644897lfc.13 for ; Wed, 09 Oct 2019 13:41:50 -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=IxUitNmcKfvxEmpW+0pRzzeuEr0YPZuYrEHpJHWrZps=; b=XxRSaB971je38Es3NqDcLIfWZ1SCl8b5y1RGBQkjALcmSilmdWzH/Kb1XtER9g9xAe tOgqSTmQN8XpR7qv45/xk6j20FCWQKNAdIFvbw23IrvQLXHKwW58SBhBd3JedzFIpqGy NL75xI4Zizg+d+SX26HNbQmruSEqEegbgy9LZFLNH57wqZB6ovhYTKgQkV1GSnLIIbQ4 MMWwNYwY28emh7+BzrPpKGzJnaFXvszJd/iG1dXyH/vPFtN/aW1L4Gy/JFVNU0G/7UDQ G1arT3UmKydusR++V6E8KQ07yCF6/fmNELFaXUoxSlWPxN7w0JY2Ly+pJcaOMg/YZ/Hp NVwg== 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=IxUitNmcKfvxEmpW+0pRzzeuEr0YPZuYrEHpJHWrZps=; b=lqfJ71ePnQVPqDUUnfa3F4niL+WoT//KZ9tSwVoT8irF+n5c6WdwfT19zp7dNW/0tV AIAhxUHOw46Px598AeV5UGmuXZUqZscNLmQV87K7Cvjp5+V8NT4e9ntTwg98Hp8kvFGx MlEfGykc9DZ9xxOQ0Q4C8UdmCevt5spKKrrmYcfB6aYwc8jeW5kVY+Eqk7m0Ut1Qh5v9 Um0NfgdtABNEb7SHpZhbE89FX9IKRI+bhT+u/Np549RU2wuDv5lPf33N4RJW66EAm7ik PYiVXeI0Dk5IeRquKPaepa2+nLc8QZ8b/rjBCA9PqT8gY2cufOOBkrNFgABAEuqsypsX C5Pw== X-Gm-Message-State: APjAAAXRSkvzORrk1gI8XXDOCR/j358gxu9yxzcZ9nWewbLeyXXXdhy0 jsoQlhe247jpqj9lUfe65Ft3cA== X-Received: by 2002:a19:4352:: with SMTP id m18mr3247695lfj.27.1570653709288; Wed, 09 Oct 2019 13:41:49 -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.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Oct 2019 13:41:48 -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 07/15] samples/bpf: add makefile.target for separate CC target build Date: Wed, 9 Oct 2019 23:41:26 +0300 Message-Id: <20191009204134.26960-8-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 The Makefile.target is added only and will be used in sample/bpf/Makefile later in order to switch cross-compiling to CC from HOSTCC environment. The HOSTCC is supposed to build binaries and tools running on the host afterwards, in order to simplify build or so, like "fixdep" or else. In case of cross compiling "fixdep" is executed on host when the rest samples should run on target arch. In order to build binaries for target arch with CC and tools running on host with HOSTCC, lets add Makefile.target for simplicity, having definition and routines similar to ones, used in script/Makefile.host. This allows later add cross-compilation to samples/bpf with minimum changes. The tprog stands for target programs built with CC. Makefile.target contains only stuff needed for samples/bpf, potentially can be reused later and now needed only for unblocking tricky samples/bpf cross compilation. Signed-off-by: Ivan Khoronzhuk --- samples/bpf/Makefile.target | 75 +++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 samples/bpf/Makefile.target -- 2.17.1 diff --git a/samples/bpf/Makefile.target b/samples/bpf/Makefile.target new file mode 100644 index 000000000000..7621f55e2947 --- /dev/null +++ b/samples/bpf/Makefile.target @@ -0,0 +1,75 @@ +# SPDX-License-Identifier: GPL-2.0 +# ========================================================================== +# Building binaries on the host system +# Binaries are not used during the compilation of the kernel, and intended +# to be build for target board, target board can be host of course. Added to +# build binaries to run not on host system. +# +# Sample syntax +# tprogs-y := xsk_example +# Will compile xsk_example.c and create an executable named xsk_example +# +# tprogs-y := xdpsock +# xdpsock-objs := xdpsock_1.o xdpsock_2.o +# Will compile xdpsock_1.c and xdpsock_2.c, and then link the executable +# xdpsock, based on xdpsock_1.o and xdpsock_2.o +# +# Derived from scripts/Makefile.host +# +__tprogs := $(sort $(tprogs-y)) + +# C code +# Executables compiled from a single .c file +tprog-csingle := $(foreach m,$(__tprogs), \ + $(if $($(m)-objs),,$(m))) + +# C executables linked based on several .o files +tprog-cmulti := $(foreach m,$(__tprogs),\ + $(if $($(m)-objs),$(m))) + +# Object (.o) files compiled from .c files +tprog-cobjs := $(sort $(foreach m,$(__tprogs),$($(m)-objs))) + +tprog-csingle := $(addprefix $(obj)/,$(tprog-csingle)) +tprog-cmulti := $(addprefix $(obj)/,$(tprog-cmulti)) +tprog-cobjs := $(addprefix $(obj)/,$(tprog-cobjs)) + +##### +# Handle options to gcc. Support building with separate output directory + +_tprogc_flags = $(TPROGS_CFLAGS) \ + $(TPROGCFLAGS_$(basetarget).o) + +# $(objtree)/$(obj) for including generated headers from checkin source files +ifeq ($(KBUILD_EXTMOD),) +ifdef building_out_of_srctree +_tprogc_flags += -I $(objtree)/$(obj) +endif +endif + +tprogc_flags = -Wp,-MD,$(depfile) $(_tprogc_flags) + +# Create executable from a single .c file +# tprog-csingle -> Executable +quiet_cmd_tprog-csingle = CC $@ + cmd_tprog-csingle = $(CC) $(tprogc_flags) $(TPROGS_LDFLAGS) -o $@ $< \ + $(TPROGS_LDLIBS) $(TPROGLDLIBS_$(@F)) +$(tprog-csingle): $(obj)/%: $(src)/%.c FORCE + $(call if_changed_dep,tprog-csingle) + +# Link an executable based on list of .o files, all plain c +# tprog-cmulti -> executable +quiet_cmd_tprog-cmulti = LD $@ + cmd_tprog-cmulti = $(CC) $(tprogc_flags) $(TPROGS_LDFLAGS) -o $@ \ + $(addprefix $(obj)/,$($(@F)-objs)) \ + $(TPROGS_LDLIBS) $(TPROGLDLIBS_$(@F)) +$(tprog-cmulti): $(tprog-cobjs) FORCE + $(call if_changed,tprog-cmulti) +$(call multi_depend, $(tprog-cmulti), , -objs) + +# Create .o file from a single .c file +# tprog-cobjs -> .o +quiet_cmd_tprog-cobjs = CC $@ + cmd_tprog-cobjs = $(CC) $(tprogc_flags) -c -o $@ $< +$(tprog-cobjs): $(obj)/%.o: $(src)/%.c FORCE + $(call if_changed_dep,tprog-cobjs) From patchwork Wed Oct 9 20:41:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 175684 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp1264149ill; Wed, 9 Oct 2019 13:41:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqw9KB0dTaxMmnMeXLG47zXnebu9ZTqsLH6p/cUHTfgkAbQgMO50xG/kjhh6OlTyFVkLTTFp X-Received: by 2002:a05:6402:6c6:: with SMTP id n6mr4878293edy.292.1570653719290; Wed, 09 Oct 2019 13:41:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570653719; cv=none; d=google.com; s=arc-20160816; b=wOBGQbkEi00tglTHO2drP59he+KaLSOh7U6OTVitISkYKsZz2F+/kZhjvjKlEnvuky 8qZ4hegBASOcQVSo2OC4ZMlTgV9xBqGk6z7lqqq7SCrpgJNehDuqJbVEfyDKHPIm1zhR 7wseMqnv1dOghMVf9n3E1G6V1yuIAydOQ7DWupWOviXVu9M2xSWvzKQpxsDtLgIC1AB0 HEL16dNgJ9yRJGhl2EvoSK0T9YZvfslXhVN6aBAD5viwziDLIC7BskAcd3H+orVh6hYc AfNgRZgl8xjg7j/uY1WSNfNGWKwAtZ7yRhY5ZyFE/1ELuo2Whu9w+yu4f5CTGSGWuKCQ 5OwA== 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=OsXgBugq9yBTYp2TWj7gghCrTtBB47X9YeLV9E3YhNo=; b=Rsu0KuVmZlDWnR2gxjydrXYOpLDxvAg2C77/a5YhowcpxQxCu0Q/SRHb5msxvN2RcM R8x7CZygOp8SubrowuvSyPq/iOA1uJsS7yCdTWHDdDSXZvESdrNaj5cGX74rdNcrnYL0 ievWaX5aBhowQmF75lVyHOFxXW54rNLy+hwLX2mSLkuM/hwanisw70ZG8qEJzU1gcYXf fmhixXp4bhSpyV4fMUvdTRVbF2nih8iL70QihDc5iKgfFhcOmaZoYOdvf693MVdkP5hW AJQsF+UEzwcS6Kjzs16MxpCmZW0m7Uz7KIX7kGZX3BUFV43axMPYXmn3iqDp+QeNvpqA 18sA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XKt173H8; 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 i33si2126486eda.205.2019.10.09.13.41.59; Wed, 09 Oct 2019 13:41:59 -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=XKt173H8; 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 S1732127AbfJIUl4 (ORCPT + 26 others); Wed, 9 Oct 2019 16:41:56 -0400 Received: from mail-lj1-f195.google.com ([209.85.208.195]:38747 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732056AbfJIUly (ORCPT ); Wed, 9 Oct 2019 16:41:54 -0400 Received: by mail-lj1-f195.google.com with SMTP id b20so3880560ljj.5 for ; Wed, 09 Oct 2019 13:41:52 -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=OsXgBugq9yBTYp2TWj7gghCrTtBB47X9YeLV9E3YhNo=; b=XKt173H8wj8IKIt4DSevJv+kXD2QtQYilXS8zfwcM9SF+6OorOJJ3SmvoU7IACx3N5 ZD4/UL/3p86LvvBJV/yGSkWEyRdtqTpfMBJxpHO+ck6akQ2JdmFtBmoy7w3Ci0j5MNfD 7iatnjl5O8In1S22aDEa0gNv47xnsUTG4FhY67C5Wp4Yde6cgVue2NsEVNcETOtarJDt PE5ipS2g0wOPpz4f84UV0CtrbwKOFXWdySlA/CO/sr6CDtBjDHIjVYO8596kQW+ndpi1 XOrbcWeIxekD8aI7aComYtS7I2L5V6w7+5MYsOTBISOvFA2UYk/Xr5Y4IpEQMDDqn4ym q65w== 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=OsXgBugq9yBTYp2TWj7gghCrTtBB47X9YeLV9E3YhNo=; b=omnRr5soxJIauJzipNQVVdETn/ngq6Qk9CEwpr3PXh80mhR/eCHeNKRRJSEQOklZNS 7tBAJdEWhA0MKINuIohEF/sY+Bg/GrqxtC81cpWDujmAbEgv791DajZsMz1gcHofUnK2 aJrbL55wG6GMEJDP6D/0pwrPmf0pcMP9/Z80A2VPreJSHQz3BXXxnS+TIjsIAJ+7qmhs IVFOybyKJv7MOXvchbg3MXe0MeNnhhDnVYJDrnj3ARQv3mGSuGrXDzB+1BFfa4eHNXl0 8nLUU6Vua3kNQkEF0VNhfzyu3KtR++1htLSAwf6+PvcVUVCSvSzG9kp58TfUJM0MfOuo Cu5g== X-Gm-Message-State: APjAAAX5OGoqjIFjMASuQ+Lnnnf3cvVPBU1cl+Inh8g+Yhvh79YQlPR+ OZ8EObD6vGLQeN/9mRWavKKrpg== X-Received: by 2002:a2e:9958:: with SMTP id r24mr3544709ljj.61.1570653712166; Wed, 09 Oct 2019 13:41:52 -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.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Oct 2019 13:41:51 -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 09/15] samples/bpf: use own flags but not HOSTCFLAGS Date: Wed, 9 Oct 2019 23:41:28 +0300 Message-Id: <20191009204134.26960-10-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 While compiling natively, the host's cflags and ldflags are equal to ones used from HOSTCFLAGS and HOSTLDFLAGS. When cross compiling it should have own, used for target arch. While verification, for arm, arm64 and x86_64 the following flags were used always: -Wall -O2 -fomit-frame-pointer -Wmissing-prototypes -Wstrict-prototypes So, add them as they were verified and used before adding Makefile.target and lets omit "-fomit-frame-pointer" as were proposed while review, as no sense in such optimization for samples. Signed-off-by: Ivan Khoronzhuk --- samples/bpf/Makefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) -- 2.17.1 diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile index 91bfb421c278..57a15ff938a6 100644 --- a/samples/bpf/Makefile +++ b/samples/bpf/Makefile @@ -176,8 +176,10 @@ BPF_EXTRA_CFLAGS := $(ARM_ARCH_SELECTOR) TPROGS_CFLAGS += $(ARM_ARCH_SELECTOR) endif -TPROGS_LDLIBS := $(KBUILD_HOSTLDLIBS) -TPROGS_CFLAGS += $(KBUILD_HOSTCFLAGS) $(HOST_EXTRACFLAGS) +TPROGS_CFLAGS += -Wall -O2 +TPROGS_CFLAGS += -Wmissing-prototypes +TPROGS_CFLAGS += -Wstrict-prototypes + TPROGS_CFLAGS += -I$(objtree)/usr/include TPROGS_CFLAGS += -I$(srctree)/tools/lib/bpf/ TPROGS_CFLAGS += -I$(srctree)/tools/testing/selftests/bpf/ From patchwork Wed Oct 9 20:41:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 175686 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp1264204ill; Wed, 9 Oct 2019 13:42:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqxNSxrb78DoneWtnxB0wyb55/zYT5Q7rUmvs4liuuyOawb6MVK3hcFh08pxSREcEQOKLx5V X-Received: by 2002:a17:906:b6c6:: with SMTP id ec6mr4779641ejb.54.1570653723506; Wed, 09 Oct 2019 13:42:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570653723; cv=none; d=google.com; s=arc-20160816; b=h2pq7U7247ZJCCVC2As83jvnu1JrHB7dWyPBYZ4KUqpm8SqEowUr5JqCT1kplR90Gt Z9D9c3tMfGzrdLSBH/7vl8Tu8KcRfZ4ZvxfKZWUvZ2Xjvx+pm8ZV5Nk4bwzrLuhlTLmd B5uTspVKzrFAzauP8IpaBRqleRn3D2eTHtezof9gE4bt7KNcclbMr2TdyJdIm3RRo2rh juQM+Jaig1xIPkFPL5uw3JlA9R/l7G9jT4eN23lr+HWq2uLnrZQzMJ1qu/93SkHV7ZXH 9eZxi3iLw3L3deNwWdUl23hNguBb+YsaqGc0FF/PJTjQ3fckDyVIkhdsm/uvhaAVRGyC 5Xjg== 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=TqVgt5uW0tXMG2sk40opbI2NrMbssP1O1eKE+O8MvT0=; b=UzqXdPv07ysk8NN5lrr+ryKJukORjODSL58ej/iAMhbX7RgUTqB9jVxdJio8l/0Wok JmZQD09WR/MqKmUUxWitA3JKzHo1VaT9g1V/qFknZCrF832jxQKoeQ+oqI57pr5lqu3p Kut4WXkTrNBP3g7INi+Bom7xIhKsmfQcaUUR+jQ3a06vqbaSvDRaQ/is0l7Gsil+kQa7 wM0YDi2rOeaGkEqVhTt9UXnUmyGcSVYzKwchLDL3V5mN9bLpfwXNPlO/SnchOcMFq+lQ rQAZTDjcw2FtE3l6XU1vUGZ2BM5gF7IfQUxdzcB+9fdy7N6lqCg/S8lXfT4qxvmOfnyh Mw/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=m4lZEO5Q; 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 f2si1867068ejq.395.2019.10.09.13.42.03; Wed, 09 Oct 2019 13:42:03 -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=m4lZEO5Q; 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 S1732176AbfJIUmA (ORCPT + 26 others); Wed, 9 Oct 2019 16:42:00 -0400 Received: from mail-lj1-f196.google.com ([209.85.208.196]:35917 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732129AbfJIUl6 (ORCPT ); Wed, 9 Oct 2019 16:41:58 -0400 Received: by mail-lj1-f196.google.com with SMTP id v24so3899554ljj.3 for ; Wed, 09 Oct 2019 13:41:55 -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=TqVgt5uW0tXMG2sk40opbI2NrMbssP1O1eKE+O8MvT0=; b=m4lZEO5QxxgG0iUAh/n+7T8cEuXB06R4+fN1LAS+noEfh1S4La6fqeY8VrdjGCu5f4 U/qCnidh2zdlC6coi3ZrToWntpnvr5s6lpt3ui4ab1TMOADlVqk3BX9lrD2+GjinwK8V 0V84OwDiyquZcuK/m9FXYotQi79M+8eI+v33LDt9xvHL2BmaDxxZAgAo60H/CUu/cWWP egL5pHebN+dzhMoFix7N4ankAWi/3ynKyfw5QZFj8UQcc36OAm1BS7AnE571Tr8qla8O Dcvx2oaL4d1d1JvyGJe7k36iJvmvSMzlEgd9u+tR3GMXcqKBabLBN2Uh8YJynQZdnFmv XfUQ== 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=TqVgt5uW0tXMG2sk40opbI2NrMbssP1O1eKE+O8MvT0=; b=qEnt+/lNg/jHfkW8ZOK0fkoAjSY2LdzOJtEZQNZ8a8N8BsrPsCXIUiGBzm67AngV46 9YBEvzIhbHx1Gm1NA8b2AKQaIJcHM1KeNWqVja6B38UhV3uKNBxIMS7TPuuPTRCD4mau LakS1UDboUemMXTZQYmSLCh4Cx0IAjgMEQ4v938d0kltzwBV/wcy3BsnNAq1DUj0jlZj xD9dwxnTNYUrH79w4qJHS2tb7fV0CGMl4PMPuRzbrPrRv7w8lriI/HDllsNLg7QGC3Kv c5MO9X4V0aHDnVyBuyVdxfjI5pkBsWIsO6yfstiZ8zNaHf4rIgjjc/gE9uL5k09+QJYk QC+A== X-Gm-Message-State: APjAAAWsyV49K9WyLFDv0OgrVl6apUvWnIyqR6AnrwfYyxiGzHETuE0l M4m+nmcVkl9RYwf6Efb+FBNzGQ== X-Received: by 2002:a2e:964c:: with SMTP id z12mr3473099ljh.79.1570653714859; Wed, 09 Oct 2019 13:41:54 -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.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Oct 2019 13:41:54 -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 11/15] libbpf: don't use cxx to test_libpf target Date: Wed, 9 Oct 2019 23:41:30 +0300 Message-Id: <20191009204134.26960-12-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 No need to use C++ for test_libbpf target when libbpf is on C and it can be tested with C, after this change the CXXFLAGS in makefiles can be avoided, at least in bpf samples, when sysroot is used, passing same C/LDFLAGS as for lib. Add "return 0" in test_libbpf to void warn, but also remove spaces at start of the lines to keep same style and avoid warns while apply. Signed-off-by: Ivan Khoronzhuk --- tools/lib/bpf/Makefile | 18 +++++------------- .../lib/bpf/{test_libbpf.cpp => test_libbpf.c} | 14 ++++++++------ 2 files changed, 13 insertions(+), 19 deletions(-) rename tools/lib/bpf/{test_libbpf.cpp => test_libbpf.c} (61%) -- 2.17.1 diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile index 1270955e4845..46280b5ad48d 100644 --- a/tools/lib/bpf/Makefile +++ b/tools/lib/bpf/Makefile @@ -52,7 +52,7 @@ ifndef VERBOSE endif FEATURE_USER = .libbpf -FEATURE_TESTS = libelf libelf-mmap bpf reallocarray cxx +FEATURE_TESTS = libelf libelf-mmap bpf reallocarray FEATURE_DISPLAY = libelf bpf INCLUDES = -I. -I$(srctree)/tools/include -I$(srctree)/tools/arch/$(ARCH)/include/uapi -I$(srctree)/tools/include/uapi @@ -142,15 +142,7 @@ GLOBAL_SYM_COUNT = $(shell readelf -s --wide $(BPF_IN) | \ VERSIONED_SYM_COUNT = $(shell readelf -s --wide $(OUTPUT)libbpf.so | \ grep -Eo '[^ ]+@LIBBPF_' | cut -d@ -f1 | sort -u | wc -l) -CMD_TARGETS = $(LIB_TARGET) $(PC_FILE) - -CXX_TEST_TARGET = $(OUTPUT)test_libbpf - -ifeq ($(feature-cxx), 1) - CMD_TARGETS += $(CXX_TEST_TARGET) -endif - -TARGETS = $(CMD_TARGETS) +CMD_TARGETS = $(LIB_TARGET) $(PC_FILE) $(OUTPUT)test_libbpf all: fixdep $(Q)$(MAKE) all_cmd @@ -190,8 +182,8 @@ $(OUTPUT)libbpf.so.$(LIBBPF_VERSION): $(BPF_IN) $(OUTPUT)libbpf.a: $(BPF_IN) $(QUIET_LINK)$(RM) $@; $(AR) rcs $@ $^ -$(OUTPUT)test_libbpf: test_libbpf.cpp $(OUTPUT)libbpf.a - $(QUIET_LINK)$(CXX) $(INCLUDES) $^ -lelf -o $@ +$(OUTPUT)test_libbpf: test_libbpf.c $(OUTPUT)libbpf.a + $(QUIET_LINK)$(CC) $(INCLUDES) $^ -lelf -o $@ $(OUTPUT)libbpf.pc: $(QUIET_GEN)sed -e "s|@PREFIX@|$(prefix)|" \ @@ -266,7 +258,7 @@ config-clean: $(Q)$(MAKE) -C $(srctree)/tools/build/feature/ clean >/dev/null clean: - $(call QUIET_CLEAN, libbpf) $(RM) $(TARGETS) $(CXX_TEST_TARGET) \ + $(call QUIET_CLEAN, libbpf) $(RM) $(CMD_TARGETS) \ *.o *~ *.a *.so *.so.$(LIBBPF_MAJOR_VERSION) .*.d .*.cmd \ *.pc LIBBPF-CFLAGS bpf_helper_defs.h $(call QUIET_CLEAN, core-gen) $(RM) $(OUTPUT)FEATURE-DUMP.libbpf diff --git a/tools/lib/bpf/test_libbpf.cpp b/tools/lib/bpf/test_libbpf.c similarity index 61% rename from tools/lib/bpf/test_libbpf.cpp rename to tools/lib/bpf/test_libbpf.c index fc134873bb6d..f0eb2727b766 100644 --- a/tools/lib/bpf/test_libbpf.cpp +++ b/tools/lib/bpf/test_libbpf.c @@ -7,12 +7,14 @@ int main(int argc, char *argv[]) { - /* libbpf.h */ - libbpf_set_print(NULL); + /* libbpf.h */ + libbpf_set_print(NULL); - /* bpf.h */ - bpf_prog_get_fd_by_id(0); + /* bpf.h */ + bpf_prog_get_fd_by_id(0); - /* btf.h */ - btf__new(NULL, 0); + /* btf.h */ + btf__new(NULL, 0); + + return 0; } From patchwork Wed Oct 9 20:41:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 175690 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp1264543ill; Wed, 9 Oct 2019 13:42:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqwy+0L38AuVs8ESii5NuQlV35lHZAU+DQmOczPnCAPSFv4I1SNMzFQ9aCJY84VjIhEM05S9 X-Received: by 2002:aa7:c959:: with SMTP id h25mr4822846edt.216.1570653744588; Wed, 09 Oct 2019 13:42:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570653744; cv=none; d=google.com; s=arc-20160816; b=cIaF0eJwCp9+EeVNG05k1pMpuERyTKbVpsZWXjyj+BN0OX2aVNUUt/fTrrLR5V4I9+ k4WJQPwzV1ybbIni1W9wslos3c/tbRfeVo5KTpUGmsoMQgVuHmLuM5LuoqZFHxm6zv/e Mtx418R2a6SVoDIjQnHSihqmjKJkvJz4Qon41fRDT10fb3AK3cy9O/KVJJgSMZT7Mvkc Jhd+7G8ULmhY/vSqqO4ZEuq4i3qFHCYzpKa9ayYbAndrkj5h2YTAnWyFfhziKcAxrbaT 0YIKgerEcep7dNk+F429lIE7TyPmx270arH3rPx/WMZ6Y3Py2yValg3VMVqdPtvZGWGE KkjA== 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=kcUDFvboIGVs/lRvRrRam3W53rLoFEO7a7iif6dtTIig+QwmV5WODRzNSA9gBGnk3b wbrVzoO49ayyoO/NxOSu9TPMaqDgYUOxN9aVUY8ingkLr10MrGNtNLgW01mpJY5FegVr 0ojXR6nZAmoh7XvFX768qOXOZGTva6ynFi0oCPbQWeu/iFBgu4WPc4kf5bJTtHLCixSl Bie6/Dhs35NcuKgWqcfJpbkdFRXSTL/xYhQArjKTxbNSnpCU34gqkYaQPKTRd44ODv4h lJehK2a5Kvn5WV75fi8om1ppEvbBsAMtPKfmAhBl0GthmdsQaaZneEL2qUMlgn68/WaP m+BA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kPel8NhR; 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 y2si1809263ejw.308.2019.10.09.13.42.24; Wed, 09 Oct 2019 13:42:24 -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=kPel8NhR; 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 S1732255AbfJIUmU (ORCPT + 26 others); Wed, 9 Oct 2019 16:42:20 -0400 Received: from mail-lj1-f195.google.com ([209.85.208.195]:33098 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732136AbfJIUl7 (ORCPT ); Wed, 9 Oct 2019 16:41:59 -0400 Received: by mail-lj1-f195.google.com with SMTP id a22so3917706ljd.0 for ; Wed, 09 Oct 2019 13:41:57 -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=kPel8NhRVnyQDF2w6QWADNKWtsbDrjQPr/EdHwNRDl4cLpDTWXyvgReDZ91tE3VFXh dXHtbNI4k24um1FnMS7LDF9GQriPKlXm2AfN93wb6AlJCjBcZ+1ovPI3gmCbHjz7YiUG VTdR6WGa4vqentsck08qtxZzbc8hvVkqXMbD3LMwWWynxWghejtOT4tGdHljpAs/7Ago p43hmGYeoMy4u8J0oJUns/wP/+M+48aW9ccDLPcj4/rU/oCy+pYw5NM9CgumGq3C6Bar V0Sd3jBn0QjysTdCA5u0gfWo6eZSg9xv2soEhRb0SroRn5shjSsYspO+3Hs+E+nHixXg 0/3A== 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=DGNyFy86tymfxMH7Fn0dj8x55v8mqhshHZTHDfmh+2FCbgSw3r2e9J2WCX0go9PkP+ DIBIrn6xCpUAh+3QwOx3ZCr6EZpAaoT61sJJkhJtmhUoa1ERwGAtaboA+A5UVF2KvrEj TuuL4/iYETBiipJOxMEQXtqu2zvU2TsKJSWgre0gGp7eYRXob0YM3vnoTa3EG1xEUY/S /RsdBeLlBY4r8Sy58DoilkXa8+D/aDP6GmECkNZaGBVt0q1yPb0hTWZ1fzg4VpUMvIsd P3Fh/yu+oQ5ElLKFnEZvw8AuRbNUPj1QR7oEMafqbRrnZLoeZhLaWu9wVZdpt2tpu6BQ bU7Q== X-Gm-Message-State: APjAAAXii1k/Nj4G29sGlDBgwDXBmWCiLmUQ3vo82253dtUbgUOEdwxY pJQlHXvsQXeJokjnOaUTLSvjPQ== X-Received: by 2002:a2e:2943:: with SMTP id u64mr3622095lje.241.1570653716268; Wed, 09 Oct 2019 13:41:56 -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.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Oct 2019 13:41:55 -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 12/15] libbpf: add C/LDFLAGS to libbpf.so and test_libpf targets Date: Wed, 9 Oct 2019 23:41:31 +0300 Message-Id: <20191009204134.26960-13-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 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 Wed Oct 9 20:41:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 175689 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp1264357ill; Wed, 9 Oct 2019 13:42:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqwaOrZTqo9YdTPfNJq2kMTzCXRmLYXxSEcg2DdRMZhXlrLri9Q0SAD79sOfN1hVOmjv1efb X-Received: by 2002:a05:6402:1652:: with SMTP id s18mr4827592edx.241.1570653733169; Wed, 09 Oct 2019 13:42:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570653733; cv=none; d=google.com; s=arc-20160816; b=LGE/nQkbSbtbHE9sj5pOig8Rf1iCyyU2qR4TPoP81ngJ/FFE87LFFMOFrd4evpEiMw jijw8ae5IKI1zMpG+2zIKVUniBjd4PpnV6WI+OreZJPVhh5R4pNNmFD2RiPFCuCaHNy1 eR1PIr650LbhywLQIgxQpQFj3bG1EOxuPtdLU6uKqe7/JlQZCfFMXKh+svthKKKCqUn4 Zw1LS2MxvWp0KOL6rFfjBzlu+3rpl+yBIeOytSiNP2P4B/opZQKAEHMou7P5rY7pQOXa oGR7fDG7bvBmNjCO/CGHDMMv/TrZKyGYQMxvoGOj26VNNIIX5+0gB3yQbGghQa8wezmi KCbg== 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=JLnuxyShTZs2a3oaZ8EsrKFtLSgcu1cqvMIQyThqoB1IiQoxc35m9EG34iqhQF4VW6 lQrYrQ1Oj0eR8OLXpkuEe5e3FcE8RpolibRQH1kKJwc6fCx9TO3g+xBO28xRoJJow9Ug IbxDMLCxuffb8dp62PkDl0VSLiUw/uYEzDSKVNT+8JW0pdBBEogGMl/2hdPP9YOLm7/z I4V7kLvMbdqBua2FSMrNaLlftCoNSREKSrJ8mb4dZD53ntPAx5ppaQf63Vh/6tYYKFO/ ra/G06qTOlo9U1w6buw1Wla1ULoX7koNuI81pHgLFVrBd3+JYWOymlA7/4T8nu5rjDaj ONag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="sam0/KZS"; 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 u3si1813535edy.48.2019.10.09.13.42.12; Wed, 09 Oct 2019 13:42:13 -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="sam0/KZS"; 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 S1732213AbfJIUmE (ORCPT + 26 others); Wed, 9 Oct 2019 16:42:04 -0400 Received: from mail-lf1-f66.google.com ([209.85.167.66]:33734 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732056AbfJIUmB (ORCPT ); Wed, 9 Oct 2019 16:42:01 -0400 Received: by mail-lf1-f66.google.com with SMTP id y127so2690163lfc.0 for ; Wed, 09 Oct 2019 13:41:58 -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=sam0/KZSTXmUo2WdsnqCOUMLoQL0oTggZsrHu5xImVNB4DQszXP4VtC6SBAq/YaCj6 oZ6V+aleXgxEQmYw17nYVsNTLotnMYHMksl+zIUhW7TUugybC0sScWu16ACFEgW5U9BW bTsDyycFa5HCBVNQ0giJ0kfWtl1HZaXU8oiQDCSEMB6AgOb1dV8Xe5A5es+7vUne7ONT 3RMXkAbwjp4xqCDZdeuo5KlRB7t5rARVOS7kuZsRRb9z+bWzkHKkRrTmAX+GjNH3JYJQ y74rRnMCpbmdDtq0gOFuyPg1ZHyMwXzwpOOsQUK/gT2ou23MHlRIiL9fnkgBq1xxhYjL KQgg== 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=Kk6n/9SZq50UIbaMmyw9AZoD0E61cQ8uwlzuOY29KUhqemkDW/ty/RV1zQI3HHUrXe Qb4eN+JQTF3NnrLjKi9c2Du2douKtyWul9M8inWub0OLH44oX3hEOweVi3cHAByLvdxQ U1y++0PBzc6KKpNVsGkFe9tAGm5uQqN+K4Ppeuz0G2u4+vbmtONUzhrZCvTam/TvGQLh mXp3JTBCjdugiTzkuc6CztUii1gq+X797YBAR1Ez/J8THq1RpvMlbg3yYh833r+ixPss kET4buSDm0X9o94J9b/okOAWVDB+5x0sc48rlx/RWgOwy6v32kGYnPZn1174NWw78Dxw GlEg== X-Gm-Message-State: APjAAAVbsWBEmkEx3c73TaAbtuLeSAKCxU6GYLnoxwfbzdvN+hGtx5Fq CCe4p8jvIKMpCIAQEWSr8H6QEw== X-Received: by 2002:ac2:4904:: with SMTP id n4mr3170649lfi.179.1570653717613; Wed, 09 Oct 2019 13:41:57 -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.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Oct 2019 13:41:57 -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 13/15] samples/bpf: provide C/LDFLAGS to libbpf Date: Wed, 9 Oct 2019 23:41:32 +0300 Message-Id: <20191009204134.26960-14-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 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 Wed Oct 9 20:41:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 175688 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp1264339ill; Wed, 9 Oct 2019 13:42:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqwu8oyQ5ghLxzKUFj6TXS2QPQ3lUeSJSLN60YG+t9pUDeMkzXJ3z0mMnsFxWh7D1zYgz8A7 X-Received: by 2002:a17:906:1651:: with SMTP id n17mr4650716ejd.220.1570653731653; Wed, 09 Oct 2019 13:42:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570653731; cv=none; d=google.com; s=arc-20160816; b=NCkHddleU3pXPBGwVcLDC/A8LKYObcXnjeT8zvjDOVfbY0PvjFHi4tdDaJIO+p3L+T qzdx2JfeJkiQIl8Dbav2X0RNO4X4vtivHphIPEnCdwHORyFGqREE/tEKDCoEjw91BYw/ Z3JvUQbVdGTbU/NjSXM9svG0DVOLBMHneSC1e9e+0vkMiuBYhYECNrHrV5W4GXAB+YPd y3WBz4HFUBswPWOtHmphE3Np7KgrCRugcDA8wN/K6sUUIdYs+XVq0Pwt6fo80hMtfK3g vn6teMzdCvzl3YjoUKEaY0r5YSPC+UYlWoTamnLrxDjD2iIvSEgrUA2MP31wiyNoqec7 8V8Q== 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=ECSs+mjX4lDFe4jfV4JTbgbugRRkkd9F4zfelRgHKxE=; b=pnmiV/JKUCF3t4N3Dl1UvTzg5c5/SrLJga3pcnwQTtKYjib6oxX9M6+a21rl9MiC/N IKtAtb82BZv92lOEbBwklMzCncX/AY9uTkwyBmPqsD0zB9XxCEnyCD/Ure+k2sbEIfgD M54TkpJuR7DtF7WzdUGQ/8sna6NyUFIEbvdsGg2NCXLEe6eAb9jYcZGATJ94IcpzjqmS hHKwHqVkbKNo6EwMl1xcuFA1eWKHsHZNVyZuzlU60YI6Fq0p8cAo4KKNevQT8maTYGze alwl7za/zpZ4+ZI/EWeDTjXxd+zD+Fim/k8aRj0472bKFLy4nu0xHtnZy+tKefxiHwUR 0ZEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="gUjn/S2e"; 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 u3si1813535edy.48.2019.10.09.13.42.11; Wed, 09 Oct 2019 13:42:11 -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="gUjn/S2e"; 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 S1732241AbfJIUmH (ORCPT + 26 others); Wed, 9 Oct 2019 16:42:07 -0400 Received: from mail-lf1-f65.google.com ([209.85.167.65]:35255 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732170AbfJIUmD (ORCPT ); Wed, 9 Oct 2019 16:42:03 -0400 Received: by mail-lf1-f65.google.com with SMTP id w6so2685183lfl.2 for ; Wed, 09 Oct 2019 13:42:01 -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=ECSs+mjX4lDFe4jfV4JTbgbugRRkkd9F4zfelRgHKxE=; b=gUjn/S2efuOPXmg3rQVYqpqdFW0SwsiG98P30JRwuBNr6WxKw3KU9N6YZ+brp2Q7Rd yfWuTtm1rFWLipf/NFrIMqUZi4qgcP+w1Za6uCOhZZC5hfk1Ocy1Dq1gZnWHceFsFoOV 9qnp8T9CUpAj/ngzQcF64dHtvm0D5vxtMtGczAS+nruCR1F5UdNIjKIHnqsNXMuUyL7X K0QH97/eIi6y08cd85YikZx/iA7vIJqNUxY4yUr038zamFrjak8kxDXCndocS12+8DxD Wkkc7pgTqA7D3wWX2Tw4zrquutTsCaQZwnk0E0M4UyigdMPQ2UtbWvf/0YdkBRBagiOB LeIA== 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=ECSs+mjX4lDFe4jfV4JTbgbugRRkkd9F4zfelRgHKxE=; b=E9aLvI3ciTUwWs93MAVH6otTw080KQAofTmLypA9hjQxK5Q3r4+PbafPaoUe7ppSZJ cOZqJ/ITYmGH6kJiM651KW7rAEp0wranamtSjXlenhifgp8D4jnHUt3m05mLtH7eNCRw X7ex22FTyJXaKZVfmJgXeBtHbnTIoZ5dsmc8Elm1GJMyTKshGbjIdi7dmwuBsiTO9uR4 dr0h+eVinrEtOa/fGXGFk0+ERuIhfA/4rW8DIyGg2aNFWJBQJsb8w+0ImXGuIpYKLC2Y T9uSro4HYDuViOYR9Lr6R9DOg1iUSZYcQNDTGjWJ0eccD9hDD33Ye/yWxn9/Imv5yWXv FGhw== X-Gm-Message-State: APjAAAWk6zj0JGMngqr98XCve8Bi6DFu9JkRkBCxu9YpNOOAmj9R4gnR Uj3uoEIhl4lw+VBRZA6PQFP4aw== X-Received: by 2002:ac2:533c:: with SMTP id f28mr3247351lfh.77.1570653720287; Wed, 09 Oct 2019 13:42:00 -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.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Oct 2019 13:41:59 -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 15/15] samples/bpf: add preparation steps and sysroot info to readme Date: Wed, 9 Oct 2019 23:41:34 +0300 Message-Id: <20191009204134.26960-16-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 Add couple preparation steps: clean and configuration. Also add newly added sysroot support info to cross-compile section. --- 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