From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2D760C433E5 for ; Tue, 14 Jul 2020 09:01:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F11EE21D7A for ; Tue, 14 Jul 2020 09:01:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="ULC7ZQY0" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726437AbgGNJBF (ORCPT ); Tue, 14 Jul 2020 05:01:05 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:24543 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726187AbgGNJBF (ORCPT ); Tue, 14 Jul 2020 05:01:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594717264; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=0ed3Xocn2VEJ7JZTYR0y+4DEJWtAkhtN40Gvl92+Xn0=; b=ULC7ZQY0kRtLnp1MZEm2h1sR8P8SpGAv7+AQCF0A51a22JBpylFZB2byFZLMsMNBFTuJU3 8OLcepX9Bq/RWq9Mso4RhM6r4HXr/zioIF8Aj5H/+lpIXZIm9OhUIZmfRzzC1F/VvbBr2n cRngrXsMw2I6Wnyi/tZQoSWQ/zysQXo= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-341-eftPBnxdNtuDoNxCfsMStA-1; Tue, 14 Jul 2020 05:01:01 -0400 X-MC-Unique: eftPBnxdNtuDoNxCfsMStA-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0C77D109D; Tue, 14 Jul 2020 09:00:52 +0000 (UTC) Received: from krava (unknown [10.40.193.14]) by smtp.corp.redhat.com (Postfix) with SMTP id 227AD5C679; Tue, 14 Jul 2020 09:00:49 +0000 (UTC) Date: Tue, 14 Jul 2020 11:00:48 +0200 From: Jiri Olsa To: Stephen Rothwell Cc: Daniel Borkmann , Alexei Starovoitov , Networking , Linux Next Mailing List , Linux Kernel Mailing List , Jiri Olsa Subject: Re: linux-next: build warning after merge of the bpf-next tree Message-ID: <20200714090048.GG183694@krava> References: <20200714121608.58962d66@canb.auug.org.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200714121608.58962d66@canb.auug.org.au> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 14, 2020 at 12:16:08PM +1000, Stephen Rothwell wrote: > Hi all, > > After merging the bpf-next tree, today's linux-next build (powerpc > ppc64_defconfig) produced this warning: > > ld: warning: orphan section `.BTF_ids' from `kernel/trace/bpf_trace.o' being placed in section `.BTF_ids' > ld: warning: orphan section `.BTF_ids' from `kernel/bpf/btf.o' being placed in section `.BTF_ids' > ld: warning: orphan section `.BTF_ids' from `kernel/bpf/stackmap.o' being placed in section `.BTF_ids' > ld: warning: orphan section `.BTF_ids' from `net/core/filter.o' being placed in section `.BTF_ids' > ld: warning: orphan section `.BTF_ids' from `kernel/trace/bpf_trace.o' being placed in section `.BTF_ids' > ld: warning: orphan section `.BTF_ids' from `kernel/bpf/btf.o' being placed in section `.BTF_ids' > ld: warning: orphan section `.BTF_ids' from `kernel/bpf/stackmap.o' being placed in section `.BTF_ids' > ld: warning: orphan section `.BTF_ids' from `net/core/filter.o' being placed in section `.BTF_ids' > ld: warning: orphan section `.BTF_ids' from `kernel/trace/bpf_trace.o' being placed in section `.BTF_ids' > ld: warning: orphan section `.BTF_ids' from `kernel/bpf/btf.o' being placed in section `.BTF_ids' > ld: warning: orphan section `.BTF_ids' from `kernel/bpf/stackmap.o' being placed in section `.BTF_ids' > ld: warning: orphan section `.BTF_ids' from `net/core/filter.o' being placed in section `.BTF_ids' > > Presumably ntroduced by the merge of the resolve_btfids branch. missing one more #ifdef.. chage below fixes it for me, it's squashed with the fix for the arm build, I'll post both fixes today thanks, jirka --- diff --git a/include/linux/btf_ids.h b/include/linux/btf_ids.h index fe019774f8a7..2f9754a4ab2b 100644 --- a/include/linux/btf_ids.h +++ b/include/linux/btf_ids.h @@ -3,6 +3,8 @@ #ifndef _LINUX_BTF_IDS_H #define _LINUX_BTF_IDS_H +#ifdef CONFIG_DEBUG_INFO_BTF + #include /* for __PASTE */ /* @@ -21,7 +23,7 @@ asm( \ ".pushsection " BTF_IDS_SECTION ",\"a\"; \n" \ ".local " #symbol " ; \n" \ -".type " #symbol ", @object; \n" \ +".type " #symbol ", STT_OBJECT; \n" \ ".size " #symbol ", 4; \n" \ #symbol ": \n" \ ".zero 4 \n" \ @@ -83,5 +85,12 @@ asm( \ ".zero 4 \n" \ ".popsection; \n"); +#else + +#define BTF_ID_LIST(name) u32 name[5]; +#define BTF_ID(prefix, name) +#define BTF_ID_UNUSED + +#endif /* CONFIG_DEBUG_INFO_BTF */ #endif diff --git a/tools/bpf/resolve_btfids/Makefile b/tools/bpf/resolve_btfids/Makefile index 948378ca73d4..a88cd4426398 100644 --- a/tools/bpf/resolve_btfids/Makefile +++ b/tools/bpf/resolve_btfids/Makefile @@ -16,6 +16,20 @@ else MAKEFLAGS=--no-print-directory endif +# always use the host compiler +ifneq ($(LLVM),) +HOSTAR ?= llvm-ar +HOSTCC ?= clang +HOSTLD ?= ld.lld +else +HOSTAR ?= ar +HOSTCC ?= gcc +HOSTLD ?= ld +endif +AR = $(HOSTAR) +CC = $(HOSTCC) +LD = $(HOSTLD) + OUTPUT ?= $(srctree)/tools/bpf/resolve_btfids/ LIBBPF_SRC := $(srctree)/tools/lib/bpf/