From patchwork Mon Sep 16 10:54:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 173835 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp3338590ilq; Mon, 16 Sep 2019 03:56:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqy/uD6FhpDds8ZRwvFJF4jLRXwTijV6YSVpOmmiZ8ZGePlCvuSOy9PgwFJLsXDMvESuIQsC X-Received: by 2002:aa7:d414:: with SMTP id z20mr34719038edq.208.1568631360029; Mon, 16 Sep 2019 03:56:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568631360; cv=none; d=google.com; s=arc-20160816; b=dMc30ikULBi3ybCsMcswVFZK3jlYwRjWfS7Bwh3ExBDNW18b7pHhRL2ynQcPaeYRfM pukCKJkX7CMz06zg8as3kB8B/KJxaQgBGHTJhOLUNVPRwpF3qvFMC29+Lh43MP1Ch0Xv CJW1wnGUVm7Nks5iySZa4SvsyqSK7hp+eSIWVIdG6Ne3YMHMEyEiplkq2a4TRvyUXOMJ vSNoVWD+/dcdTDKWtmhyNBW3NAGhlSXphPi6waETmKOcQ0nwBZnieevkGI/3Ztv/LOXh +i4ULBhx18/Lujck7wNWlgxPjyIGaPChTtfFToUktbzhqJS2HNpkz0wYIeF9QkrAuGvh x5AA== 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=HSB3pC6OCIzwVYGBAJ0R7QI4CKajD+8ovp0KUKhem8g=; b=DysIAs53ek8AhkVSUcZE7Fh/vL5LyTzq1rSlebwGa3NTA3KzwB2MORoGrK2uTq3beQ 77ZKB8wmZwf0r2OsEOT1edjy93e5xAMgdYonKRE+t8bXALS/iX+vRn2Ji2cxupaHeZK2 RslCXy6XEKNAjIGUGJ0qAdXVNKHHAeNXHgRd2jlSS+Ji6yZYGowrxGtI0QgOnAFwnajW UWDIzUFEFd22ezwaQ8JwMgxfnBnngcmVCgAxkPZbG1BoEVTRsLPr+cvo8nTCSiTRyx9w A+qujJM/xjBfri9OHWd8PEISOVnN5jt+2SUVXRIO3UirB68LMe3D3KSy3r8vcgHYkFfr 2SfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pNYUSbIS; 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 j5si12386162ejm.8.2019.09.16.03.55.59; Mon, 16 Sep 2019 03:56:00 -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=pNYUSbIS; 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 S1732710AbfIPKz6 (ORCPT + 8 others); Mon, 16 Sep 2019 06:55:58 -0400 Received: from mail-lj1-f196.google.com ([209.85.208.196]:34045 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732449AbfIPKyq (ORCPT ); Mon, 16 Sep 2019 06:54:46 -0400 Received: by mail-lj1-f196.google.com with SMTP id h2so26755908ljk.1 for ; Mon, 16 Sep 2019 03:54: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=HSB3pC6OCIzwVYGBAJ0R7QI4CKajD+8ovp0KUKhem8g=; b=pNYUSbISKlAVLelxCU1TU78GP/FlR+e7TlMVVNr+WQfkvrUyOQytDZ1zL1iVg/OgZe 6p6VltOKoWLDC/bPlR07+PqlPVKShLC8jd3pdogkkTiie7b6Q6qbewuXTyHcmiDnXpI9 nexFhZb6QkDjPMIgqjqoAenm82Eo5FSyqbzu2mVY2gkxjWC6rA3RJouf7eW9/956lUwo n3ujW3x/Y0Utc6zd+V/GzPWYnPD5jAs+aoniDRHjpYyQyNDBZcy8WMo8xx8v4czDr4/y wSRreUWlENL/nESYpqKX4+K4UeYnvtu6ZqfqWthcs5MXxnIME71OVkCZMJ/i342wY9xE /9Qw== 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=HSB3pC6OCIzwVYGBAJ0R7QI4CKajD+8ovp0KUKhem8g=; b=f4t8VYLLQdRJRnfuUE0AYR0gIzTJ90nyvKsAkjEHADeE125V16gWRhkbuYPlx+mjIb HoSNrwRpJBg017ckLMPeqfTjszRskrFYoYhAB2/zCDd4Z9psZcCSTe+82L6YTebkvScD iMjfiwqSTYCYrBbf5vI9UsVtt4w327sX2X9sDQ92tTCLCfYYyWeD9aYe7AYXTxb8B9t7 GhIWlgfrTn882F4p9rAL0nW1ET0s0Sif6UqjY7+c2EuWPRk+39DTNh/vhOsdS8LN1ejY zbUcvPMxZOuNa43ZUSJhCyYXyb7MG4fZilN8JXwOd28OwQEuVXGPCCAPsz4nyqxts9kc 3Y7w== X-Gm-Message-State: APjAAAX4cPBkak1S1Nan5pB0nM2bVIk+TigbFnvlvzukehMxjYu97b3U WzrqNQ7fVH/SwFBGbrWol4XNFA== X-Received: by 2002:a2e:9b43:: with SMTP id o3mr13477947ljj.214.1568631284266; Mon, 16 Sep 2019 03:54: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 v1sm8987737lfq.89.2019.09.16.03.54.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Sep 2019 03:54:43 -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 03/14] samples: bpf: makefile: use --target from cross-compile Date: Mon, 16 Sep 2019 13:54:22 +0300 Message-Id: <20190916105433.11404-4-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: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org For cross compiling the target triple can be inherited from cross-compile prefix as it's done in CLANG_FLAGS from kernel makefile. So copy-paste this decision from kernel Makefile. 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 43dee90dffa4..b59e77e2250e 100644 --- a/samples/bpf/Makefile +++ b/samples/bpf/Makefile @@ -195,7 +195,7 @@ 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 $(ARCH) +CLANG_ARCH_ARGS = --target=$(notdir $(CROSS_COMPILE:%-=%)) endif # Don't evaluate probes and warnings if we need to run make recursively From patchwork Mon Sep 16 10:54: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: 173824 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp3337765ilq; Mon, 16 Sep 2019 03:54:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqxHI2Ij2QlbZTiqEDrSRetslBog1nEci21vYH2YXVh2B5kFud65NqbUaaHJLFdUV2kutLLL X-Received: by 2002:a17:906:5c49:: with SMTP id c9mr51499759ejr.78.1568631292996; Mon, 16 Sep 2019 03:54:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568631292; cv=none; d=google.com; s=arc-20160816; b=TMUu+/eLZ0PyIrOFIdeBLLLHvT+Bez/n5MGGmcbnQQKSZvUj5p5ySCIPvWfEJqoylx 3wAT0yDDlVlQh7/5K3GaRsmyAxu1shU61D+GQcRhM/v1V3ieJUSNeo3Xo1JXxSnwohq4 imQIs3m+D1NDUmQzesWaMEY5ZhLavqCcYsJXXL3r+1dDZSfPobdGIXHwYaqKo4+D1mRX 91PkBJRoZY7CYv9o6DI/8FE61SB5BDSzH36/wa27vrec+qmn0GWR8mr2I6OuWXCqdE4E Mr7qc+w61uZXrUZ5koOr1dj7IYdBuXhyFHyrmYycRXMSwZjkRax6fJwerTbam0kIb2HY vcxg== 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=xNkLu+F5ireDmv2ECKHCPKSs+JQa9jVM7EkUURjr0ngnqx7EKm44q6S7vbrfU8iXnY KOD9tYgqhO8IDjm6q7Z0HaL+76vfq6kUbejggeWJ5ssts6NXvWjjbs2/ZmZbEaINBMfb e4TqHC2MbcTJ+SLO4b5xO/c5bs2fdoIKCS5Jhbn0ozffbX664W67dbXfHK8X9CqzKiSo VsNqJKaVlZ67pbn43/eO8of+NQ7POWeTpFG31YMaDoNhsOV50TdFzeo1wTIFhY5/6T5x PRuLgUGsVB1d/i+K36teaLS7AdN0ZdiQdKrUeYv1b/LP3nkr8/ja3obV/OvG9lGwwaN1 LTxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="g/BAdg0U"; 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 j46si21629887eda.9.2019.09.16.03.54.52; Mon, 16 Sep 2019 03:54:52 -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="g/BAdg0U"; 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 S1732490AbfIPKyt (ORCPT + 8 others); Mon, 16 Sep 2019 06:54:49 -0400 Received: from mail-lf1-f65.google.com ([209.85.167.65]:34901 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732462AbfIPKys (ORCPT ); Mon, 16 Sep 2019 06:54:48 -0400 Received: by mail-lf1-f65.google.com with SMTP id w6so27101016lfl.2 for ; Mon, 16 Sep 2019 03:54:46 -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=g/BAdg0UimHeaUICEhjEtr4KxeDpY3VrRM+S2Z5GVOPRjc288L3c92wXp0NENhu5ZG SVF1bEXuZoCRXflIqRO8ftu3gBiqprEwR3nlJWXBVvgk1qHQyjzdjDXnKz08VQh2gsLa 0C5RaVzyQ/Lq2tJP6QdWJx7RY7WyTyjvsjXnHIcA2zyhsx8zB0FVzByiOO+TZ0Jg74TR 9Yf697+zDIr/nGnizNYyFhZloRMFYJlZYkYVnFK2KODhnMLe7dvoUhvgx3MpOosxicSF cOoNOupkXaFXHIWPDAdLb71YsQEqxdw5ZL/A3ipVUT/acTMFAY7YPn2FvXecNkxjF8Xa KngQ== 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=CKCm7Ql095bDp4eY1BWlfKReCg/7+bLjdD/DG0te4HB8R4JIkf+OJW2aU1hpFT8QWh ipERlSOd5B+B9pMquioPuQbK8jQcCWt6w2YWhmSlXoFuEC2wLxXDpnvtHftZG22rlmw8 ABe4vZkj24vM5eW2DnM6fdcaizMgE7E0SXZx/B381hEj9/XUXlMBHjldfjWKIbiBIFZz LZgvdAPPrEFxzr+KCsJjTCL4TnsTL40q9LWNHm3bnCc3kRWND1TK42Y1ZOrrH5zLOYCe 9Q4uoIMX2MM+lg7ws20BdBpYm6o+QncsmlWH+QaZfConrHTb1E1fpT6G3nu3gExc/JL5 MsXw== X-Gm-Message-State: APjAAAWetvHdSDvhBBgwlnpDf76mtqJOADCVa+TgrQ8d7WnYsscJalPb BzD6AzOzN6DTkPaWM71OBPd/pg== X-Received: by 2002:ac2:4552:: with SMTP id j18mr12491200lfm.120.1568631285526; Mon, 16 Sep 2019 03:54:45 -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.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Sep 2019 03:54: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, sergei.shtylyov@cogentembedded.com, Ivan Khoronzhuk Subject: [PATCH v3 bpf-next 04/14] samples: bpf: use own EXTRA_CFLAGS for clang commands Date: Mon, 16 Sep 2019 13:54:23 +0300 Message-Id: <20190916105433.11404-5-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: 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 Mon Sep 16 10:54:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 173828 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp3337880ilq; Mon, 16 Sep 2019 03:55:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqw2JGBp4q6QMq42bWb0nQNpOAOGfyiu1OpDsgmagSzG0aeXfqwrXtC79JdsjxL+mxeOaIbi X-Received: by 2002:a17:907:2042:: with SMTP id pg2mr5084930ejb.97.1568631300227; Mon, 16 Sep 2019 03:55:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568631300; cv=none; d=google.com; s=arc-20160816; b=b2yLDhjOU9QzKF3M38jPpPfuBYY1L6JYk8BYBXA58ep7ui4sZoPe9jwe2fhU7iuG+g t4igIf1+cJjX7vFsF7NbJhcVjr5mNqKbZp41HZvpd09dsOr5/XpVq7llLrgT8Nj4+FhS yKFoQ16ceTh/H1VAQrkf5eyBRrQs0bOSL2V3pzz6fT5qGgqlEiTETxvPcDXuJG0x6iZP L+OwyfYbX0QWyfeNKPTC0Wm5LIJSyxxv/DJQKHmnyBoQlp8C0qpZjKHilt7BUkAirr0c ZrFmE2hIuHMoCNR/XS4PfCYRbmBfXotrkQDfpWRqyGtjpRG6Vke6FDTzu+IKAaqCLlFd B+xQ== 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=QxDLxAts+okFnGMG90FFtyZRtrZ/DaW/PKK2HTvYn5U=; b=txKhHQgh8qS0EkAv1NfxQHKyExNlk8idvqKKG6HCEWBaa7ONX16mT3BUqNGgYJ3A7b hoy7b1OTfW4OhZm1zjD/ims8ky6e5MM6fI1fKjdmudOuxPDfW9PVEP4+bxqSp8vbtCGA AO0Qdmil7j85IzpLyBlvSf4ZIs5oxb2KnH7Sqz3MR5WLtDDjoujbrH2SNYZPQ8L3x00C vY5HufOXpnoNE17HFHCrHIa5UOQTWNvQaj3HTLx84M/MDwhTXofhme5yYi5K344eGKhl igff5Wqf6nwowoxSkPSgI/UcCHIxf7J4Jtwno73i8qJMtBtMWfCcaE+qlXL3oTOP62R3 rR0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VnA52KFS; 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 i24si20524048edj.207.2019.09.16.03.55.00; Mon, 16 Sep 2019 03:55:00 -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=VnA52KFS; 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 S1732543AbfIPKyz (ORCPT + 8 others); Mon, 16 Sep 2019 06:54:55 -0400 Received: from mail-lj1-f195.google.com ([209.85.208.195]:42235 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732442AbfIPKyy (ORCPT ); Mon, 16 Sep 2019 06:54:54 -0400 Received: by mail-lj1-f195.google.com with SMTP id y23so33248836lje.9 for ; Mon, 16 Sep 2019 03:54: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=QxDLxAts+okFnGMG90FFtyZRtrZ/DaW/PKK2HTvYn5U=; b=VnA52KFSIyWMQb3/Iooa7EUs1aAXC0kYjZ0Il4q+2f33ttNnkrwJCJS5cIhuSV/8L+ JGGb5BMD2HXDU26gIyZm1rdD9CayW+BRe6usHa2bHSpJRsZ2uOB91FuQazlfqrZCRxrS v8EPFdm6HoxVpoByWOnjxnuejb+O0rGAtiqrh6wEVPImF/i8ca2RS7Q8g8B2xm/a5+fL 6094aS40v6CdjQecIi2vX8r2PPJpIeeYXClUuX9jK151mMz6LlgZvQtAEijqvEZcZYaZ KFjxLLsFntLvICjxu8Eiz+ff2wgGgl02YeZrhRni6ZM0sECdmJysWa2IaxK2MVUslDDV gHyg== 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=QxDLxAts+okFnGMG90FFtyZRtrZ/DaW/PKK2HTvYn5U=; b=RiNbgAWOunMxnrGrLHZV+MZYzctmjvM01XVRUOixLx2LPvogT26ZGcrmFXvHk7tOPt 0OksED3r2Vf0Y5kqu0Sz2+4wGaduOgUoXpKJ9shoBDAgqjCO5tg+U2Nn+FUngn6QMOIJ aReuEK+or0n47IofERnoq0kgG5gxLfSy9vtfimZtguT2T4oP7qU/WX9qVxgpMP/3cKXB yGu2KHKd13O4D60wzJcCb8sVLuVkfeyEqU3YiOZq5o8oevBy9c9QotHLzZEOYva5O8VZ dYh5YP/1SMQdhoePQokY++eWYOUeux2JNnJN7cTvTXy0+QEEW7wxE2WNfiO/6RkgKuY1 LiEA== X-Gm-Message-State: APjAAAXnOvZiAYKTR4oNbUw4tkOcLBB80OoXfLEfRDY6vXtHVnSJTZ4m 4wQ3WF2BnDppFLxH90qyYSWM5w== X-Received: by 2002:a2e:b16b:: with SMTP id a11mr23700854ljm.83.1568631290649; Mon, 16 Sep 2019 03:54: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 v1sm8987737lfq.89.2019.09.16.03.54.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Sep 2019 03:54: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, sergei.shtylyov@cogentembedded.com, Ivan Khoronzhuk Subject: [PATCH v3 bpf-next 08/14] samples: bpf: makefile: base target programs rules on Makefile.target Date: Mon, 16 Sep 2019 13:54:27 +0300 Message-Id: <20190916105433.11404-9-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: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The main reason for that - HOSTCC and CC have different aims. HOSTCC is used to build programs running on host, that can cross-comple target programs with CC. It was tested for arm and arm64 cross compilation, based on linaro toolchain, but should work for others. So, in order to split cross compilation (CC) with host build (HOSTCC), lets base samples on Makefile.target. It allows to cross-compile samples/bpf programs with CC while auxialry tools running on host built with HOSTCC. Signed-off-by: Ivan Khoronzhuk --- samples/bpf/Makefile | 135 ++++++++++++++++++++++--------------------- 1 file changed, 69 insertions(+), 66 deletions(-) -- 2.17.1 diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile index 9d923546e087..1579cc16a1c2 100644 --- a/samples/bpf/Makefile +++ b/samples/bpf/Makefile @@ -4,55 +4,53 @@ BPF_SAMPLES_PATH ?= $(abspath $(srctree)/$(src)) TOOLS_PATH := $(BPF_SAMPLES_PATH)/../../tools # List of programs to build -hostprogs-y := test_lru_dist -hostprogs-y += sock_example -hostprogs-y += fds_example -hostprogs-y += sockex1 -hostprogs-y += sockex2 -hostprogs-y += sockex3 -hostprogs-y += tracex1 -hostprogs-y += tracex2 -hostprogs-y += tracex3 -hostprogs-y += tracex4 -hostprogs-y += tracex5 -hostprogs-y += tracex6 -hostprogs-y += tracex7 -hostprogs-y += test_probe_write_user -hostprogs-y += trace_output -hostprogs-y += lathist -hostprogs-y += offwaketime -hostprogs-y += spintest -hostprogs-y += map_perf_test -hostprogs-y += test_overhead -hostprogs-y += test_cgrp2_array_pin -hostprogs-y += test_cgrp2_attach -hostprogs-y += test_cgrp2_sock -hostprogs-y += test_cgrp2_sock2 -hostprogs-y += xdp1 -hostprogs-y += xdp2 -hostprogs-y += xdp_router_ipv4 -hostprogs-y += test_current_task_under_cgroup -hostprogs-y += trace_event -hostprogs-y += sampleip -hostprogs-y += tc_l2_redirect -hostprogs-y += lwt_len_hist -hostprogs-y += xdp_tx_iptunnel -hostprogs-y += test_map_in_map -hostprogs-y += per_socket_stats_example -hostprogs-y += xdp_redirect -hostprogs-y += xdp_redirect_map -hostprogs-y += xdp_redirect_cpu -hostprogs-y += xdp_monitor -hostprogs-y += xdp_rxq_info -hostprogs-y += syscall_tp -hostprogs-y += cpustat -hostprogs-y += xdp_adjust_tail -hostprogs-y += xdpsock -hostprogs-y += xdp_fwd -hostprogs-y += task_fd_query -hostprogs-y += xdp_sample_pkts -hostprogs-y += ibumad -hostprogs-y += hbm +tprogs-y := test_lru_dist +tprogs-y += sock_example +tprogs-y += fds_example +tprogs-y += sockex1 +tprogs-y += sockex2 +tprogs-y += sockex3 +tprogs-y += tracex1 +tprogs-y += tracex2 +tprogs-y += tracex3 +tprogs-y += tracex4 +tprogs-y += tracex5 +tprogs-y += tracex6 +tprogs-y += tracex7 +tprogs-y += test_probe_write_user +tprogs-y += trace_output +tprogs-y += lathist +tprogs-y += offwaketime +tprogs-y += spintest +tprogs-y += map_perf_test +tprogs-y += test_overhead +tprogs-y += test_cgrp2_array_pin +tprogs-y += test_cgrp2_attach +tprogs-y += test_cgrp2_sock +tprogs-y += test_cgrp2_sock2 +tprogs-y += xdp1 +tprogs-y += xdp2 +tprogs-y += xdp_router_ipv4 +tprogs-y += test_current_task_under_cgroup +tprogs-y += trace_event +tprogs-y += sampleip +tprogs-y += tc_l2_redirect +tprogs-y += lwt_len_hist +tprogs-y += xdp_tx_iptunnel +tprogs-y += test_map_in_map +tprogs-y += xdp_redirect_map +tprogs-y += xdp_redirect_cpu +tprogs-y += xdp_monitor +tprogs-y += xdp_rxq_info +tprogs-y += syscall_tp +tprogs-y += cpustat +tprogs-y += xdp_adjust_tail +tprogs-y += xdpsock +tprogs-y += xdp_fwd +tprogs-y += task_fd_query +tprogs-y += xdp_sample_pkts +tprogs-y += ibumad +tprogs-y += hbm # Libbpf dependencies LIBBPF = $(TOOLS_PATH)/lib/bpf/libbpf.a @@ -111,7 +109,7 @@ ibumad-objs := bpf_load.o ibumad_user.o $(TRACE_HELPERS) hbm-objs := bpf_load.o hbm.o $(CGROUP_HELPERS) # Tell kbuild to always build the programs -always := $(hostprogs-y) +always := $(tprogs-y) always += sockex1_kern.o always += sockex2_kern.o always += sockex3_kern.o @@ -170,21 +168,6 @@ always += ibumad_kern.o always += hbm_out_kern.o always += hbm_edt_kern.o -KBUILD_HOSTCFLAGS += -I$(objtree)/usr/include -KBUILD_HOSTCFLAGS += -I$(srctree)/tools/lib/bpf/ -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 += -Wno-unused-variable - -KBUILD_HOSTLDLIBS += $(LIBBPF) -lelf -HOSTLDLIBS_tracex4 += -lrt -HOSTLDLIBS_trace_output += -lrt -HOSTLDLIBS_map_perf_test += -lrt -HOSTLDLIBS_test_overhead += -lrt -HOSTLDLIBS_xdpsock += -pthread - ifeq ($(ARCH), arm) # Strip all except -D__LINUX_ARM_ARCH__ option needed to handle linux # headers when arm instruction set identification is requested. @@ -192,9 +175,27 @@ ARM_ARCH_SELECTOR = $(shell echo "$(KBUILD_CFLAGS) " | \ sed 's/[[:blank:]]/\n/g' | sed '/^-D__LINUX_ARM_ARCH__/!d') CLANG_EXTRA_CFLAGS := $(ARM_ARCH_SELECTOR) -KBUILD_HOSTCFLAGS := $(ARM_ARCH_SELECTOR) +TPROGS_CFLAGS += $(ARM_ARCH_SELECTOR) endif +TPROGS_LDLIBS := $(KBUILD_HOSTLDLIBS) +TPROGS_CFLAGS += $(KBUILD_HOSTCFLAGS) $(HOST_EXTRACFLAGS) +TPROGS_CFLAGS += -I$(objtree)/usr/include +TPROGS_CFLAGS += -I$(srctree)/tools/lib/bpf/ +TPROGS_CFLAGS += -I$(srctree)/tools/testing/selftests/bpf/ +TPROGS_CFLAGS += -I$(srctree)/tools/lib/ +TPROGS_CFLAGS += -I$(srctree)/tools/include +TPROGS_CFLAGS += -I$(srctree)/tools/perf + +TPROGCFLAGS_bpf_load.o += -Wno-unused-variable + +TPROGS_LDLIBS += $(LIBBPF) -lelf +TPROGLDLIBS_tracex4 += -lrt +TPROGLDLIBS_trace_output += -lrt +TPROGLDLIBS_map_perf_test += -lrt +TPROGLDLIBS_test_overhead += -lrt +TPROGLDLIBS_xdpsock += -pthread + # Allows pointing LLC/CLANG to a LLVM backend with bpf support, redefine on cmdline: # make samples/bpf/ LLC=~/git/llvm/build/bin/llc CLANG=~/git/llvm/build/bin/clang LLC ?= llc @@ -285,6 +286,8 @@ $(obj)/hbm_out_kern.o: $(src)/hbm.h $(src)/hbm_kern.h $(obj)/hbm.o: $(src)/hbm.h $(obj)/hbm_edt_kern.o: $(src)/hbm.h $(src)/hbm_kern.h +-include $(BPF_SAMPLES_PATH)/Makefile.target + # asm/sysreg.h - inline assembly used by it is incompatible with llvm. # But, there is no easy way to fix it, so just exclude it since it is # useless for BPF samples. From patchwork Mon Sep 16 10:54: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: 173827 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp3337890ilq; Mon, 16 Sep 2019 03:55:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqzuPCA6jEhHHfz7iCMhzCe28B7DrYAVdf9P01kZrc+rGMh+ZuT/aCozI7KAvEwaaGHf2Gtn X-Received: by 2002:aa7:c1d0:: with SMTP id d16mr50556601edp.82.1568631300889; Mon, 16 Sep 2019 03:55:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568631300; cv=none; d=google.com; s=arc-20160816; b=EA9RVPi9oSHW3vBNTbcZX8ILC/DQV/FZJFOhkGB+4iL7qokWWdtaSQMdgrm7K4vCHx nfMHOPF3ot+7nxTtMobRIls3cmDPsqQ65IfIT9mFxjbB/md0CbqIQSioWjupyQrKnJQf WmSGQ1drWQtcJ/X9PqU/8IANNQr82Td0azPjrZw9SG7hv1OmX4O6pLgPep8gl/uR8H4V 3YADtWR2btqNl2EHa0o8bl1RV0fHPPqNJwViM8fdWHHwR483bu5GngFa65E/0DScoIhB JO/53p6WLZRWk/HaLk7Cofyt0Ppf0J47Nb8ts3JvPe+4PlmBFihegOIDGaPMTQQkzTXl 115A== 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=awMC2NNgYQwIhWG3qRO8zKuB3GE6M/09XFXZ6Czatbc=; b=NZe/MJD+fwU/5r5x2KoNREA/6sS8yHaOwarniwMGn4Ya8D03CET5Nfb2NCBR1I22Qt upfa8CDPIbo/4blUnP1n3JXApIzGgWHRopz1/MC/eUHE1C1vlBdMB8BMcJ5r2zSm7Cln EDcDI3cIQuK8oZyMKjYsat+0DBXRkorSyHvHugGJ1DPmZfiWpqgoDVjp98RsiywORF91 PdkzzDVymikAasylKvDAq4X3RoGBh3OFhQOd3sN5JQKuchYoaLMti155qIepRjoI8AAX 5YtL0x9AG1TR7pgDoG1fBJZfWI8BC3nqUTV4+mCEQDD4ZdWv7IOHt3M8Fg7o+yfYDZvp g9LA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fA1ZBPhj; 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 i24si20524048edj.207.2019.09.16.03.55.00; Mon, 16 Sep 2019 03:55:00 -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=fA1ZBPhj; 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 S1732581AbfIPKy6 (ORCPT + 8 others); Mon, 16 Sep 2019 06:54:58 -0400 Received: from mail-lj1-f195.google.com ([209.85.208.195]:37605 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732510AbfIPKyz (ORCPT ); Mon, 16 Sep 2019 06:54:55 -0400 Received: by mail-lj1-f195.google.com with SMTP id c22so5455809ljj.4 for ; Mon, 16 Sep 2019 03:54:52 -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=awMC2NNgYQwIhWG3qRO8zKuB3GE6M/09XFXZ6Czatbc=; b=fA1ZBPhjkBsytlESQk6kpCQlXY2ePyrNVBUlN9vF9PL4a+tBgZiDhVywUcbg19c3Bt AFVvZR1wfpLJcovFqZU/aQsKJXekdUri03k6Na1iWOGfp6K6Dp58O6CN7NSB6SPDLpfg GXozVCNmNMDLClTQ87gCKyH9LKAUpqI+k+Kbnp0FZ2PA94mpFRY1q5zyGP+aXEbwImgB OFvOewfBoSVb3rMrGhZmnr3GGZ/Ajob3fWyYwb1F8nLz6YwfPnoTqeH9KHRQvED/7xCu AUV1acvpatip1LNApKO+AX58CTgYVBaSdpoGIR9HXyn994giZy6+fdPsNDCYKKXBskWH 9zdw== 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=awMC2NNgYQwIhWG3qRO8zKuB3GE6M/09XFXZ6Czatbc=; b=bUlminGbHj82mIDS8WJ1F9OEZ8jtaNytI06kgDMT+bgLaqV0tp8QA8mYPimwsEPM9t q5gt4PEmsr3UU8Xt0LiNbjJsjWZhJWpoPL7meDKakirrDS3HWURPqkBxowCK8ENYd/Dj tw3HaZnN5/wCLezaZd+sh4aZAlWdNv+gmvpmFmj4erhGktQ9BXRiuTo5xBkCwdwwf41+ kACdR8vnBfi+JwW3iTotbl1qSrlVEpQqh59hrAyHdWfm1zJyJp6eKThE4xD3kZRMfyOg zIzwitT7g5M9xp+ITW9NiwSJun+gfo0f48Bz1pIaKqyRPdU8L8SkUrgd0w8vxW2RUJGv yGNw== X-Gm-Message-State: APjAAAVhGpkDsexGrAgH2lY/loNeu3OqOfD5GI0y4RJSGIxqUkuNP+ie bqqsUqlSZ0w4cOYSakLhrL5QwQ== X-Received: by 2002:a2e:98d2:: with SMTP id s18mr5649688ljj.68.1568631292008; Mon, 16 Sep 2019 03:54:52 -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.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Sep 2019 03:54:51 -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 09/14] samples: bpf: makefile: use own flags but not host when cross compile Date: Mon, 16 Sep 2019 13:54:28 +0300 Message-Id: <20190916105433.11404-10-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: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org While compile natively, the hosts cflags and ldflags are equal to ones used from HOSTCFLAGS and HOSTLDFLAGS. When cross compiling it should have own, used for target arch. While verification, for arm, arm64 and x86_64 the following flags were used alsways: -Wall -O2 -fomit-frame-pointer -Wmissing-prototypes -Wstrict-prototypes So, add them as they were verified and used before adding Makefile.target, but anyway limit it only for cross compile options as for host can be some configurations when another options can be used, So, for host arch samples left all as is, it allows to avoid potential option mistmatches for existent environments. Signed-off-by: Ivan Khoronzhuk --- samples/bpf/Makefile | 9 +++++++++ 1 file changed, 9 insertions(+) -- 2.17.1 diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile index 1579cc16a1c2..b5c87a8b8b51 100644 --- a/samples/bpf/Makefile +++ b/samples/bpf/Makefile @@ -178,8 +178,17 @@ CLANG_EXTRA_CFLAGS := $(ARM_ARCH_SELECTOR) TPROGS_CFLAGS += $(ARM_ARCH_SELECTOR) endif +ifdef CROSS_COMPILE +TPROGS_CFLAGS += -Wall +TPROGS_CFLAGS += -O2 +TPROGS_CFLAGS += -fomit-frame-pointer +TPROGS_CFLAGS += -Wmissing-prototypes +TPROGS_CFLAGS += -Wstrict-prototypes +else TPROGS_LDLIBS := $(KBUILD_HOSTLDLIBS) TPROGS_CFLAGS += $(KBUILD_HOSTCFLAGS) $(HOST_EXTRACFLAGS) +endif + TPROGS_CFLAGS += -I$(objtree)/usr/include TPROGS_CFLAGS += -I$(srctree)/tools/lib/bpf/ TPROGS_CFLAGS += -I$(srctree)/tools/testing/selftests/bpf/ From patchwork Mon Sep 16 10:54: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: 173826 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp3337886ilq; Mon, 16 Sep 2019 03:55:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqw/GhS0qEjsaowKu6oNYMevUxoPmA1WuY6Up1XzehvnGwfPA5VKVzUDbCDA5d+vq8WgU57Z X-Received: by 2002:a50:e005:: with SMTP id e5mr60778943edl.279.1568631300566; Mon, 16 Sep 2019 03:55:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568631300; cv=none; d=google.com; s=arc-20160816; b=up5eTlGhZh4BIeQE8HcTon58y2Pm16YyGTa9dzSE1jzUQ1PHM/ikQ5QySYB5k4mBA+ p737yjdFk2FY7OtZlda7aY7zoScECNTpz/tzNWIBfAfmhZJYhl8wQBrRXkEG0BMzDx+I AiC5cmokrK6vkaAf9qFvdfBk34gNVsqKsAAeMpTv63ifhpUuCSMrRNx5GH7tNkxKaLXX 4zEDoxcTLvsadju+A/pdMBysgFgFptt2SfqUi6cxhjp4AdhTiyJXgWe6FNjLEBnFy2gS LlY1vq0h4xAGa+sSvQWj64aQiRP5N0XqlWUsvz2Sgk2ikNKLytMbac9mQM+9FPROLZGz cxPA== 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=9NLfs5AbYJF7ESK5xuIslXoD/IqVsX2Fckqfe1g6VEo=; b=oUbSssBhZfYbYLn4d+kXSMlPEVpDcEv/0hPt9UYRCnVcA7efWmr/Ku5u9PhqL86B62 6mqFIu1k75kttqElyJoZz228Iahxr+JCK7FR3LBj+6TATf3PgEUlHqk6XkyNBw1UeMDs InSolV71034jOYGURHHrtqGU/aU0IrEbWTOZcQjlokUzaX3u3D+YazxcsXhRFtkUYuon jdw6kY+tk3+gblB/QEaASJqoMNKlffvnsPbb8Cu2QImiswNB/sPxP19Q5OaWRl1fN1dM qjku2rHNa5E1rvQjemPKd9jwbB+CQInpv1+iUu1cTf2o0Md6ioKQcqQvLFhIGnXCOlgA 2VFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cgMjU9Vg; 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 i24si20524048edj.207.2019.09.16.03.55.00; Mon, 16 Sep 2019 03:55:00 -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=cgMjU9Vg; 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 S1732502AbfIPKy4 (ORCPT + 8 others); Mon, 16 Sep 2019 06:54:56 -0400 Received: from mail-lf1-f68.google.com ([209.85.167.68]:37542 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732536AbfIPKyz (ORCPT ); Mon, 16 Sep 2019 06:54:55 -0400 Received: by mail-lf1-f68.google.com with SMTP id w67so27072530lff.4 for ; Mon, 16 Sep 2019 03:54:54 -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=9NLfs5AbYJF7ESK5xuIslXoD/IqVsX2Fckqfe1g6VEo=; b=cgMjU9VgF66MpK+7cYVgFwTXHUUXY3RP+fbPS5mQhKXJebmvwfYOjylIzcce/vVR2v S+Q2ARJDsEjUmMLBvWPgyIemeej5MAEsmwCTWAXgyiGhlec/IcmFIuHE2w4MGODPMnAL bgDdARhEqXqiXSVKGttt9Ic2kiDIxJTYWpr2QZ7eq3Kq+vb+xaaUiKWqbP9RCl+1FVGm wfSdI25syQcaHAndrFmcwKOMieb7zGLpuNLod/Jgak9EvgP2vCbT3KakYeCI222YAi3Q rIJRdyU1aAK7zl8igzE+e9wcGVBm2kmpvFM6x9RBSAu1gfp0/WZI11dbglu9eIbMMPe8 0n0Q== 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=9NLfs5AbYJF7ESK5xuIslXoD/IqVsX2Fckqfe1g6VEo=; b=WKtMsMoQvv1Llp9uxNlHHKdgsGeapjLRtj6tK4oeGxjZHJudlomjo2HgbU4YGtfouz 7LF5ksyOW/fs3XpFjVT664dkK3cZWqQir/NGEHxkqtPEYwSEiiprRA+9urLJoeCSKQfB lZE8A9026k+n1e3bJ77kLuEGGOTyz13ZK1rSzArgetcQhWVAjyfTb1hCynLrAPoz3bLS kTCFePCJNiVXNjvHLOSx8JU6ZGoWavUx46ql4cooy4+D7hwktUJkpNNmM0q9JtZ5PCMX C1HuT/eXPU0vZ4vWcNKY0crvn1VTcfFfS2JueFjl7/MYoEyEHpeKGYARJh7MDyrYZdK8 W45A== X-Gm-Message-State: APjAAAXNDAvfdaA7YmOiFadMSkNropt0JXIFq+kAPA95z7wBccnu+jZW ZaeNtTu/hKtEbjvMMgeeSu4+mQ== X-Received: by 2002:ac2:5a19:: with SMTP id q25mr15112277lfn.178.1568631293376; Mon, 16 Sep 2019 03:54:53 -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.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Sep 2019 03:54:52 -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 10/14] samples: bpf: makefile: use target CC environment for HDR_PROBE Date: Mon, 16 Sep 2019 13:54:29 +0300 Message-Id: <20190916105433.11404-11-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: 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 target 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 b5c87a8b8b51..18ec22e7b444 100644 --- a/samples/bpf/Makefile +++ b/samples/bpf/Makefile @@ -214,15 +214,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) $(TPROGS_CFLAGS) $(TPROGS_LDFLAGS) -x c - \ + -o /dev/null 2>/dev/null && echo okay) ifeq ($(HDR_PROBE),) $(warning WARNING: Detected possible issues with include path.)