From patchwork Mon Sep 16 10:54:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 173830 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp3337956ilq; Mon, 16 Sep 2019 03:55:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqxN4FJlZa3p/4D0A/zxhSPoB8Q9iGJgcGxZNYakuda5IIGxU6Y6NE+5Kq5FWL+oxG6arvmG X-Received: by 2002:a05:6402:17aa:: with SMTP id j10mr60395769edy.222.1568631306546; Mon, 16 Sep 2019 03:55:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568631306; cv=none; d=google.com; s=arc-20160816; b=Uu253/tAIuY9wzc1g4+Qzik8BBKaJweWgbWJ6iEwMFFtCcm/9FKqil61+iniMCMsmS jemCwrKrbkZ51aXfBjba7R/4+PAeBMxxMgH6VYfDKBeZ6JgiDCvleUHY0DZeqhhXfM7R ziSVXlC96U+d5GgpJRRJNB4ksVEnZAfPkCs0nRYQLN+DHldP9qt9oQVwG9vTjM65ZDEG xCLFXyvoTAWxyv3KQm5f3ekq1G4dlSLlAkPbT8k0/ZLTVnoJgBk5WqWDm3h0UVSylFX/ uMNngDeJws5G043Q7RYcXq7FaWLnQRmaUBaAApzut9iQfrCXP5tGQmCAgMw10C9dfRgz 5lVA== 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=sLN8PEIzdXJ4vyRQJpg4LVfYYRixS2x0Ts7jhtzHOWM=; b=LUgSpqWmWMGbVNtTvqbTG4dGDXKEr0O8B1lwIke41vemh7bC6TuH6EbW+g0fvwE0j0 Qa2ZT1lLv2uAm3QNY8gjDtXQaS0l1mp8sxHyRkX6sJO943ThUztMk5eX4jseRQ+riUDh 8iHtKXcotkDzm73EYCb9c56JEJv34JrC5x4xeg+0yX3rs7SB5YSvijhBbk97f1/D8isK Qjv2Gjg5+41xPPT0cceXzwUb+LJkh09rdMTjmeG+oWJgv/1rtt7Jko8VxZVdfDXPy4MZ e5ipHOSyC7Se+gfa1TjiBiK85q7qFR8NbTA2k3NIhv//GcQzzY3YHvOlCUUyxh8cd+Wq bwlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MhheypW2; 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 x29si21684933eda.297.2019.09.16.03.55.06; Mon, 16 Sep 2019 03:55:06 -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=MhheypW2; 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 S1732623AbfIPKzE (ORCPT + 27 others); Mon, 16 Sep 2019 06:55:04 -0400 Received: from mail-lf1-f67.google.com ([209.85.167.67]:34920 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732586AbfIPKzB (ORCPT ); Mon, 16 Sep 2019 06:55:01 -0400 Received: by mail-lf1-f67.google.com with SMTP id w6so27101470lfl.2 for ; Mon, 16 Sep 2019 03:54:59 -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=sLN8PEIzdXJ4vyRQJpg4LVfYYRixS2x0Ts7jhtzHOWM=; b=MhheypW2XDysOKktHNsxSG7LxAVuj81gvn1nIXQCjY3ZjEOWVw64CWPx+TsC7e8i/L N3aTKRxdyURBfnZY8cnxzthB0q06sfJEdgrJndGnTTm5DkQ05sqC18szpQVvwPI205JM FD5UbVZfrw17pax6P2aNxvYr0kPjRThua9mL+vYGNNZLqWM5aAc2R1FBXyERvpvxhH9Y sO3McigyojSgOHI03jFVLTIjTnYlbMcahGt86azSZyWWNsHChJFWikNBqpHmK10qnbhD MUjWVDOpY59AA0cDjDtsDASxXF5BF6kAI1VLiq/RWUSorKaA/C3Pq9jt+rQKiEq3xjlk 8fRA== 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=sLN8PEIzdXJ4vyRQJpg4LVfYYRixS2x0Ts7jhtzHOWM=; b=XzZtM3yuX5so8aNSRkfwPhcRbeaWN6lPWmFK3ux3getfjjIU1ibXKkKQOZ5THCcssH n4gpslaFEj2gb3eCgbYyGenrE54MHcVBnQ320LleCQxzvPXP1EbkjmUfu3k3mLsIxC3p P01Q9cqKNF1n70OBxWzhaloSrQ5PbSh11z2jWsnQ1x4S0NczuCVoIm+8Erf/86JWbNEW vaWolduI6AIhuEBCcdv7lR9Lm1hoRs7yggVtexkF8TQSiv+88l5pXF50fL/GU92Roez4 RZE8VrUgDz0ip4rtYc2dEGFsIo0UbzMvyqAE3B9DGZxRE3bCzQWmiIwwDa/vxk04XqCt vHgA== X-Gm-Message-State: APjAAAWnHh/VqtB92/Tg0dqAs8An/FUKtoVkC7UkDtTkYdGSVIlURpgs pWWjy92tQ/4SVPXUZojqf7NRAA== X-Received: by 2002:a19:4f5a:: with SMTP id a26mr37493210lfk.116.1568631298482; Mon, 16 Sep 2019 03:54:58 -0700 (PDT) Received: from localhost.localdomain (168-200-94-178.pool.ukrtel.net. [178.94.200.168]) by smtp.gmail.com with ESMTPSA id v1sm8987737lfq.89.2019.09.16.03.54.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Sep 2019 03:54: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, sergei.shtylyov@cogentembedded.com, Ivan Khoronzhuk Subject: [PATCH v3 bpf-next 14/14] samples: bpf: README: add preparation steps and sysroot info Date: Mon, 16 Sep 2019 13:54:33 +0300 Message-Id: <20190916105433.11404-15-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190916105433.11404-1-ivan.khoronzhuk@linaro.org> References: <20190916105433.11404-1-ivan.khoronzhuk@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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..d5845d73ab7d 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 RFC 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