Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp1408935ybp; Wed, 9 Oct 2019 13:42:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqzMn/NsZ3bAIh0w0FgWguUlEe6lf8x/n3OQMzG7sgG9CpkaD6xXcYmdYmlq1JEJYgzJicd1 X-Received: by 2002:a17:906:4c97:: with SMTP id q23mr4569957eju.78.1570653774361; Wed, 09 Oct 2019 13:42:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570653774; cv=none; d=google.com; s=arc-20160816; b=VJRgb4wsZjemI9OfqvyOn+aw3yy1HczHcWpSLXDDzxOHNqM97rL35y+KQhJjqy0EfQ VJL9eXMwnYbA6b+zGnqZtCP+BXpY10WizcZVs5dkZZUhxLxPg1nWpLO5LXA1tEAC2AjF 4mwNnNh/HIqTjRdBXsdZualxUk5049y1uwYj51u9X/XIxPp30ltPMsoPjGAKcyT+Opm5 hpLB+cXUiM3UcUhTQUiqFas1XjKenxnl/Wu27NLTHab2V6LLFzcrdoXXMaCUdLlxE8A8 7dCzFk5wIM75wgi+gMecI8b4dql8bMOlLgd9s2y4HaoDxlJBltVNmtEM0VOFGIAwVt3x bH/w== 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=kJZosXmotw7dDgmrNkVk5PbHQQM9K0ItSYAPMoYZanreLsYC2whRSE36n+Ea2naqk0 FqXF777qDdM6nj7ybCnGtyEk4bWqs9bNHZXcHjh+KiosHKnAyyesQ5zCa81H8yaYqHwA hso4k8+EJMSboKc/oBh5JWbCprxlBQH/zYbpQxH8XEYApJ9O7CzK0f0+usWUttupWFCY D9ztN0Ep9yuz4uLQDNpkWGCs2GU67qOHauZnGp2XI9CuiSfiuHdFvFcvs2gM/l1l8/AH 0yUKbVrhki7tRPhGY0H0OimIz3v1rTur9ntGS0xXnG9Ng4ecm/d6QMI2AbCI7BdK/RlL VATw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pzdPyL78; 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 ck2si1828843ejb.346.2019.10.09.13.42.31; Wed, 09 Oct 2019 13:42:54 -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=pzdPyL78; 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 S1732219AbfJIUmF (ORCPT + 99 others); Wed, 9 Oct 2019 16:42:05 -0400 Received: from mail-lj1-f195.google.com ([209.85.208.195]:40789 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732171AbfJIUmA (ORCPT ); Wed, 9 Oct 2019 16:42:00 -0400 Received: by mail-lj1-f195.google.com with SMTP id 7so3869102ljw.7 for ; Wed, 09 Oct 2019 13:41: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=ZSbYJ+tLtfDuMSVqb7LwJbRD3u314/MfD3p1keHf2Mw=; b=pzdPyL78q/gbChT77HCP7gSmJXWVdEWKYJQzr4nN7gdvvWnYwHoI8e+zFj+6pgj6yb K8kXXGGo9S629wH2TsCb/WtRqZmXgJJ70q3HTxWrCTT/7iMCwuiKj7zudoSmlfGB+PAI /45wQ4KP7k11v6we53lk8hhEeehY1QX9SjVDv/VQv1jaHINDd6U4g/QtWhYfubjHDXgp XTVVibyKnEQzXFUc37axnMinQOpbyw7ku8dOxYuTW/BDJAeS00IL5E1xmBcZliiAeCXU ntHfGa4HfaPvseNHg7XszDFS0voyh5uMx9tMPpL6EIkU9r4TMaGMpMFzfb6wZW5PrWf4 cALg== 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=bd8gtaTcmZ32RyRIyMfqo7YgeCqZA0SlAiemDECZq587mxybdDWuuKsNQLioo6gnIr UFk/koPA+I6raq09dowKXyThq17cn9aH9HE9tNE1IDoKICTYsS7jUM2xcix5ma0xKirh W3wtwu63ecSn7mDWv5rqHv8jGOMcfjGCtZ6mswDC/KFqPwDFdMXJe8Gm31fdmocir8yw 9ufiuVHSr8zjVMkYGvyInPQLmKE+Hv+x9iKZHvxqMORccMrCjJhQpnu0L/uj9n0K4kFV zAPo03IHlV2aK0wgksBpP1EMPaC3MJyzeHvch1PTdYVjwCrBcTw9L10qDB+EqCvOgpYG XQjQ== X-Gm-Message-State: APjAAAW6jVaSQZdfs6aa/zZQxJFqw87c+MJrbHJzYIDcYtQlHFjG8twO Hm+YU2L+LiquGJ4NuLGbousoZg== X-Received: by 2002:a2e:86cd:: with SMTP id n13mr3689328ljj.252.1570653718918; Wed, 09 Oct 2019 13:41: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 h3sm730871ljf.12.2019.10.09.13.41.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Oct 2019 13:41:58 -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 14/15] samples/bpf: add sysroot support Date: Wed, 9 Oct 2019 23:41:33 +0300 Message-Id: <20191009204134.26960-15-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 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(+) 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 -- 2.17.1