Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp4267269ybe; Mon, 16 Sep 2019 09:17:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqxEc6McVKYFf3IU98CWwXRwipVSRqv3irPHLSqqGZ2MXpswbsJ481jmKT4vXz1DpHJ0c0g5 X-Received: by 2002:a17:906:3446:: with SMTP id d6mr807332ejb.244.1568650632793; Mon, 16 Sep 2019 09:17:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568650632; cv=none; d=google.com; s=arc-20160816; b=OTTc7YkpR67LKjot5chXivvWOFcDudyrQ08NfCWQwDNOLIjXYb1BlZI1eEMqKTpwkm Vkw803B5IY5lWHaCsdAyKZtPnZtQTgKo4ocoPlYx1iFXPMPzDAA75vEBhlRAJIHlZ3Nx 6ycqqHBWIMBzCkTUwUiONsgqPAMv+zkmthsXkSCJPRJ13esP+Zu7KXaprD9K3BXv4Cno 5uo7rVIOUe6OwYaz+EWg11G+A7u44a7QNc7vLK3z2LFzG5aPlzdnd2auLMn+lnNp5bup FhCTd2MFVYWbZumON+JADMsPX4+uOyqqRXPic3MH0QqtH1Ex17luLTZW0RrxKAZf3Opx wAZw== 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 x47si22574884eda.396.2019.09.16.09.16.48; Mon, 16 Sep 2019 09:17:12 -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 S1732635AbfIPKzR (ORCPT + 99 others); Mon, 16 Sep 2019 06:55:17 -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(+) 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++ -- 2.17.1