Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1028319yba; Thu, 4 Apr 2019 02:46:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqzVkrgXzml0O7fCgKINR7HIU4FGH9urDYvKEaSldq1EuCmCp0s/99/oVB4nkFPsrn7mgKkb X-Received: by 2002:a17:902:a583:: with SMTP id az3mr5382190plb.205.1554371202278; Thu, 04 Apr 2019 02:46:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554371202; cv=none; d=google.com; s=arc-20160816; b=NNr9GhaTZGChj3eEBzh7HG3PYt07nDeTw3E9QrHiPdYgVibbF063bbnqki0gfOayC/ 93Hp70qhWP1NVUJk/OsJAQE94Q7nPfG4MzdBzr8BYbPtAEv43u0CPE9eZqtspv2G+rKx ebwdUjlFMVe+BOnTBL4vmZEi5gaqeebuuSwztCbRHOAPDf+Gp5E4YYPunq+MkbssjSt+ Ld/SeQ/srdYAp8XvGc55jpH2DwLOITj28yar1V1APue5AsKleG0TlDEoUG+0WhdCBKEI p2mVEvOGu63GWy17Y0ICIKRKaI1QEJDCzRxly8B4z6X7UKy940ijk793bkCkG7XM1Shw Zkng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=OXPTTRE42vFz29zUjZ5UXpv7ejeJL0Fr8GaBDAmExnk=; b=KI40HV3DBIbq2QzZ6bMfSJG751mfRy1dA7ChDcdrfIHzrISZL5EQt6vvuGIQcqWBtA /CdaPa/pF9GIQQTew62WJMEp+8Dn+/W61jX2JbhgA23gdDfK8tVcGLlLrIo92X0CQdUG Yf9JDTToWHtZrYfqWdpc4Cy+FdEQFDBVyY6WF/Fk/2Q7EFcqdL09zXKN7HfwMqbi6LYU nVkiqX+i7r8RiD/1j9FfqGPyZJMB7frk9s5ZDkz3rnhREqnDEO5UnV2K1avK0b75EUY3 QtWM77pGQiXKtkWmKjHa7czJAPUeK4ltJlQBpq41ykiZYYdhPH2euuy9iqyLjmTNrBob /oAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=buYBdUpF; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r63si16620643pfc.183.2019.04.04.02.46.27; Thu, 04 Apr 2019 02:46:42 -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=@kernel.org header.s=default header.b=buYBdUpF; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731118AbfDDJon (ORCPT + 99 others); Thu, 4 Apr 2019 05:44:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:36008 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730767AbfDDI7i (ORCPT ); Thu, 4 Apr 2019 04:59:38 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id AE6012075E; Thu, 4 Apr 2019 08:59:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1554368377; bh=B2RSedtcUBI+m5qdY0UreAzRYY+7w6QJmj8qpNTCdpY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=buYBdUpFhr029eCzFoL3HC4kvR+6gHScw7QXt2OQNKQadJI+WI9H/VcTBgGC0suaf nGQPOF/Kg1tCFGQdEgqPK092S6AmRBDtxBrY8h8ojXlcfIUFVmqN53dd7PVmAFXjLN Pn1LnWnV9l6CJBb+S03Lt9Tt2XgAmopsKy2UNgKk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Eric Dumazet , Stanislav Fomichev , Yonghong Song , Daniel Borkmann , Sasha Levin Subject: [PATCH 4.19 017/187] libbpf: force fixdep compilation at the start of the build Date: Thu, 4 Apr 2019 10:45:54 +0200 Message-Id: <20190404084603.903820643@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190404084603.119654039@linuxfoundation.org> References: <20190404084603.119654039@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit 8e2688876c7f7073d925e1f150e86b8ed3338f52 ] libbpf targets don't explicitly depend on fixdep target, so when we do 'make -j$(nproc)', there is a high probability, that some objects will be built before fixdep binary is available. Fix this by running sub-make; this makes sure that fixdep dependency is properly accounted for. For the same issue in perf, see commit abb26210a395 ("perf tools: Force fixdep compilation at the start of the build"). Before: $ rm -rf /tmp/bld; mkdir /tmp/bld; make -j$(nproc) O=/tmp/bld -C tools/lib/bpf/ Auto-detecting system features: ... libelf: [ on ] ... bpf: [ on ] HOSTCC /tmp/bld/fixdep.o CC /tmp/bld/libbpf.o CC /tmp/bld/bpf.o CC /tmp/bld/btf.o CC /tmp/bld/nlattr.o CC /tmp/bld/libbpf_errno.o CC /tmp/bld/str_error.o CC /tmp/bld/netlink.o CC /tmp/bld/bpf_prog_linfo.o CC /tmp/bld/libbpf_probes.o CC /tmp/bld/xsk.o HOSTLD /tmp/bld/fixdep-in.o LINK /tmp/bld/fixdep LD /tmp/bld/libbpf-in.o LINK /tmp/bld/libbpf.a LINK /tmp/bld/libbpf.so LINK /tmp/bld/test_libbpf $ head /tmp/bld/.libbpf.o.cmd # cannot find fixdep (/usr/local/google/home/sdf/src/linux/xxx//fixdep) # using basic dep data /tmp/bld/libbpf.o: libbpf.c /usr/include/stdc-predef.h \ /usr/include/stdlib.h /usr/include/features.h \ /usr/include/x86_64-linux-gnu/sys/cdefs.h \ /usr/include/x86_64-linux-gnu/bits/wordsize.h \ /usr/include/x86_64-linux-gnu/gnu/stubs.h \ /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ /usr/lib/gcc/x86_64-linux-gnu/7/include/stddef.h \ After: $ rm -rf /tmp/bld; mkdir /tmp/bld; make -j$(nproc) O=/tmp/bld -C tools/lib/bpf/ Auto-detecting system features: ... libelf: [ on ] ... bpf: [ on ] HOSTCC /tmp/bld/fixdep.o HOSTLD /tmp/bld/fixdep-in.o LINK /tmp/bld/fixdep CC /tmp/bld/libbpf.o CC /tmp/bld/bpf.o CC /tmp/bld/nlattr.o CC /tmp/bld/btf.o CC /tmp/bld/libbpf_errno.o CC /tmp/bld/str_error.o CC /tmp/bld/netlink.o CC /tmp/bld/bpf_prog_linfo.o CC /tmp/bld/libbpf_probes.o CC /tmp/bld/xsk.o LD /tmp/bld/libbpf-in.o LINK /tmp/bld/libbpf.a LINK /tmp/bld/libbpf.so LINK /tmp/bld/test_libbpf $ head /tmp/bld/.libbpf.o.cmd cmd_/tmp/bld/libbpf.o := gcc -Wp,-MD,/tmp/bld/.libbpf.o.d -Wp,-MT,/tmp/bld/libbpf.o -g -Wall -DHAVE_LIBELF_MMAP_SUPPORT -DCOMPAT_NEED_REALLOCARRAY -Wbad-function-cast -Wdeclaration-after-statement -Wformat-security -Wformat-y2k -Winit-self -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wno-system-headers -Wold-style-definition -Wpacked -Wredundant-decls -Wshadow -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wundef -Wwrite-strings -Wformat -Wstrict-aliasing=3 -Werror -Wall -fPIC -I. -I/usr/local/google/home/sdf/src/linux/tools/include -I/usr/local/google/home/sdf/src/linux/tools/arch/x86/include/uapi -I/usr/local/google/home/sdf/src/linux/tools/include/uapi -fvisibility=hidden -D"BUILD_STR(s)=$(pound)s" -c -o /tmp/bld/libbpf.o libbpf.c source_/tmp/bld/libbpf.o := libbpf.c deps_/tmp/bld/libbpf.o := \ /usr/include/stdc-predef.h \ /usr/include/stdlib.h \ /usr/include/features.h \ /usr/include/x86_64-linux-gnu/sys/cdefs.h \ /usr/include/x86_64-linux-gnu/bits/wordsize.h \ Fixes: 7c422f557266 ("tools build: Build fixdep helper from perf and basic libs") Reported-by: Eric Dumazet Signed-off-by: Stanislav Fomichev Acked-by: Yonghong Song Signed-off-by: Daniel Borkmann Signed-off-by: Sasha Levin --- tools/lib/bpf/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile index d49902e818b5..3624557550a1 100644 --- a/tools/lib/bpf/Makefile +++ b/tools/lib/bpf/Makefile @@ -149,7 +149,8 @@ CMD_TARGETS = $(LIB_FILE) TARGETS = $(CMD_TARGETS) -all: fixdep all_cmd +all: fixdep + $(Q)$(MAKE) all_cmd all_cmd: $(CMD_TARGETS) -- 2.19.1