From patchwork Wed Oct 9 20:41: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: 175687 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp1264213ill; Wed, 9 Oct 2019 13:42:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqzp5d6UnHvY9MACyg4yJ5D2f8A5gnVLcKtGFbhcCtkfysTKM+q7rbuCIKwxdzs/x07ZcBIB X-Received: by 2002:a17:906:364f:: with SMTP id r15mr4826928ejb.194.1570653724004; Wed, 09 Oct 2019 13:42:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570653724; cv=none; d=google.com; s=arc-20160816; b=r/0P1SPjWa+XPUzmgJanHueZefj7l/ue1Wzbwl7tBxLgzUq2u+/xTeu3RCITF22n4i c+QY0Bt8tiFI+qVVfIBCCEzdR0ce+zE85A3QrVNMVv9X2SgT/Q5SxIgknbsVkvjrdcqf Ie6xC3LtfwiabWoWCCALVM0ObRx61VYls1m/4Ij7QRsXRRg9fJe5EezDkqj1Er7zaHDL ZliK7tl9wx8XpEiwZUUTF8lRTTIwNDSZ5viGTGxHAj/gNw1wiNj95eqd4qvDAPVeLBkM W8OFM46pFfoPD4MVcPpSGNlcy+SRabFqb7AfuWoFso2CReJ/Lb72ebxB9eSHFl37zZSm o05Q== 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=MC3UXxIyGlb2XstOqzy+GWfcotnbF8PKfPeJNsshsWmAWTdj4NaIDFBAPhKoylu/4S UbFZdEj56TKZ4LS0+eNfr3SYEB04iSiagRU4cunQLO7X+YTG65VjmfGUUc8ROre0h1+y FpHwo8suSvluT22+g7Ai4dZ/RM3b1yaMq6BWFd1I+HOQ7STQ38HHvxS50phBIxHSdyKK ejm1cvgikIphEc7izu12GkPX7ypTsCbtT9s06hyzsw8hDwDUmYV3EcN2E1xfMRRkwFTG UdU/Ow/WXZ/tIsrPeRfjYXIOv+R9eX3fM1GiuzCopQ+5xWjZnSYHItnvfSr6ms/81ilF sTTg== 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 netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 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 netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pzdPyL78; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732169AbfJIUmB (ORCPT + 8 others); Wed, 9 Oct 2019 16:42:01 -0400 Received: from mail-lj1-f193.google.com ([209.85.208.193]:45145 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732170AbfJIUmA (ORCPT ); Wed, 9 Oct 2019 16:42:00 -0400 Received: by mail-lj1-f193.google.com with SMTP id q64so3848538ljb.12 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=kunbN/HQtZbKteno6iog/52X0ZrUqjwdx7PKjXXapvAwN4BxrJdcaVV3XzP4nQ+RPD 5PK66zQxwmzxKceXQ0Mh7Saq9TGdgij57/C8m3mv6YhrYK05C/2VD1KL/JToa3dEh7xW mN+l/YHopFyP5J9XsFmQSwJ9GOYkseSbAxRuDdmFcgGQSokPKs91BrElLH04eNhwxMUy JdcZ0ZyAfKlX17GFk11txpnI0MObAucr4aFEect699mu0sVmiMukn0Q2hLYz4TjY428E z6g3tNmooBOdMJTpgAOnNLNC6FmL6iwRUBgp6tNuZi+VTBF1FXm6/mjqu+lmxJzIrGdo JMGg== X-Gm-Message-State: APjAAAUhVO5PAQS37a/IjoPaN2Yc1ipz+LNLbI6F3/mJ+Ey7J2vTaoNK P5+kxCnU9gz8agHoVzQ6YDwkYg== 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: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Basically it only enables that was added by previous couple fixes. Sysroot contains correct libs installed and its headers. Useful when working with NFC or virtual machine. Usage example: clean (on demand) make ARCH=arm -C samples/bpf clean make ARCH=arm -C tools clean make ARCH=arm clean configure and install headers: make ARCH=arm defconfig make ARCH=arm headers_install build samples/bpf: make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- samples/bpf/ \ SYSROOT="path/to/sysroot" Signed-off-by: Ivan Khoronzhuk --- samples/bpf/Makefile | 5 +++++ 1 file changed, 5 insertions(+) -- 2.17.1 diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile index 6b161326ac67..4df11ddb9c75 100644 --- a/samples/bpf/Makefile +++ b/samples/bpf/Makefile @@ -187,6 +187,11 @@ TPROGS_CFLAGS += -I$(srctree)/tools/lib/ TPROGS_CFLAGS += -I$(srctree)/tools/include TPROGS_CFLAGS += -I$(srctree)/tools/perf +ifdef SYSROOT +TPROGS_CFLAGS += --sysroot=$(SYSROOT) +TPROGS_LDFLAGS := -L$(SYSROOT)/usr/lib +endif + TPROGCFLAGS_bpf_load.o += -Wno-unused-variable TPROGS_LDLIBS += $(LIBBPF) -lelf