From patchwork Tue Sep 10 10:38:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 173507 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp5610519ilq; Tue, 10 Sep 2019 03:39:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqxYER+LvCMqZdCa7NhUjXPBlWotJRqiVzbGXCFAb7kWCE4aqKfK8Be7+v0LlQfR9eYVgTgM X-Received: by 2002:a17:906:b2d3:: with SMTP id cf19mr5002960ejb.75.1568111977258; Tue, 10 Sep 2019 03:39:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568111977; cv=none; d=google.com; s=arc-20160816; b=UkIuuDacZFkBnmLv3gifyN/JDK01rcqPloUTB4ZJ0A9ZL2HMo/hwIe+v/UySfOtxce rGW5SSuA9mGdDimQ2tykWNqzz4NaT6YTxMdXjQq/sQE3OAH4t9Gqgai0XfRu1koqgJPK WYDsfjZcO2RmNVt/nHgVCTuI7pYs0SlWQ4v7F8WBJtdpVOpyyEHBdqC/8ZGhz1FOQEDI 0PF03rmVHP5u5l2XPkbCkJP381h2GnmHAmdqRVJH2ECCXGkaHDytDeFKczX32zNghRVY VoDuE6IK42b1Kic00F01AvP/dMVK1Wr9vtmZRJ5oHWsir0hrCFH0pcJFucwPa5NnIjDG BOJw== 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=UKgtTI57zCb7K8E5dLif5y6EhTQqVERMGZla7VwIMYQ=; b=C8oIUbNxUKEbgXaX3Ur1kqRlq1L3nM4Lc47X3nyiz2EQOIXHLPpEYKNSeRYP1vS0/V akpBaf3W1hmvpDavUz75WYgEGXNK9t9joTB7aYnDkCfJIEaiq1yxKnzD+SdUS2+GWCat VFIskMlpVcIghLh7SnUSt/k0s+guKykn907DfXtbN9EEPNune1UsNmUolTdziCpSeTS7 H5yrhG2mcnbgkvLVHwJHVpO9f06IyuHEBrfWsZG4wAuypKQ6OWAUnsBf3RDyF5vsRE8l bS+GEz364KwgmDHQvQPpXsFSvqQJ0FVtoWtcFOp8NCkIO/Vabkxpi+MJxbF0tdCfk+Tk Zutg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=d1NV8iFC; 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 a5si10614518edd.448.2019.09.10.03.39.37; Tue, 10 Sep 2019 03:39:37 -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=d1NV8iFC; 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 S2403908AbfIJKin (ORCPT + 8 others); Tue, 10 Sep 2019 06:38:43 -0400 Received: from mail-lf1-f68.google.com ([209.85.167.68]:37726 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2393839AbfIJKim (ORCPT ); Tue, 10 Sep 2019 06:38:42 -0400 Received: by mail-lf1-f68.google.com with SMTP id w67so13013920lff.4 for ; Tue, 10 Sep 2019 03:38:40 -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=UKgtTI57zCb7K8E5dLif5y6EhTQqVERMGZla7VwIMYQ=; b=d1NV8iFC+6tOZEpE1Idxar1syxxTv7LcaRQZKlN8lQ6UWNIM+VsrSFW8OJhzp+yrJK TZnEJUUlCmzujYSIfmSrXIvuC5fOAhvtLMtyZs64Tv3BRrt8188Rowio4LxF2nev6JL6 WtXExT6UHvUlF0qokmozbnE1v4hSBPLFKR4wranRRPVQkNiRuzUt4ZlMLhNkSXBcitw8 O+rliVg8fS3f/5eYtq3Q8msGYQ9HqgzAhaCLrLmKBPO6NQNVOX9ydpNZY7TyJySLox4V mMlqKXBF3zWTks+rpEwMVOtIrdl3id63UjM+3DgC7rvSV53qIOnh0AkSuuj788gMPWqh JspA== 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=UKgtTI57zCb7K8E5dLif5y6EhTQqVERMGZla7VwIMYQ=; b=BXi1Rk6dJhmqMXhei9JOsQ95YH/Kvm0VhxLlXiga4ffYmc81CDkV4HDucY5t7ULGRy IWPS94hNUJe8aMQPUEbkWe4O+PBqho/VyAAxkgV0ZOf0sSO+Lq1pNuHnREGE9lBJWx3W S4tO6VAyJE4gTwz8JzOgDcgWM+EZzJ722+uzULEQdJSmzTXn8JGPhFZiWwlCS+4sdR8v 18fLqSW8e8AdXTOUrvSRp4YnbdO13DHBkhV75V7GoHof+XqRxm08+a8VjfxDN5hrbPGP 1sJEkQb8e1xFHMR7j1442t+BIDYxtm+6s9cw/yNmBgMJxcfIqjcXSHja/tpt3coNwiHz XWNg== X-Gm-Message-State: APjAAAWofswpU1jmgrqyP/TElpfA9yBu8QLd97dagd0D7AJQ28i5hCho mEY4hqTSLUoN51r0py3ehrno+A== X-Received: by 2002:ac2:5090:: with SMTP id f16mr20575559lfm.66.1568111920122; Tue, 10 Sep 2019 03:38:40 -0700 (PDT) Received: from localhost.localdomain (168-200-94-178.pool.ukrtel.net. [178.94.200.168]) by smtp.gmail.com with ESMTPSA id g5sm4005563lfh.2.2019.09.10.03.38.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Sep 2019 03:38:39 -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, Ivan Khoronzhuk Subject: [PATCH bpf-next 02/11] samples: bpf: makefile: fix cookie_uid_helper_example obj build Date: Tue, 10 Sep 2019 13:38:21 +0300 Message-Id: <20190910103830.20794-3-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190910103830.20794-1-ivan.khoronzhuk@linaro.org> References: <20190910103830.20794-1-ivan.khoronzhuk@linaro.org> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Don't list userspace "cookie_uid_helper_example" object in list for bpf objects. per_socket_stats_example-opjs is used to list additional dependencies for user space binary from hostprogs-y list. Kbuild system creates rules for objects listed this way anyway and no need to worry about this. Despite on it, the samples bpf uses logic that hostporgs-y are build for userspace with includes needed for this, but "always" target, if it's not in hostprog-y list, uses CLANG-bpf rule and is intended to create bpf obj but not arch obj and uses only kernel includes for that. So correct it, as it breaks cross-compiling at least. Signed-off-by: Ivan Khoronzhuk --- samples/bpf/Makefile | 1 - 1 file changed, 1 deletion(-) -- 2.17.1 diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile index f50ca852c2a8..43dee90dffa4 100644 --- a/samples/bpf/Makefile +++ b/samples/bpf/Makefile @@ -145,7 +145,6 @@ always += sampleip_kern.o always += lwt_len_hist_kern.o always += xdp_tx_iptunnel_kern.o always += test_map_in_map_kern.o -always += cookie_uid_helper_example.o always += tcp_synrto_kern.o always += tcp_rwnd_kern.o always += tcp_bufs_kern.o From patchwork Tue Sep 10 10:38:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 173499 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp5609705ilq; Tue, 10 Sep 2019 03:38:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqy9bDP+wWRzt6TZHlxZkh2SwaKUJsloka+Xh54uprUVsZYa9BiCR4Rf5I/pLtnonTvm1XmI X-Received: by 2002:a17:906:3443:: with SMTP id d3mr1765797ejb.221.1568111929253; Tue, 10 Sep 2019 03:38:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568111929; cv=none; d=google.com; s=arc-20160816; b=D0R+JNx1J4MOfvuJXp3u12Na8goJjV5OZVmw+AQ2pLhQDJnBH1L0ofc6TAyXcZjej9 zqJIDqe+tBtW5uemwTGEVJtGj2nxrBemG1/2dfqukU1BuIrw5/a3CVhgdfsfI45+OM1p OCWtsg5op8iRec6576iPkcjiJnBb+Oj5NJZsXbBa1C4QzsLzyAs8SI5WR1fLvzzzpcOW KjjcVB999Kq997Zy8iwhzwrCDZzgakO8zTnkYA2a9pIj42ZmpLdo25AFIBEXWaeFvM/d 7njMh/UoJKwuRlPjFSjEvLtHerPjQHJlN/Tfd7jde6t85X2J2xuMYVKjO74lLp2i2QWO RJ/Q== 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=4FRJ5Ph8qMbMU6/W3VLuGrqprbT0bDHz0d1WvLmMb4M=; b=wk9VMRRQNllTB+IsiJ1WH1zOOeZkuKfz50qIk6sL14PfyC5OAmc7oDvfBaMoF0BAWG LvoOoIRJnp7tPpaoPN/T1nMki3bRi6tQhpWeplwQDiD1s3UytYXjfEG2Ndu6Gw757jCf kqUKv1x1jMVcMsRjPRtSAlOhio5DGySaD7i4eXcE3it4Wk/ZYWNcO/tsul+u4V4KwpXw Pni1+HYSvCbP9F6Bri8huG7gt5d1MNHtuQnd9Umv2J8H+hmE8seC53wVvIFlZPKuYWoy UUGpvVe29rxJybNQmMnWTe5cpMQ0zq5sKkt2jI5HJUymO0B7zGseiZAdqY55S04Hw0Sx wANw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TXCPyNiE; 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 y9si8966603ejb.5.2019.09.10.03.38.49; Tue, 10 Sep 2019 03:38:49 -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=TXCPyNiE; 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 S2406090AbfIJKip (ORCPT + 8 others); Tue, 10 Sep 2019 06:38:45 -0400 Received: from mail-lf1-f67.google.com ([209.85.167.67]:41699 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2403802AbfIJKio (ORCPT ); Tue, 10 Sep 2019 06:38:44 -0400 Received: by mail-lf1-f67.google.com with SMTP id j4so13017853lfh.8 for ; Tue, 10 Sep 2019 03:38:43 -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=4FRJ5Ph8qMbMU6/W3VLuGrqprbT0bDHz0d1WvLmMb4M=; b=TXCPyNiEYJm+z3P9BrsgCARerEq9GOj2cQ11CYeYMNRuDkg/mY0M0tQui+vUdL1k87 8+ECvYjDRTCIoulo93XPu0RXJvzn/1Nz7YG2evAYLUkNhWIqO7VIZZ0QYmn63vEKS+8G fn70QxPlntFDMw950+14w5b79yXsySEIlftqcIt9K+GAVfYjfmsfhQRDGCiQjDqcenl/ 4Jq9v5fuFPTeUqaF4pzLPWOcipfkFql5KD6lqmjwOEZpE2e5y+2S8Fs5jznuqUTZGezp RQQM60F5JHcdeChUHuytyct8VKXIhAVM7CZetbmTUFxRt208i+TlHTzDlk4C2rVJorC3 SQRw== 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=4FRJ5Ph8qMbMU6/W3VLuGrqprbT0bDHz0d1WvLmMb4M=; b=uUeiFF7pvIX+8VMdyUeV6zpOKA+NSfEHNMx/s7ktH65pgHeRvWnQJtONYoY98lWgIy Qa9DYLMospgk3q3Oz9z7ZriNM3zpEzvgb0c0V+IGfx0V12NFleOMn+fPEBn3C/jMRsLY RbDzZK49g4ILRaU8p77dqxU2d8lOaoouYwU8lqyJAOTDNIxIlgMYHVfjdR1b9zdqWJ46 qTUIGODuIHIzA6t9GYjfs9TyFIiEpYlNduLPCmaLAUbqHeqNnCP9+/PXcVWcJPcKNPuL Jl8QE9LpczaRhv39rEmCLKUCEA1B00C/bC+bgf+TDlaJh95S+uUVXml5Fy/TQd3JOeSZ 5VGg== X-Gm-Message-State: APjAAAWcEEQHlAcx1a5TVuArnoW/yizfZCvNPP5s6u0MEYhsrexQVJGR tc1tRtO5+JzjMdTQvyJ0ylGpJw== X-Received: by 2002:a19:14f:: with SMTP id 76mr19346797lfb.92.1568111922493; Tue, 10 Sep 2019 03:38:42 -0700 (PDT) Received: from localhost.localdomain (168-200-94-178.pool.ukrtel.net. [178.94.200.168]) by smtp.gmail.com with ESMTPSA id g5sm4005563lfh.2.2019.09.10.03.38.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Sep 2019 03:38:41 -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, Ivan Khoronzhuk Subject: [PATCH bpf-next 04/11] samples: bpf: use own EXTRA_CFLAGS for clang commands Date: Tue, 10 Sep 2019 13:38:23 +0300 Message-Id: <20190910103830.20794-5-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190910103830.20794-1-ivan.khoronzhuk@linaro.org> References: <20190910103830.20794-1-ivan.khoronzhuk@linaro.org> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org It can overlap with CFLAGS used for libraries built with gcc if not now then in next patches. Correct it here for simplicity. Signed-off-by: Ivan Khoronzhuk --- samples/bpf/Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) -- 2.17.1 diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile index b59e77e2250e..8ecc5d0c2d5b 100644 --- a/samples/bpf/Makefile +++ b/samples/bpf/Makefile @@ -218,10 +218,10 @@ BTF_LLVM_PROBE := $(shell echo "int main() { return 0; }" | \ /bin/rm -f ./llvm_btf_verify.o) ifneq ($(BTF_LLVM_PROBE),) - EXTRA_CFLAGS += -g + CLANG_EXTRA_CFLAGS += -g else ifneq ($(and $(BTF_LLC_PROBE),$(BTF_PAHOLE_PROBE),$(BTF_OBJCOPY_PROBE)),) - EXTRA_CFLAGS += -g + CLANG_EXTRA_CFLAGS += -g LLC_FLAGS += -mattr=dwarfris DWARF2BTF = y endif @@ -280,8 +280,8 @@ $(obj)/hbm_edt_kern.o: $(src)/hbm.h $(src)/hbm_kern.h # useless for BPF samples. $(obj)/%.o: $(src)/%.c @echo " CLANG-bpf " $@ - $(Q)$(CLANG) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) $(EXTRA_CFLAGS) -I$(obj) \ - -I$(srctree)/tools/testing/selftests/bpf/ \ + $(Q)$(CLANG) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) $(CLANG_EXTRA_CFLAGS) \ + -I$(obj) -I$(srctree)/tools/testing/selftests/bpf/ \ -D__KERNEL__ -D__BPF_TRACING__ -Wno-unused-value -Wno-pointer-sign \ -D__TARGET_ARCH_$(SRCARCH) -Wno-compare-distinct-pointer-types \ -Wno-gnu-variable-sized-type-not-at-end \ From patchwork Tue Sep 10 10:38:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 173506 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp5610103ilq; Tue, 10 Sep 2019 03:39:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqwh0oe5sV5+Cr2OUZDfLEUpkA6mTAYWhUFqJEJb3dF5EGZ0K4NUdiBcVxD5AQPLzj9HmjA5 X-Received: by 2002:a50:fc08:: with SMTP id i8mr30247068edr.285.1568111952915; Tue, 10 Sep 2019 03:39:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568111952; cv=none; d=google.com; s=arc-20160816; b=dWN51WX08DvepRY3lQGx71eKj9aIEp9fAmobUb/xV6c58WYKjAJ+UeZGntNArbJaIt AY+njRuVn5eu8ZzFxH/VqmeYAvW4AHPDoAEZd/nk5GL3Smi/E4d6Dxd3H/o+JmQnvVl+ NKEYgnF2UfcHHFGyUJltVkxmHGwyKHXEnPmwccQkeRMVo+HDETl8fS6c+uYswy4wUbFU t5Xs1OfoBjwW9HPvFU/S0bhFmVx+x8OvHfCbolq1RGwYACRr7OISCdujjx+vWEvwgy8T 8nm/5ugYaF9YMVU5eFhFHyxtrs2h1aZ1JIwSJSNeQ61CDyh5xDbboYmcfOLFA7RMBq/G Exew== 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=Jcy7fNNZJS0bHfCAktRnVFRPdGNhHeHDFWh1+uGNMgg=; b=Wnz3T7h/sJo9BhdD1OG+hxv/GWwXShtIplJHNDQrelOc+GWu6NSZJc7pOu3tXHZ9LE Ovvs7rrs8VIIXVe+0YHT42l3DL64V/pdYcf9qQp2RkJQEDP5ccNlP2cLUeolNgvXVNue isHat7v+KpI0SYn0opIrQcsohMiasR98vN9gWungzoUzeet0mfSG2gvXQj4nSSrTA5vj cSnbCFsWzBSKE7Y/lcV9b72jRQ4u+b5Z5EgpEr72XdUMWveTEg7e6my3tQM8TWc5t+SK BycXpWQsffFK8qnmfrpvlHINv1ef819oehggSRae6Oz2uzGT7naUuKYsILOMLQ+zi8RT OZ6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TacAjaCh; 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 b15si11002349edd.121.2019.09.10.03.39.12; Tue, 10 Sep 2019 03:39:12 -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=TacAjaCh; 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 S2406164AbfIJKiv (ORCPT + 8 others); Tue, 10 Sep 2019 06:38:51 -0400 Received: from mail-lf1-f67.google.com ([209.85.167.67]:33918 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2436512AbfIJKir (ORCPT ); Tue, 10 Sep 2019 06:38:47 -0400 Received: by mail-lf1-f67.google.com with SMTP id r22so1728309lfm.1 for ; Tue, 10 Sep 2019 03:38:45 -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=Jcy7fNNZJS0bHfCAktRnVFRPdGNhHeHDFWh1+uGNMgg=; b=TacAjaChlFJ4KM27SSs7dVz9hlSYEhjkfawLkkkl48IIQQ1wSVIYRQqMrlaTvwl5CP DLad2TxLl1dIZdNnUCsQoUzGEzjSHzGAoJfGcjZM4FTLbfHDJDLxnG5DAEJV3cr2Dy8K NohR7qiDvztBEtRRhN+sI9gFBal1gTt0bC+OvHCKzOtDlFYiVB5XXrYtgW94qEUhkp2h 3v8a3c01/ol6w+U0kIUEzHlnI0iBQYa+7bJiSI6L+/2JnZTArU2V7S1yzvcDNRFO1VxI N2wy/iUyP3CgCFvDn8yQRk+j1Mob2gdE9ZGzqU5ILV7gLlW6lFvbvv5sRg6nA13I38pN V0kg== 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=Jcy7fNNZJS0bHfCAktRnVFRPdGNhHeHDFWh1+uGNMgg=; b=hf0p0qIpnVV0rWtPJTrTcwUOKXB0T+W4KjrcayZaCgxHM3g+Dp6JQQ1UCqcJ2T4qD/ Em0uNvNiyWU/Js3NJOxUiWtgNmfZFzxku5WipT774rRJb6UUhteYuMikpUg/bvWS7jgU ibU6He8YnA7ll0rV8BkH6CltQowDZh4mPjtZzEwZVpr8RwbcnKl45oql16h4BcbdL2rF JHdKf5/S5k1djdv8KK8kV7Jd/3LCB3wWhuOkcRQpgeNHO0cMPDPvyNIOW5pISGHEW/nK Wv7DR25rxa+y+zj1t69uZ1kzcMBFHaaiLtykEkOYdsGg2QWRpFlRZZGgD/5q6TKBKg5G wqSg== X-Gm-Message-State: APjAAAV7u0rhuaC9u4OJUktqD8o20P30KBDOFC5ZLXKvbk1w0LjIOb4U iJxOfY0CIPAVI0yzgy/6pz/Eow== X-Received: by 2002:a19:2d19:: with SMTP id k25mr20950410lfj.76.1568111924828; Tue, 10 Sep 2019 03:38:44 -0700 (PDT) Received: from localhost.localdomain (168-200-94-178.pool.ukrtel.net. [178.94.200.168]) by smtp.gmail.com with ESMTPSA id g5sm4005563lfh.2.2019.09.10.03.38.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Sep 2019 03:38:44 -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, Ivan Khoronzhuk Subject: [PATCH bpf-next 06/11] samples: bpf: makefile: drop unnecessarily inclusion for bpf_load Date: Tue, 10 Sep 2019 13:38:25 +0300 Message-Id: <20190910103830.20794-7-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190910103830.20794-1-ivan.khoronzhuk@linaro.org> References: <20190910103830.20794-1-ivan.khoronzhuk@linaro.org> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Drop inclusion for bpf_load -I$(objtree)/usr/include as it is included for all objects anyway, with above line: KBUILD_HOSTCFLAGS += -I$(objtree)/usr/include Signed-off-by: Ivan Khoronzhuk --- samples/bpf/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.17.1 diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile index 6492b7e65c08..f5dbf3d0c5f3 100644 --- a/samples/bpf/Makefile +++ b/samples/bpf/Makefile @@ -176,7 +176,7 @@ KBUILD_HOSTCFLAGS += -I$(srctree)/tools/testing/selftests/bpf/ KBUILD_HOSTCFLAGS += -I$(srctree)/tools/lib/ -I$(srctree)/tools/include KBUILD_HOSTCFLAGS += -I$(srctree)/tools/perf -HOSTCFLAGS_bpf_load.o += -I$(objtree)/usr/include -Wno-unused-variable +HOSTCFLAGS_bpf_load.o += -Wno-unused-variable KBUILD_HOSTLDLIBS += $(LIBBPF) -lelf HOSTLDLIBS_tracex4 += -lrt From patchwork Tue Sep 10 10:38:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 173505 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp5610038ilq; Tue, 10 Sep 2019 03:39:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqzG60hPti2Ds9wJOktTyXJC2Ol1W6aYvvk2Mx3VyCIyqJUpoe8zvwqY2+pj6dT2wo1K2vyx X-Received: by 2002:a17:906:a851:: with SMTP id dx17mr24307977ejb.116.1568111949024; Tue, 10 Sep 2019 03:39:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568111949; cv=none; d=google.com; s=arc-20160816; b=jPqJRItfGS/1eV/bIxkDaRY5RQR4gcRBlk+I+ET6gMcY3X6Cp3H/XTA8HWX1XPuDNT a9xxijux2AzAMkIFfZYusrpWhkFpzC+XSqryazmx7hGrNQ9pyEidZgmnzdVdhgJ8EB+0 IV+TQCtnE5waiiBansoEd52gZbcTbUBiVe7+V1nFKQYSrloed7c8mORRSN6HiEJTdQOL jUJkxDpyDYbQie3Bgj6z/QbHcwVoFXdU+xEpYvPR551VHdgxs31JsKmyfQm/paKawv5M c0OUyNXjAz9H4ftYFxAEtsa/+LJw/4EDOWuna0AiY+fV6i/cmf70H2Q0u+LLm8hV8gpr qFUA== 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=4Ec4H0Qe1jdzuqdUWFKh+P+h2+Aff+D7k9SQeZ/p30E=; b=Jawh5fQo1XhYiJx8vQTHrzv3YywjWNI4PP6Re3KSj3/g46KSyMViS43KHdB/CuPkvY Qr6RGSWzRFUsUiYvXqJS7JC/qyIQWtxFwcZPJRq/BI0h5STUq3nxqZTXpEFaCqVnk6S8 vl6HK8Ho0eIOVNKnEIGQ14c2GiS4S5n/+1TOdNQVLqQImkB96cr5238v1SkpVSlt36QD cawlpgyV3zIOSeWvY8rS+TSBFKcxSYN1ntwCxB5SRDCMe3VzMza+uyamoIuxCZdeni56 TvhcQYimCnu1mUP6Q0/2sZCkK2Nf2fVtyqN9Jb7ax4Why8mNegv4G+dxIzDOKwYAtSoJ Zlpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RTYn6wq8; 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 b15si11002349edd.121.2019.09.10.03.39.08; Tue, 10 Sep 2019 03:39:09 -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=RTYn6wq8; 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 S2406211AbfIJKiv (ORCPT + 8 others); Tue, 10 Sep 2019 06:38:51 -0400 Received: from mail-lj1-f195.google.com ([209.85.208.195]:43735 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2436567AbfIJKiu (ORCPT ); Tue, 10 Sep 2019 06:38:50 -0400 Received: by mail-lj1-f195.google.com with SMTP id d5so15889011lja.10 for ; Tue, 10 Sep 2019 03:38:49 -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=4Ec4H0Qe1jdzuqdUWFKh+P+h2+Aff+D7k9SQeZ/p30E=; b=RTYn6wq8HZB0SSigIWSrQkukTm2rdfngleNyu72MpsqM1lASZH9QE0Y6SHFkcdPW6t SUOlRyMvW63YiViGvW+w5uk9hhQHo6nROk5fexs4TrYZfHMoghxAmfs8Fi4tYH5bhdAr H016Wcl9zaGW2Qpi1EEMaMjyWk9fKH9Fhqh8Z4QDBgavFL0xuFAaOgfeMMcsQXpirM/U /hK3lqrFAb7/Jgtpp0I4jcHmrSqHFOf/1N5hxkhhF3nYHCoFtapOmz5fR/J9tPgo5aHB vvWGKjSkJB1FQ4JwvfFF2A/Grho+rsOw6/naVUBStw26OlIwGjwsmVM6X3/T103Kh1kT rUTw== 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=4Ec4H0Qe1jdzuqdUWFKh+P+h2+Aff+D7k9SQeZ/p30E=; b=N+eGLm/xlneOXo3GkIVXi1GQU3Aiz0i9fIIkmp0DuWqqQQG+q8WyavdugV96zsy0+2 DX9gRRVg1UaaI5QiQ57238mmsgymWotYJ2AMfSJ+p4BjIWDhHhL6/SAcOnDgI27QYlqu YRt3k9eODYXCTDSw/RJZ2+1O1y08z+eSbL5Q9PeBGR7rep6N2QAOV0h87+OkdvuynA9O qZWl8Gho8Ed3Feujxe45CUmdpB+isy1FqP5BNOVxGHye1OTzHI1oqUZ59+QqmCLIDh+Y PLruy/hiKYFDMwSD6tm7S0Y61BkopZ3YlF0fbpP0le6tZwKs7zaLo5Z3GKhyhwy3QyTX TOiw== X-Gm-Message-State: APjAAAV3s8Xkf28pNecBxeAtE6/xrscodsGL5sA8ocGx/zWfNIZQ28eH DKRxqvEbaE3sVrjpP/n1Dx5d0w== X-Received: by 2002:a2e:7210:: with SMTP id n16mr19306668ljc.235.1568111928714; Tue, 10 Sep 2019 03:38:48 -0700 (PDT) Received: from localhost.localdomain (168-200-94-178.pool.ukrtel.net. [178.94.200.168]) by smtp.gmail.com with ESMTPSA id g5sm4005563lfh.2.2019.09.10.03.38.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Sep 2019 03:38:47 -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, Ivan Khoronzhuk Subject: [PATCH bpf-next 09/11] samples: bpf: makefile: use CC environment for HDR_PROBE Date: Tue, 10 Sep 2019 13:38:28 +0300 Message-Id: <20190910103830.20794-10-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190910103830.20794-1-ivan.khoronzhuk@linaro.org> References: <20190910103830.20794-1-ivan.khoronzhuk@linaro.org> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org No need in hacking HOSTCC to be cross-compiler any more, so drop this trick and use CC for HDR_PROBE Signed-off-by: Ivan Khoronzhuk --- samples/bpf/Makefile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) -- 2.17.1 diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile index 625a71f2e9d2..79c9aa41832e 100644 --- a/samples/bpf/Makefile +++ b/samples/bpf/Makefile @@ -209,15 +209,14 @@ BTF_PAHOLE ?= pahole # Detect that we're cross compiling and use the cross compiler ifdef CROSS_COMPILE -HOSTCC = $(CROSS_COMPILE)gcc CLANG_ARCH_ARGS = --target=$(notdir $(CROSS_COMPILE:%-=%)) endif # Don't evaluate probes and warnings if we need to run make recursively ifneq ($(src),) HDR_PROBE := $(shell printf "\#include \n struct list_head { int a; }; int main() { return 0; }" | \ - $(HOSTCC) $(KBUILD_HOSTCFLAGS) -x c - -o /dev/null 2>/dev/null && \ - echo okay) + $(CC) $(PROGS_CFLAGS) $(PROGS_LDFLAGS) -x c - -o /dev/null 2>/dev/null \ + && echo okay) ifeq ($(HDR_PROBE),) $(warning WARNING: Detected possible issues with include path.) From patchwork Tue Sep 10 10:38:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 173504 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp5609905ilq; Tue, 10 Sep 2019 03:39:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqytpLyQpgtdnTp3XBsXVYzV3ObV31RljLZHrPVuLOSQIcPBzhNgkwcvJ1vLcToqLM8ipp90 X-Received: by 2002:a50:cf8b:: with SMTP id h11mr22675713edk.236.1568111941628; Tue, 10 Sep 2019 03:39:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568111941; cv=none; d=google.com; s=arc-20160816; b=hvVnhW7fznaH9QXRYi0KTkLbxIx3GG9yY6QtIWvhI78uhyojccm/KKkrnfO6q2iIGq KDropcX9chK/ZI/qsf3EsBevzMSKMDix4ExnhH7RWX9qvgxmbRKVePFtIbcal4iZtZAh Fuc/vzsRXn13ky6N7YCve+Gjq4JfZeFLjD3jR3Uh0kqytRACUip+6xHXNtSeiQSeIA4X s6dcVXy4Hioa3SKulORGSABuIMfk9dNcTamC3zFQ0rIcIbd4vxlspp/CeyfFdwAaCONw xdNKYRQJhIFyEQl3S42zwbxs3YtcPHxBhsevvGe8zpZJGt/BlLr7lBSqk289D/oVYI4j Z2Dw== 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=DyCC3oN5QH71JUakHHjEAPConBRmS2tSFKyztM41paE=; b=YnTigv5FYVh2HFrJd/KgZxU0ZgDxTdXykeINiJlwiDUfp5c+WP1wxLYExjTQp2PAwu NuA/rRwrxVv1tXkVvZMp5qOORGjf4mPSI4to3GPIgu84JaI774Bo/m10FgPmIoloH70P UnclGKAI0vcGLVqLIzdpFUNBlQF1U6oaz8MAjO3tXNCoIqgjuR4La+Fwu3rmUwgs4HgS tCuElZV9xBjVpMpAqX6JhKgCupA1R/ZlXs3lOsYND9GLpLbWPvOWv5kbHGGY/oOGrnxd aJ/VYWRLubrrX9bzb16h5FjMjiawT4gN7L68CIgfSg8FUFWiHC8acpDSjZ/cKny39VEG 5G7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FhMAYukP; 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 f9si8822356ejx.375.2019.09.10.03.39.01; Tue, 10 Sep 2019 03:39:01 -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=FhMAYukP; 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 S2406290AbfIJKi4 (ORCPT + 8 others); Tue, 10 Sep 2019 06:38:56 -0400 Received: from mail-lj1-f193.google.com ([209.85.208.193]:39956 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2406227AbfIJKiw (ORCPT ); Tue, 10 Sep 2019 06:38:52 -0400 Received: by mail-lj1-f193.google.com with SMTP id 7so15869847ljw.7 for ; Tue, 10 Sep 2019 03:38:50 -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=DyCC3oN5QH71JUakHHjEAPConBRmS2tSFKyztM41paE=; b=FhMAYukPpvDv7/gtjvzMVffNFIcDir8P7lhYYYuvZqn4IPk+26vo++/gi2+Fav2lWS 2w0rg43pR85xehveQr2y20Sf/xWGy45hcqxm7n5KfvKC2PdHKZ6azaDS0+iYJZHWv1/+ zMwP5U8nJdDKd8kvKct4XQscyL1qzi10v+C7XVeZ/0iF69+cTYXeXEAhfbRNBY468TnA VezYYJjJ+KsPBLPpikBZqQ6oUaHLKB+BF6InRcmk7Ytt+iqa3y4EEVs9FZpRxH5cotkr 7Ef3YwV3rL6+eb+gar6COnTsoDiKOZ25XOCDZqnqyhZkiIwjkVECAFNb9X0bDFAcZPXG yNFg== 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=DyCC3oN5QH71JUakHHjEAPConBRmS2tSFKyztM41paE=; b=KaIygaaOnZhvcqNG/fMaCAFqYGc14UIc5lxHbvXi362CkmzhTKmVP9SZDWQX8K7oSy 3cNDqZpRuMnhUfikw3YZlUHgxvTHRyuaNns20IW2EBFgb/cD+lBfLHXNAoBS/YJEZEmt mMKoG0q9zZ1rEGM7UqKzdtZUZ48cNFapTK7mIEY+U1BKfcuPHiH962XKHJWsPa0Y06pq 9T5CP9DwaKphmV/EO8x6CXdTWPQSLtWpL5YGPsFB/h6XMv5S5RMHrug6WB6kodXz5NXc 0f0UGUOWQdRN3zxGrU2R6gk2bFfYAyu1fvpTm83wDK4hCQYVdQK01IYOHbDzaEphbVxg cyqw== X-Gm-Message-State: APjAAAV6hzkumiFYEcakJj2nClw4Amm4dtj3DZwfGdHfANgfyx3p+ijX SjUY9CbcRZpZR1ZQqQnJzG4KIQ== X-Received: by 2002:a2e:88c6:: with SMTP id a6mr19550313ljk.39.1568111929860; Tue, 10 Sep 2019 03:38:49 -0700 (PDT) Received: from localhost.localdomain (168-200-94-178.pool.ukrtel.net. [178.94.200.168]) by smtp.gmail.com with ESMTPSA id g5sm4005563lfh.2.2019.09.10.03.38.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Sep 2019 03:38:49 -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, Ivan Khoronzhuk Subject: [PATCH bpf-next 10/11] libbpf: makefile: add C/CXX/LDFLAGS to libbpf.so and test_libpf targets Date: Tue, 10 Sep 2019 13:38:29 +0300 Message-Id: <20190910103830.20794-11-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190910103830.20794-1-ivan.khoronzhuk@linaro.org> References: <20190910103830.20794-1-ivan.khoronzhuk@linaro.org> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org In case of LDFLAGS and EXTRA_CC/CXX flags there is no way to pass them correctly to build command, for instance when --sysroot is used or external libraries are used, like -lelf, wich can be absent in toolchain. This is used for samples/bpf cross-compiling allowing to get elf lib from sysroot. Signed-off-by: Ivan Khoronzhuk --- samples/bpf/Makefile | 8 +++++++- tools/lib/bpf/Makefile | 11 ++++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) -- 2.17.1 diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile index 79c9aa41832e..4edc5232cfc1 100644 --- a/samples/bpf/Makefile +++ b/samples/bpf/Makefile @@ -186,6 +186,10 @@ ccflags-y += -I$(srctree)/tools/perf ccflags-y += $(D_OPTIONS) ccflags-y += -Wall ccflags-y += -fomit-frame-pointer + +EXTRA_CXXFLAGS := $(ccflags-y) + +# options not valid for C++ ccflags-y += -Wmissing-prototypes ccflags-y += -Wstrict-prototypes @@ -252,7 +256,9 @@ clean: $(LIBBPF): FORCE # Fix up variables inherited from Kbuild that tools/ build system won't like - $(MAKE) -C $(dir $@) RM='rm -rf' LDFLAGS= srctree=$(BPF_SAMPLES_PATH)/../../ O= + $(MAKE) -C $(dir $@) RM='rm -rf' EXTRA_CFLAGS="$(PROGS_CFLAGS)" \ + EXTRA_CXXFLAGS="$(EXTRA_CXXFLAGS)" LDFLAGS=$(PROGS_LDFLAGS) \ + srctree=$(BPF_SAMPLES_PATH)/../../ O= $(obj)/syscall_nrs.h: $(obj)/syscall_nrs.s FORCE $(call filechk,offsets,__SYSCALL_NRS_H__) diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile index c6f94cffe06e..bccfa556ef4e 100644 --- a/tools/lib/bpf/Makefile +++ b/tools/lib/bpf/Makefile @@ -94,6 +94,10 @@ else CFLAGS := -g -Wall endif +ifdef EXTRA_CXXFLAGS + CXXFLAGS := $(EXTRA_CXXFLAGS) +endif + ifeq ($(feature-libelf-mmap), 1) override CFLAGS += -DHAVE_LIBELF_MMAP_SUPPORT endif @@ -176,8 +180,9 @@ $(BPF_IN): force elfdep bpfdep $(OUTPUT)libbpf.so: $(OUTPUT)libbpf.so.$(LIBBPF_VERSION) $(OUTPUT)libbpf.so.$(LIBBPF_VERSION): $(BPF_IN) - $(QUIET_LINK)$(CC) --shared -Wl,-soname,libbpf.so.$(LIBBPF_MAJOR_VERSION) \ - -Wl,--version-script=$(VERSION_SCRIPT) $^ -lelf -o $@ + $(QUIET_LINK)$(CC) $(LDFLAGS) \ + --shared -Wl,-soname,libbpf.so.$(LIBBPF_MAJOR_VERSION) \ + -Wl,--version-script=$(VERSION_SCRIPT) $^ -lelf -o $@ @ln -sf $(@F) $(OUTPUT)libbpf.so @ln -sf $(@F) $(OUTPUT)libbpf.so.$(LIBBPF_MAJOR_VERSION) @@ -185,7 +190,7 @@ $(OUTPUT)libbpf.a: $(BPF_IN) $(QUIET_LINK)$(RM) $@; $(AR) rcs $@ $^ $(OUTPUT)test_libbpf: test_libbpf.cpp $(OUTPUT)libbpf.a - $(QUIET_LINK)$(CXX) $(INCLUDES) $^ -lelf -o $@ + $(QUIET_LINK)$(CXX) $(CXXFLAGS) $(LDFLAGS) $(INCLUDES) $^ -lelf -o $@ $(OUTPUT)libbpf.pc: $(QUIET_GEN)sed -e "s|@PREFIX@|$(prefix)|" \ From patchwork Tue Sep 10 10:38:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 173503 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp5609834ilq; Tue, 10 Sep 2019 03:38:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqyGNdq2VIX+SJfTTs1vbXyn19vJnyN5gu9Ph6Yt5W2V9YGB76TYEZ6jEff/aVadeH/c+TNE X-Received: by 2002:a50:b0c6:: with SMTP id j64mr29778493edd.267.1568111937398; Tue, 10 Sep 2019 03:38:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568111937; cv=none; d=google.com; s=arc-20160816; b=K+CSKxFUudUx2BzyoSmNtUO+9l9CVi5e/W7ZD4DaXcorZhkLJ0FYYn8wru+0GTYsqW JeplePf2yWTVIzERtXu+mM4W/6NBXheyeC+y21xDQbOPswtc0R237PVTbN1KqQkEiZQD hcc+ADI3Q8XF0NNvlfXcuxgtRRKrE0Ei35pQxR8K4UGMnIHiOy5/C/Hu1wwGgpd6IdoF yuOlyHcPJQsG9nZTPlSsTIBvX5Pz9ZUXyxaVX9OBOI9O3koyzyL3T9e93t4Ag/dP/Se0 FQRU6pbraqiTzUE8XDBvKpvRu+Ftg5kzrOeuBVTJ0Z0aX/PkWugERoK2zec2+wTZWvB4 i7Xg== 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=aOBDMFi7PSb0gHyNeqqhWN1bJP3tg81RdsZh4BrKqUw=; b=K6rLgDypbdtg3ZmnkTXxoJi0aIvDUCxNdHfKL+m2rXFGU8EMP+UAJ73jdyj+yMEK0p Fzp7nnSN1Qhvyl0MCSjab+khui1gEWdaVW/pE9ABl9GcaNyz33tTJLVotRANGye+c37O 68YHN0mzHkF/zdE/yPBL7qK8vAoBZFiXg5IFEpHnhCsrywBLSCkfhHGCIe/AHLFKtcbJ GmM2rfDRVifYAT+XSt3OsA/K3pbgLwiNzZ97ccthcL1s00/LmalDE3LX+rN9Uur390e6 G6tO0nDlogecnH2bqaPJqFvoOz4e6pBHbujYREYr+Dh3UlsG/mub/FQEJj1LrsfwQ4wU G5eQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dZCGaEuJ; 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 z2si8849107ejr.360.2019.09.10.03.38.57; Tue, 10 Sep 2019 03:38:57 -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=dZCGaEuJ; 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 S2406264AbfIJKi4 (ORCPT + 8 others); Tue, 10 Sep 2019 06:38:56 -0400 Received: from mail-lj1-f194.google.com ([209.85.208.194]:44442 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2406215AbfIJKix (ORCPT ); Tue, 10 Sep 2019 06:38:53 -0400 Received: by mail-lj1-f194.google.com with SMTP id u14so15867048ljj.11 for ; Tue, 10 Sep 2019 03:38:51 -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=aOBDMFi7PSb0gHyNeqqhWN1bJP3tg81RdsZh4BrKqUw=; b=dZCGaEuJIGUCPQEGK33Sn/a9ZXr1W2in9EPfmjnbwJAMCekhG6gPrUKBXtM9dA6Bua CO0ROLT22y9S3G5cB0fUS+NwtMDzJr6+L13qfksUvKAEex3h114d1QzyYZ8sZ6IjKuSt rkwhMTdhR2vjcycIZ/U4KfP6/DGiUOHzrf1z1Ykp5RNNE8nDy3evu9ck5pH876DEllqg sRw/k+zeukJc80NgALQN0hag/HPBhscdR5rSFY7PjS3o0+DYv3vwXnmOn0f1CoV9/JzP FG5HBwd3LzjMCIpehQQdiNtCwLoUdPyT7QvAmxLutks5bbQM/+usVCkuxFOtnq0+Q2uv 9New== 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=aOBDMFi7PSb0gHyNeqqhWN1bJP3tg81RdsZh4BrKqUw=; b=pAS/SgGz/F3Zyq6DyFzp5rMD6+Nr+mkIugWHiBodrIA8pnU7+IMN7+Xmih9oL/HSsq yKAzeKfMnsgrszzi0YX8W4SX1Rke5GqspSU0K2aYD3DLBRBRei5qq/EwfLly2ufNau/I p5wC0R0/CYxnW33ZsV9J8SXi4zNYSdaDOMjhbYAQu/6MDjaTNgYm9PT+8mpzT72jgtvd M0AyU08sz5zizsnoX4gtOIM81YE3YF7FPgQp8c2/TxF+RKu/06WoqkuYv4OTsWFcCxP9 wqgTHeSHva2yC+nfWK+kZWfcMHHzMiebmKa/Ja1mA6g2CBxIY5yeosRmvI92MndYSxz9 UPhg== X-Gm-Message-State: APjAAAWoPT/q1DQGTDXrlfbIbra2YWQvHeLInyf9P9iN4rgcNQnh1Egi bQKld0Ex2Z8ek6L9Ca9Odq27yQ== X-Received: by 2002:a2e:8012:: with SMTP id j18mr19477348ljg.36.1568111930993; Tue, 10 Sep 2019 03:38:50 -0700 (PDT) Received: from localhost.localdomain (168-200-94-178.pool.ukrtel.net. [178.94.200.168]) by smtp.gmail.com with ESMTPSA id g5sm4005563lfh.2.2019.09.10.03.38.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Sep 2019 03:38:50 -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, Ivan Khoronzhuk Subject: [PATCH bpf-next 11/11] samples: bpf: makefile: add sysroot support Date: Tue, 10 Sep 2019 13:38:30 +0300 Message-Id: <20190910103830.20794-12-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190910103830.20794-1-ivan.khoronzhuk@linaro.org> References: <20190910103830.20794-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. For sure, just make tools/include to be included after sysroot headers. export ARCH=arm export CROSS_COMPILE=arm-linux-gnueabihf- make samples/bpf/ SYSROOT="path/to/sysroot" Sysroot contains correct libs installed and its headers ofc. Useful when working with NFC or virtual machine. Signed-off-by: Ivan Khoronzhuk --- samples/bpf/Makefile | 5 +++++ samples/bpf/README.rst | 10 ++++++++++ 2 files changed, 15 insertions(+) -- 2.17.1 diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile index 4edc5232cfc1..68ba78d1dbbe 100644 --- a/samples/bpf/Makefile +++ b/samples/bpf/Makefile @@ -177,6 +177,11 @@ ifeq ($(ARCH), arm) CLANG_EXTRA_CFLAGS := $(D_OPTIONS) endif +ifdef SYSROOT +ccflags-y += --sysroot=${SYSROOT} +PROGS_LDFLAGS := -L${SYSROOT}/usr/lib +endif + ccflags-y += -I$(objtree)/usr/include ccflags-y += -I$(srctree)/tools/lib/bpf/ ccflags-y += -I$(srctree)/tools/testing/selftests/bpf/ diff --git a/samples/bpf/README.rst b/samples/bpf/README.rst index 5f27e4faca50..786d0ab98e8a 100644 --- a/samples/bpf/README.rst +++ b/samples/bpf/README.rst @@ -74,3 +74,13 @@ samples for the cross target. export ARCH=arm64 export CROSS_COMPILE="aarch64-linux-gnu-" make samples/bpf/ LLC=~/git/llvm/build/bin/llc CLANG=~/git/llvm/build/bin/clang + +If need to use environment of target board (headers and libs), the SYSROOT +also can be set, pointing on FS of target board: + +export ARCH=arm64 +export CROSS_COMPILE="aarch64-linux-gnu-" +make samples/bpf/ SYSROOT=~/some_sdk/linux-devkit/sysroots/aarch64-linux-gnu + +Setting LLC and CLANG is not necessarily if it's installed on HOST and have +in its targets appropriate arch triple (usually it has several arches).