Skip to contentSkip to conversation

linux-next: build warning after merge of the bpf-next tree

DISCUSSION Stephen Rothwell 4 participants 7 messages Jul 14, 2020

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

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.

Signature · 2 lines
Cheers,
Stephen Rothwell
#1 lore raw
Quoted 18 lines · Stephen Rothwell

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'

Quoted 1 line

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

---

include/linux/btf_ids.h +10 -1
index fe019774f8a7..2f9754a4ab2b 100644
@@ -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
tools/bpf/resolve_btfids/Makefile +14 -0
index 948378ca73d4..a88cd4426398 100644
@@ -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/
#2 lore raw
Quoted 17 lines · Jiri Olsa
Quoted 16 lines · Stephen Rothwell

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'

Quoted 5 lines
Quoted 1 line

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

This one works for me, too:

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
#3 lore raw
In reply to Jiri Olsa

Hi Jiri,

Quoted 81 lines · On Tue, 14 Jul 2020 11:00:48 +0200 Jiri Olsa <[email protected]> wrote:
Quoted 17 lines · Stephen Rothwell

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'

Quoted 1 line

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

---

include/linux/btf_ids.h +10 -1
index fe019774f8a7..2f9754a4ab2b 100644
@@ -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
tools/bpf/resolve_btfids/Makefile +7 -0
index 948378ca73d4..a88cd4426398 100644
@@ -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

tools/bpf/resolve_btfids/Makefile else · line 35

Quoted 10 lines
tools/bpf/resolve_btfids/Makefile +7 -0
+HOSTCC  ?= gcc
+HOSTLD  ?= ld
+endif
+AR       = $(HOSTAR)
+CC       = $(HOSTCC)
+LD       = $(HOSTLD)
+
 OUTPUT ?= $(srctree)/tools/bpf/resolve_btfids/
 
 LIBBPF_SRC := $(srctree)/tools/lib/bpf/

Thanks for the quick response. However, in the mean time the bpf-next tree has been merged into the net-next tree, so these fixes will be needed there ASAP.

Signature · 2 lines
Cheers,
Stephen Rothwell
#4 lore raw

On Tue, Jul 14, 2020 at 08:33:41PM +1000, Stephen Rothwell wrote:

SNIP

Quoted 24 lines
Quoted 24 lines
tools/bpf/resolve_btfids/Makefile +14 -0
index 948378ca73d4..a88cd4426398 100644
@@ -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/
 
Quoted 6 lines

tools/bpf/resolve_btfids/Makefile else · line 35

Quoted 2 lines
tools/bpf/resolve_btfids/Makefile +0 -0
 LIBBPF_SRC := $(srctree)/tools/lib/bpf/

Thanks for the quick response. However, in the mean time the bpf-next tree has been merged into the net-next tree, so these fixes will be needed there ASAP.

I just posted it

jirka

#5 lore raw
Quoted 28 lines · Jiri Olsa

On Tue, Jul 14, 2020 at 08:33:41PM +1000, Stephen Rothwell wrote:

SNIP

Quoted 24 lines
Quoted 24 lines
tools/bpf/resolve_btfids/Makefile +14 -0
index 948378ca73d4..a88cd4426398 100644
@@ -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/
 
Quoted 8 lines
Quoted 6 lines

tools/bpf/resolve_btfids/Makefile else · line 35

Quoted 2 lines
tools/bpf/resolve_btfids/Makefile +0 -0
 LIBBPF_SRC := $(srctree)/tools/lib/bpf/

Thanks for the quick response. However, in the mean time the bpf-next tree has been merged into the net-next tree, so these fixes will be needed there ASAP.

I just posted it

ugh, you said net-next..

David, do you need me to repost with net-next tag?
https://lore.kernel.org/bpf/[email protected]/T/

jirka

#6 lore raw
Quoted 37 lines · Jiri Olsa
Quoted 35 lines · Jiri Olsa

On Tue, Jul 14, 2020 at 08:33:41PM +1000, Stephen Rothwell wrote:

SNIP

Quoted 30 lines
Quoted 16 lines
tools/bpf/resolve_btfids/Makefile +7 -0
index 948378ca73d4..a88cd4426398 100644
@@ -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

tools/bpf/resolve_btfids/Makefile else · line 35

Quoted 10 lines
tools/bpf/resolve_btfids/Makefile +7 -0
+HOSTCC  ?= gcc
+HOSTLD  ?= ld
+endif
+AR       = $(HOSTAR)
+CC       = $(HOSTCC)
+LD       = $(HOSTLD)
+
 OUTPUT ?= $(srctree)/tools/bpf/resolve_btfids/
 
 LIBBPF_SRC := $(srctree)/tools/lib/bpf/

Thanks for the quick response. However, in the mean time the bpf-next tree has been merged into the net-next tree, so these fixes will be needed there ASAP.

Quoted 6 lines
Quoted 1 line

I just posted it

ugh, you said net-next..

David, do you need me to repost with net-next tag?
https://lore.kernel.org/bpf/[email protected]/T/

NO. The fixes must go into bpf-next first.