linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Daniel Borkmann <daniel@iogearbox.net>,
	Alexei Starovoitov <ast@kernel.org>,
	Networking <netdev@vger.kernel.org>,
	Linux Next Mailing List <linux-next@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Jiri Olsa <jolsa@kernel.org>
Subject: Re: linux-next: build warning after merge of the bpf-next tree
Date: Tue, 14 Jul 2020 11:00:48 +0200	[thread overview]
Message-ID: <20200714090048.GG183694@krava> (raw)
In-Reply-To: <20200714121608.58962d66@canb.auug.org.au>

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 <linux/compiler.h> /* 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/


  reply	other threads:[~2020-07-14  9:01 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-14  2:16 linux-next: build warning after merge of the bpf-next tree Stephen Rothwell
2020-07-14  9:00 ` Jiri Olsa [this message]
2020-07-14  9:27   ` Geert Uytterhoeven
2020-07-14 10:33   ` Stephen Rothwell
2020-07-14 10:47     ` Jiri Olsa
2020-07-14 11:15       ` Jiri Olsa
2020-07-14 14:54         ` Alexei Starovoitov
  -- strict thread matches above, loose matches on Subject: below --
2024-02-06  4:33 Stephen Rothwell
2023-10-13  0:40 Stephen Rothwell
2023-10-13  5:30 ` Stephen Rothwell
2023-10-13 16:54   ` Martin KaFai Lau
2023-02-15  3:45 Stephen Rothwell
2023-02-06  3:54 Stephen Rothwell
2023-02-06  3:59 ` Alexei Starovoitov
2021-12-05 23:55 Stephen Rothwell
2021-12-06  0:43 ` Stephen Rothwell
2021-12-07  3:22   ` Andrii Nakryiko
2020-11-11  1:01 Stephen Rothwell
2020-11-11 14:03 ` Qian Cai
2020-11-11 18:15   ` Andrii Nakryiko
2019-10-17 23:56 Stephen Rothwell
2019-10-18  5:01 ` Alexei Starovoitov
2019-10-28  0:02 ` Stephen Rothwell
2020-01-10 22:28   ` Alexandre Ghiti
2020-01-10 23:18     ` Alexei Starovoitov
2020-01-11 14:06       ` Alexandre Ghiti
2020-01-11  0:20   ` Palmer Dabbelt
2020-01-11 14:31     ` Alexandre Ghiti
2020-01-13  4:33       ` Zong Li
2020-01-14  5:23         ` Alexei Starovoitov
2020-01-15 20:48           ` Alexandre Ghiti
2019-03-24 22:28 Stephen Rothwell
2019-03-24 22:39 ` Willem de Bruijn
2018-05-09  4:49 Stephen Rothwell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200714090048.GG183694@krava \
    --to=jolsa@redhat.com \
    --cc=ast@kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=sfr@canb.auug.org.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).