From patchwork Mon Sep 16 10:54: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: 173831 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp3338140ilq; Mon, 16 Sep 2019 03:55:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqyE4xm76t53UG2w5hIXSWYWb15IpdOZ6RHoJ1EnedR3Nue4gYFIul/CP9LATTX+RSU8nPSs X-Received: by 2002:a50:ee92:: with SMTP id f18mr39300417edr.253.1568631321153; Mon, 16 Sep 2019 03:55:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568631321; cv=none; d=google.com; s=arc-20160816; b=RUbPTYSS7Cqh6NjE70jfdeT22IWSsf26pDoVpTZzOH5rmOhZySagmVt6mSIahyfqTn qwYpQfVWY1Ch+biv3yCYMdEGR3If3kTjtaLSLjXBsRb25CXN0GSMeFq/qJMGORaZUu8R a1SgBJpxkGIpYOjuZkg+jIQHt7jDyJkMUSWzNgckbZU8wwKtx8A7bdNEpMrlbP2iEUKK n2Wp222EW+iwA9pdVbQnja1buywhiLI4Emjsg1u3T9eeHfQThifo2pjDiwQcHfZtCiCJ lKPAU3C7pOxIHZk3q21XZsoa8eqh+QF2G3qtVuIq8gFw7xkwLhpTZTCoP0X4nJ/PwtVZ Z7EA== 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=L1rbvOW+wQJfkI127ZZlgGnuYj2RYmEzxNGLFnF8DNQ=; b=xeQlOEaVATvdvaZBehdD2mbgSvUG+/WtvRvgLw7cpzsrgJK/HoqyQULxVI+3S9Cbp3 lZh42h+SXqXuh9FqZZwnnVlunMXuRgA0zEGve3caVV3gC/ixoXbulyRnipH9Xyt57C5m EUmkCFLbKz/1OauLUri6HOXcfOwTq4tVcpg7Hv6sr28rE5JmNYRGlYMzFb7BJWqbdnAN LMOtlbnVPgBJxJnBzjDlX3NO1Jf11XIB2JfZ4t3LcyOBNWeND4J/Y2QjzCj0MmOvM5zb qFkTokaKARlPAyc9hlO8gS432LlOd2YMb4d02ihdmAtRAW6FQGzGjtTErIhZAvT83HAu 4d6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=o+zzeQpt; 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 c14si24476548eda.8.2019.09.16.03.55.20; Mon, 16 Sep 2019 03:55:21 -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=o+zzeQpt; 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 S1732642AbfIPKzS (ORCPT + 27 others); Mon, 16 Sep 2019 06:55:18 -0400 Received: from mail-lf1-f68.google.com ([209.85.167.68]:33863 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732583AbfIPKzA (ORCPT ); Mon, 16 Sep 2019 06:55:00 -0400 Received: by mail-lf1-f68.google.com with SMTP id r22so15775518lfm.1 for ; Mon, 16 Sep 2019 03:54: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=L1rbvOW+wQJfkI127ZZlgGnuYj2RYmEzxNGLFnF8DNQ=; b=o+zzeQpt0mAYpx6mc2RIjYCWYyOjhTHqnHHulW/RKWFhLKUdVgrqTTPr3iHy5E374v gG4cPe1wWsiBBnufog5HnjOQF5rH/3ruhSqJGzFNCB3Tx7RBfcMe458xx/vcOVqdU4ts H/5JFK4Mt4r8nE+O035eNaJztJhlPuKngB+tr//LANN79yG1GKmd28Rk5SiJlpiZykoJ V2B4/S10B+jsSXXcJqch1uNJyQ2ORizv9Nrw2rUMutmDleyxOSRakaDYiVvDKRcMHhej Po+om1loSyc7BuoEjEhiDxDFLDwFH2Zx5+OY39T98MmR5JOB2iRCiX+TxdT2sBk1zq5o cVYQ== 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=L1rbvOW+wQJfkI127ZZlgGnuYj2RYmEzxNGLFnF8DNQ=; b=OLzmxERlDcDsbeC7i8f8ZjSofP+e562wb8J+fiTU0xMZHO4xvIch4B1TivUYLHj4Pw bQIbb6gWM8lFGF0MTHuRv52C0NId7fh9CRtEEo64uDMTp08ptzf71sRHUGzXoviU7uTj cwFY0FmywPmoZLnszEfUq9lVPvLd/HMGW7fERfWVPeGwDP4aHfx0B1JrqZlYTAyzpNtc 03uvS2UEDOxYTrfHbmF9uRpeEAJo6EUPuKp6N0dtA7hpuIt4J+aHQweMAgUBENGb8/4C ngLk6XEqqqxntiHYhGlO4Ga63tLzGDq10ey12KpGyLNT2uVdlv77A2lMGi467JEqzsi2 FTkQ== X-Gm-Message-State: APjAAAUVb5SxED9sjUurXf9wVLENk8xc+goL1fMFt+hFV+e6gerH43Al UpFUauqWFIIevG6JgzP9NJ2+bw== X-Received: by 2002:a05:6512:251:: with SMTP id b17mr16802393lfo.35.1568631297220; Mon, 16 Sep 2019 03:54: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 v1sm8987737lfq.89.2019.09.16.03.54.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Sep 2019 03:54:56 -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 13/14] samples: bpf: makefile: add sysroot support Date: Mon, 16 Sep 2019 13:54:32 +0300 Message-Id: <20190916105433.11404-14-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 Basically it only enables that was added by previous couple fixes. Sysroot contains correct libs installed and its headers ofc. Useful when working with NFC or virtual machine. Usage: 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 133123d4c7d7..57ddf055d6c3 100644 --- a/samples/bpf/Makefile +++ b/samples/bpf/Makefile @@ -194,6 +194,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 + EXTRA_CXXFLAGS := $(TPROGS_CFLAGS) # options not valid for C++