[no subject]

2022-04-03 Thread We have an offer to invest in your country under a joint venture partnership please reply for more details


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[sdwalker/sdwalker.github.io] d0318f: This week's update

2022-04-03 Thread Stephen Walker via openwrt-devel
The sender domain has a DMARC Reject/Quarantine policy which disallows
sending mailing list messages using the original "From" header.

To mitigate this problem, the original message has been wrapped
automatically by the mailing list software.--- Begin Message ---
  Branch: refs/heads/master
  Home:   https://github.com/sdwalker/sdwalker.github.io
  Commit: d0318f2661822d2e79daaa1137dc521bd4bcbc83
  
https://github.com/sdwalker/sdwalker.github.io/commit/d0318f2661822d2e79daaa1137dc521bd4bcbc83
  Author: Stephen Walker 
  Date:   2022-04-03 (Sun, 03 Apr 2022)

  Changed paths:
M uscan/index-19.07.html
M uscan/index-21.02.html
M uscan/index.html
M uscan/js/sort-19.07.js
M uscan/js/sort.js

  Log Message:
  ---
  This week's update



--- End Message ---
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH v2 11/11] kernel: add KERNEL_BPF_EVENTS config option

2022-04-03 Thread Stijn Tintel
This is required to use BPF maps of type BPF_MAP_TYPE_PERF_EVENT_ARRAY
for sending data from BPF programs to user-space for post-processing
or logging.

Signed-off-by: Stijn Tintel 
---
 config/Config-kernel.in | 12 +++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/config/Config-kernel.in b/config/Config-kernel.in
index a5e9ef477b..b77183e8f7 100644
--- a/config/Config-kernel.in
+++ b/config/Config-kernel.in
@@ -450,10 +450,20 @@ config KERNEL_KPROBE_EVENTS
bool
default y if KERNEL_KPROBES
 
+config KERNEL_BPF_EVENTS
+   bool "Compile the kernel with BPF event support"
+   default n
+   select KERNEL_KPROBES
+   help
+ Allows to attach BPF programs to kprobe, uprobe and tracepoint events.
+ This is required to use BPF maps of type BPF_MAP_TYPE_PERF_EVENT_ARRAY
+ for sending data from BPF programs to user-space for post-processing
+ or logging.
+
 config KERNEL_BPF_KPROBE_OVERRIDE
bool
-   depends on KERNEL_KPROBES
default n
+   depends on KERNEL_KPROBES
 
 config KERNEL_AIO
bool "Compile the kernel with asynchronous IO support"
-- 
2.35.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH v2 07/11] layerscape/armv8_64b: enable DEBUG_INFO_REDUCED

2022-04-03 Thread Stijn Tintel
We currently enable DEBUG_INFO_REDUCED for all targets via the generic
kernel config. There is only one subtarget, layerscape/armv8_64b, that
overrides this setting. As there is no explanation for this in the
commit message that introduced this, and question to its author went
unanswered, let's simply drop this symbol from the subtarget config.
This way, we have consistency across the tree, and we do not have to
introduce a special case when moving this symbol to an OpenWrt kernel
config option.

Signed-off-by: Stijn Tintel 
---
 target/linux/layerscape/armv8_64b/config-5.10 | 1 -
 1 file changed, 1 deletion(-)

diff --git a/target/linux/layerscape/armv8_64b/config-5.10 
b/target/linux/layerscape/armv8_64b/config-5.10
index 03c85a5aef..f16ce7e025 100644
--- a/target/linux/layerscape/armv8_64b/config-5.10
+++ b/target/linux/layerscape/armv8_64b/config-5.10
@@ -196,7 +196,6 @@ CONFIG_CRYPTO_ZSTD=y
 CONFIG_DCACHE_WORD_ACCESS=y
 CONFIG_DEBUG_BUGVERBOSE=y
 CONFIG_DEBUG_INFO=y
-# CONFIG_DEBUG_INFO_REDUCED is not set
 CONFIG_DEBUG_MEMORY_INIT=y
 CONFIG_DECOMPRESS_BZIP2=y
 CONFIG_DECOMPRESS_GZIP=y
-- 
2.35.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH v2 10/11] config: limit CONFIG_DEBUG_INFO to top-level generic configs

2022-04-03 Thread Stijn Tintel
From: Tony Ambardar 

Remove redundant target-level entries, noting that these settings will be
configured from "Kernel build options" of Kconfig.

Signed-off-by: Tony Ambardar 
Signed-off-by: Felix Fietkau 
[remove from new configs introduced after patch submission]
Signed-off-by: Stijn Tintel 
---
 target/linux/at91/sam9x/config-default| 1 -
 target/linux/at91/sama7/config-default| 1 -
 target/linux/bcm27xx/bcm2708/config-5.10  | 1 -
 target/linux/bcm27xx/bcm2709/config-5.10  | 1 -
 target/linux/bcm27xx/bcm2710/config-5.10  | 1 -
 target/linux/bcm27xx/bcm2711/config-5.10  | 1 -
 target/linux/bcm53xx/config-5.10  | 1 -
 target/linux/bcm53xx/config-5.15  | 1 -
 target/linux/bmips/config-5.10| 1 -
 target/linux/layerscape/armv8_64b/config-5.10 | 1 -
 target/linux/mediatek/mt7623/config-5.10  | 1 -
 target/linux/mediatek/mt7623/config-5.15  | 1 -
 target/linux/mvebu/config-5.10| 1 -
 target/linux/omap/config-5.10 | 1 -
 target/linux/qoriq/config-5.10| 2 --
 target/linux/realtek/rtl838x/config-5.10  | 1 -
 target/linux/realtek/rtl839x/config-5.10  | 1 -
 target/linux/realtek/rtl930x/config-5.10  | 1 -
 target/linux/realtek/rtl931x/config-5.10  | 1 -
 19 files changed, 20 deletions(-)

diff --git a/target/linux/at91/sam9x/config-default 
b/target/linux/at91/sam9x/config-default
index 9f97e7542e..07dfee21b8 100644
--- a/target/linux/at91/sam9x/config-default
+++ b/target/linux/at91/sam9x/config-default
@@ -81,7 +81,6 @@ CONFIG_CRYPTO_HASH_INFO=y
 CONFIG_CRYPTO_LZO=y
 CONFIG_CRYPTO_RNG2=y
 CONFIG_CRYPTO_ZSTD=y
-CONFIG_DEBUG_INFO=y
 CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S"
 CONFIG_DMADEVICES=y
 CONFIG_DMA_ENGINE=y
diff --git a/target/linux/at91/sama7/config-default 
b/target/linux/at91/sama7/config-default
index 8c453659dc..e090b6aa1b 100644
--- a/target/linux/at91/sama7/config-default
+++ b/target/linux/at91/sama7/config-default
@@ -151,7 +151,6 @@ CONFIG_CRYPTO_SHA256=y
 CONFIG_DCACHE_WORD_ACCESS=y
 CONFIG_DEBUG_AT91_SAMA7G5_FLEXCOM3=y
 CONFIG_DEBUG_AT91_UART=y
-CONFIG_DEBUG_INFO=y
 CONFIG_DEBUG_LL=y
 CONFIG_DEBUG_LL_INCLUDE="debug/at91.S"
 CONFIG_DEBUG_UART_PHYS=0xe1824200
diff --git a/target/linux/bcm27xx/bcm2708/config-5.10 
b/target/linux/bcm27xx/bcm2708/config-5.10
index 56e076ba95..f5d9fdd70f 100644
--- a/target/linux/bcm27xx/bcm2708/config-5.10
+++ b/target/linux/bcm27xx/bcm2708/config-5.10
@@ -110,7 +110,6 @@ CONFIG_CRYPTO_CRC32C=y
 CONFIG_CRYPTO_RNG2=y
 CONFIG_DCACHE_WORD_ACCESS=y
 CONFIG_DEBUG_BUGVERBOSE=y
-CONFIG_DEBUG_INFO=y
 CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S"
 CONFIG_DMABUF_HEAPS=y
 CONFIG_DMABUF_HEAPS_CMA=y
diff --git a/target/linux/bcm27xx/bcm2709/config-5.10 
b/target/linux/bcm27xx/bcm2709/config-5.10
index f15f6e3562..0eb4a680bd 100644
--- a/target/linux/bcm27xx/bcm2709/config-5.10
+++ b/target/linux/bcm27xx/bcm2709/config-5.10
@@ -142,7 +142,6 @@ CONFIG_CRYPTO_SHA512=y
 CONFIG_CRYPTO_XTS=y
 CONFIG_DCACHE_WORD_ACCESS=y
 CONFIG_DEBUG_BUGVERBOSE=y
-CONFIG_DEBUG_INFO=y
 CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S"
 CONFIG_DIMLIB=y
 CONFIG_DMABUF_HEAPS=y
diff --git a/target/linux/bcm27xx/bcm2710/config-5.10 
b/target/linux/bcm27xx/bcm2710/config-5.10
index 6e26891070..0b6e42289a 100644
--- a/target/linux/bcm27xx/bcm2710/config-5.10
+++ b/target/linux/bcm27xx/bcm2710/config-5.10
@@ -141,7 +141,6 @@ CONFIG_CRYPTO_SHA512=y
 CONFIG_CRYPTO_XTS=y
 CONFIG_DCACHE_WORD_ACCESS=y
 CONFIG_DEBUG_BUGVERBOSE=y
-CONFIG_DEBUG_INFO=y
 CONFIG_DMABUF_HEAPS=y
 CONFIG_DMABUF_HEAPS_CMA=y
 CONFIG_DMABUF_HEAPS_SYSTEM=y
diff --git a/target/linux/bcm27xx/bcm2711/config-5.10 
b/target/linux/bcm27xx/bcm2711/config-5.10
index 03d84378b3..12dbf5205f 100644
--- a/target/linux/bcm27xx/bcm2711/config-5.10
+++ b/target/linux/bcm27xx/bcm2711/config-5.10
@@ -145,7 +145,6 @@ CONFIG_CRYPTO_SHA512=y
 CONFIG_CRYPTO_XTS=y
 CONFIG_DCACHE_WORD_ACCESS=y
 CONFIG_DEBUG_BUGVERBOSE=y
-CONFIG_DEBUG_INFO=y
 CONFIG_DIMLIB=y
 CONFIG_DMABUF_HEAPS=y
 CONFIG_DMABUF_HEAPS_CMA=y
diff --git a/target/linux/bcm53xx/config-5.10 b/target/linux/bcm53xx/config-5.10
index 6049641898..c522d7c902 100644
--- a/target/linux/bcm53xx/config-5.10
+++ b/target/linux/bcm53xx/config-5.10
@@ -100,7 +100,6 @@ CONFIG_CRYPTO_RNG2=y
 CONFIG_CRYPTO_ZSTD=y
 CONFIG_DCACHE_WORD_ACCESS=y
 CONFIG_DEBUG_BCM_5301X=y
-CONFIG_DEBUG_INFO=y
 CONFIG_DEBUG_LL=y
 CONFIG_DEBUG_LL_INCLUDE="debug/8250.S"
 CONFIG_DEBUG_MISC=y
diff --git a/target/linux/bcm53xx/config-5.15 b/target/linux/bcm53xx/config-5.15
index 6049641898..c522d7c902 100644
--- a/target/linux/bcm53xx/config-5.15
+++ b/target/linux/bcm53xx/config-5.15
@@ -100,7 +100,6 @@ CONFIG_CRYPTO_RNG2=y
 CONFIG_CRYPTO_ZSTD=y
 CONFIG_DCACHE_WORD_ACCESS=y
 CONFIG_DEBUG_BCM_5301X=y
-CONFIG_DEBUG_INFO=y
 CONFIG_DEBUG_LL=y
 CONFIG_DEBUG_LL_INCLUDE="debug/8250.S"
 CONFIG_DEBUG_MISC=y
diff --git a/target/linux/bmips/config-5.10 b/target/linux/bmips/config-5.10
index bd54950210..e42d32bdaa 

[PATCH v2 06/11] kernel: backport build fix for tools/resolve_btfids

2022-04-03 Thread Stijn Tintel
Building tools/resolve_btfids requires libelf and zlib. Without this
build fix, the kernel build system will not find these dependencies.

Signed-off-by: Stijn Tintel 
---
 ...resolve_btfids-Build-with-host-flags.patch | 54 +++
 ...resolve_btfids-Build-with-host-flags.patch | 54 +++
 2 files changed, 108 insertions(+)
 create mode 100644 
target/linux/generic/backport-5.10/200-v5.18-tools-resolve_btfids-Build-with-host-flags.patch
 create mode 100644 
target/linux/generic/backport-5.15/200-v5.18-tools-resolve_btfids-Build-with-host-flags.patch

diff --git 
a/target/linux/generic/backport-5.10/200-v5.18-tools-resolve_btfids-Build-with-host-flags.patch
 
b/target/linux/generic/backport-5.10/200-v5.18-tools-resolve_btfids-Build-with-host-flags.patch
new file mode 100644
index 00..489575fb35
--- /dev/null
+++ 
b/target/linux/generic/backport-5.10/200-v5.18-tools-resolve_btfids-Build-with-host-flags.patch
@@ -0,0 +1,54 @@
+From cdbc4e3399ed8cdcf234a85f7a2482b622379e82 Mon Sep 17 00:00:00 2001
+From: Connor O'Brien 
+Date: Wed, 12 Jan 2022 00:25:03 +
+Subject: [PATCH] tools/resolve_btfids: Build with host flags
+
+resolve_btfids is built using $(HOSTCC) and $(HOSTLD) but does not
+pick up the corresponding flags. As a result, host-specific settings
+(such as a sysroot specified via HOSTCFLAGS=--sysroot=..., or a linker
+specified via HOSTLDFLAGS=-fuse-ld=...) will not be respected.
+
+Fix this by setting CFLAGS to KBUILD_HOSTCFLAGS and LDFLAGS to
+KBUILD_HOSTLDFLAGS.
+
+Also pass the cflags through to libbpf via EXTRA_CFLAGS to ensure that
+the host libbpf is built with flags consistent with resolve_btfids.
+
+Signed-off-by: Connor O'Brien 
+Signed-off-by: Andrii Nakryiko 
+Acked-by: Song Liu 
+Link: https://lore.kernel.org/bpf/20220112002503.115968-1-conn...@google.com
+(cherry picked from commit 0e3a1c902ffb56e9fe4416f0cd382c97b09ecbf6)
+Signed-off-by: Stijn Tintel 
+---
+ tools/bpf/resolve_btfids/Makefile | 6 --
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/tools/bpf/resolve_btfids/Makefile 
b/tools/bpf/resolve_btfids/Makefile
+index af9f9d3534c9..e727058bfe15 100644
+--- a/tools/bpf/resolve_btfids/Makefile
 b/tools/bpf/resolve_btfids/Makefile
+@@ -23,6 +23,8 @@ CC   = $(HOSTCC)
+ LD   = $(HOSTLD)
+ ARCH = $(HOSTARCH)
+ RM  ?= rm
++CFLAGS  := $(KBUILD_HOSTCFLAGS)
++LDFLAGS := $(KBUILD_HOSTLDFLAGS)
+ 
+ OUTPUT ?= $(srctree)/tools/bpf/resolve_btfids/
+ 
+@@ -45,9 +47,9 @@ $(SUBCMDOBJ): fixdep FORCE | $(OUTPUT)/libsubcmd
+   $(Q)$(MAKE) -C $(SUBCMD_SRC) OUTPUT=$(abspath $(dir $@))/ $(abspath $@)
+ 
+ $(BPFOBJ): $(wildcard $(LIBBPF_SRC)/*.[ch] $(LIBBPF_SRC)/Makefile) | 
$(OUTPUT)/libbpf
+-  $(Q)$(MAKE) $(submake_extras) -C $(LIBBPF_SRC)  OUTPUT=$(abspath $(dir 
$@))/ $(abspath $@)
++  $(Q)$(MAKE) $(submake_extras) -C $(LIBBPF_SRC)  OUTPUT=$(abspath $(dir 
$@))/ EXTRA_CFLAGS="$(CFLAGS)" $(abspath $@)
+ 
+-CFLAGS := -g \
++CFLAGS += -g \
+   -I$(srctree)/tools/include \
+   -I$(srctree)/tools/include/uapi \
+   -I$(LIBBPF_SRC) \
+-- 
+2.35.1
+
diff --git 
a/target/linux/generic/backport-5.15/200-v5.18-tools-resolve_btfids-Build-with-host-flags.patch
 
b/target/linux/generic/backport-5.15/200-v5.18-tools-resolve_btfids-Build-with-host-flags.patch
new file mode 100644
index 00..489575fb35
--- /dev/null
+++ 
b/target/linux/generic/backport-5.15/200-v5.18-tools-resolve_btfids-Build-with-host-flags.patch
@@ -0,0 +1,54 @@
+From cdbc4e3399ed8cdcf234a85f7a2482b622379e82 Mon Sep 17 00:00:00 2001
+From: Connor O'Brien 
+Date: Wed, 12 Jan 2022 00:25:03 +
+Subject: [PATCH] tools/resolve_btfids: Build with host flags
+
+resolve_btfids is built using $(HOSTCC) and $(HOSTLD) but does not
+pick up the corresponding flags. As a result, host-specific settings
+(such as a sysroot specified via HOSTCFLAGS=--sysroot=..., or a linker
+specified via HOSTLDFLAGS=-fuse-ld=...) will not be respected.
+
+Fix this by setting CFLAGS to KBUILD_HOSTCFLAGS and LDFLAGS to
+KBUILD_HOSTLDFLAGS.
+
+Also pass the cflags through to libbpf via EXTRA_CFLAGS to ensure that
+the host libbpf is built with flags consistent with resolve_btfids.
+
+Signed-off-by: Connor O'Brien 
+Signed-off-by: Andrii Nakryiko 
+Acked-by: Song Liu 
+Link: https://lore.kernel.org/bpf/20220112002503.115968-1-conn...@google.com
+(cherry picked from commit 0e3a1c902ffb56e9fe4416f0cd382c97b09ecbf6)
+Signed-off-by: Stijn Tintel 
+---
+ tools/bpf/resolve_btfids/Makefile | 6 --
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/tools/bpf/resolve_btfids/Makefile 
b/tools/bpf/resolve_btfids/Makefile
+index af9f9d3534c9..e727058bfe15 100644
+--- a/tools/bpf/resolve_btfids/Makefile
 b/tools/bpf/resolve_btfids/Makefile
+@@ -23,6 +23,8 @@ CC   = $(HOSTCC)
+ LD   = $(HOSTLD)
+ ARCH = $(HOSTARCH)
+ RM  ?= rm
++CFLAGS  := $(KBUILD_HOSTCFLAGS)
++LDFLAGS := $(KBUILD_HOSTLDFLAGS)
+ 
+ OUTPUT ?= 

[PATCH v2 09/11] build: add option KERNEL_DEBUG_INFO_BTF

2022-04-03 Thread Stijn Tintel
From: Tony Ambardar 

Generate BTF (BPF Type Format) information from DWARF debug info. This is
embedded in the kernel and exported via sysfs as /sys/kernel/btf/vmlinux.
BTF data enhances kernel portability and introspection for BPF programs.

Selecting this also enables the dwarves host package which provides the
pahole tool used for BTF encoding.

Test using: "bpftool btf dump file /sys/kernel/btf/vmlinux format c"

This needs to depend on KERNEL_DEBUG_INFO_REDUCED not being set,
otherwise we can enable both KERNEL_DEBUG_INFO_BTF and
KERNEL_DEBUG_INFO_REDUCED, which will result in undefined behaviour.

Signed-off-by: Tony Ambardar 
Signed-off-by: Felix Fietkau 
[split DEBUG_INFO_REDUCED into separate commit, add dependency]
Signed-off-by: Stijn Tintel 
---
 config/Config-kernel.in | 14 ++
 1 file changed, 14 insertions(+)

diff --git a/config/Config-kernel.in b/config/Config-kernel.in
index a9f4172d7f..a5e9ef477b 100644
--- a/config/Config-kernel.in
+++ b/config/Config-kernel.in
@@ -368,6 +368,20 @@ config KERNEL_DEBUG_INFO
help
  This will compile your kernel and modules with debug information.
 
+config KERNEL_DEBUG_INFO_BTF
+
+   bool "Enable additional BTF type information"
+   default n
+   depends on !HOST_OS_MACOS
+   depends on KERNEL_DEBUG_INFO && !KERNEL_DEBUG_INFO_REDUCED
+   select DWARVES
+   help
+ Generate BPF Type Format (BTF) information from DWARF debug info.
+ Turning this on expects presence of pahole tool, which will convert
+ DWARF type info into equivalent deduplicated BTF type info.
+
+ Required to run BPF CO-RE applications.
+
 config KERNEL_DEBUG_INFO_REDUCED
bool "Reduce debugging information"
default y
-- 
2.35.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH v2 05/11] tools/dwarves: add host package

2022-04-03 Thread Stijn Tintel
From: Tony Ambardar 

dwarves is a set of tools that use the debugging information inserted in
ELF binaries by compilers such as GCC. Utilities in the dwarves suite
include pahole, which can be used to find alignment holes in structs and
classes, and also extracts other information such as CPU cacheline
alignment, helping pack those structures to achieve more cache hits.

These tools are also used to encode and read the BTF type information
format used with the bpf syscall, making this a Linux build dependency
when using kernel BTF information.

Signed-off-by: Tony Ambardar 
Signed-off-by: Felix Fietkau 
[bump to 1.23, add elfutils dep, drop host lib usage, drop cmake release
target, use RM macro]
Signed-off-by: Stijn Tintel 
---
 toolchain/Config.in|  8 
 tools/Makefile |  2 ++
 tools/dwarves/Makefile | 35 +++
 3 files changed, 45 insertions(+)
 create mode 100644 tools/dwarves/Makefile

diff --git a/toolchain/Config.in b/toolchain/Config.in
index 366f5c8b48..fb14006055 100644
--- a/toolchain/Config.in
+++ b/toolchain/Config.in
@@ -247,6 +247,14 @@ comment "Binary tools"
 
 source "toolchain/binutils/Config.in"
 
+config DWARVES
+   bool
+   prompt "Build pahole" if TOOLCHAINOPTS
+   depends on !HOST_OS_MACOS
+   default n
+   help
+ Enable if you want to build pahole and the dwarves tools.
+
 comment "Compiler"
depends on TOOLCHAINOPTS
 
diff --git a/tools/Makefile b/tools/Makefile
index 416039cf38..507971c6d5 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -84,7 +84,9 @@ endif
 ifeq ($(HOST_OS),Darwin)
   tools-y += bash
 else
+  $(curdir)/dwarves/compile += $(curdir)/elfutils/compile
   $(curdir)/elfutils/compile := $(curdir)/zlib/compile
+  tools-$(CONFIG_DWARVES) += dwarves
   tools-y += elfutils
 endif
 
diff --git a/tools/dwarves/Makefile b/tools/dwarves/Makefile
new file mode 100644
index 00..41f0532701
--- /dev/null
+++ b/tools/dwarves/Makefile
@@ -0,0 +1,35 @@
+# SPDX-License-Identifier: GPL-2.0-only
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=dwarves
+
+PKG_SOURCE_VERSION:=v1.23
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://git.kernel.org/pub/scm/devel/pahole/pahole.git
+PKG_MIRROR_HASH:=6ab1bb1dbdf6c73ffcf485d909229dc1da1a3d24efd213e92c56489b58d6a4bd
+PKG_LICENSE:=GPL-2.0-only
+PKG_LICENSE_FILES:=COPYING
+
+HOST_BUILD_PARALLEL:=1
+
+include $(INCLUDE_DIR)/host-build.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+CMAKE_HOST_OPTIONS += \
+   -D__LIB=lib \
+   -DCMAKE_INSTALL_RPATH="$(STAGING_DIR_HOST)/lib" \
+   -DCMAKE_SKIP_RPATH=FALSE
+
+define Host/Clean
+   $(RM) $(STAGING_DIR_HOST)/bin/{codiff,ctracer,dtagnames,pahole,pdwtags}
+   $(RM) $(STAGING_DIR_HOST)/bin/{pfunct,pglobal,prefcnt,scncopy,syscse}
+   $(RM) $(STAGING_DIR_HOST)/bin/{ostra-cg,btfdiff,fullcircle}
+   $(RM) $(STAGING_DIR_HOST)/lib/libdwarves*.so*
+   $(RM) $(STAGING_DIR_HOST)/share/man/man1/pahole.1
+   rm -rf $(STAGING_DIR_HOST)/include/dwarves
+   rm -rf $(STAGING_DIR_HOST)/share/dwarves
+   $(call Host/Clean/Default)
+endef
+
+$(eval $(call HostBuild))
-- 
2.35.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH v2 04/11] build: use KBUILD_HOSTLDFLAGS

2022-04-03 Thread Stijn Tintel
According to the GNU make manual, specifying library paths should be
done in LDFLAGS rather than LDLIBS. Replace KBUILD_HOSTLDLIBS with
KBUILD_HOSTLDFLAGS to pass the host lib directory.

Signed-off-by: Stijn Tintel 
---
 include/kernel.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/kernel.mk b/include/kernel.mk
index f27b78bbcc..01b737f132 100644
--- a/include/kernel.mk
+++ b/include/kernel.mk
@@ -110,7 +110,7 @@ KERNEL_MAKE_FLAGS = \
KBUILD_BUILD_HOST="$(call qstrip,$(CONFIG_KERNEL_BUILD_DOMAIN))" \
KBUILD_BUILD_TIMESTAMP="$(KBUILD_BUILD_TIMESTAMP)" \
KBUILD_BUILD_VERSION="0" \
-   KBUILD_HOSTLDLIBS="-L$(STAGING_DIR_HOST)/lib" \
+   KBUILD_HOSTLDFLAGS="-L$(STAGING_DIR_HOST)/lib" \
CONFIG_SHELL="$(BASH)" \
$(if $(findstring c,$(OPENWRT_VERBOSE)),V=1,V='') \
$(if $(PKG_BUILD_ID),LDFLAGS_MODULE=--build-id=0x$(PKG_BUILD_ID)) \
-- 
2.35.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH v2 08/11] kernel: add DEBUG_INFO_REDUCED config option

2022-04-03 Thread Stijn Tintel
Add DEBUG_INFO_REDUCED as a kernel config option and remove it from the
kernel configs. This is in preparation of the upcoming option to enable
BTF typeinfo, which is incompatible with DEBUG_INFO_REDUCED.

Signed-off-by: Stijn Tintel 
---
 config/Config-kernel.in  | 14 ++
 target/linux/generic/config-5.10 |  1 -
 target/linux/generic/config-5.15 |  1 -
 3 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/config/Config-kernel.in b/config/Config-kernel.in
index 5e12ddd78d..a9f4172d7f 100644
--- a/config/Config-kernel.in
+++ b/config/Config-kernel.in
@@ -368,6 +368,20 @@ config KERNEL_DEBUG_INFO
help
  This will compile your kernel and modules with debug information.
 
+config KERNEL_DEBUG_INFO_REDUCED
+   bool "Reduce debugging information"
+   default y
+   depends on KERNEL_DEBUG_INFO
+   help
+ If you say Y here gcc is instructed to generate less debugging
+ information for structure types. This means that tools that
+ need full debugging information (like kgdb or systemtap) won't
+ be happy. But if you merely need debugging information to
+ resolve line numbers there is no loss. Advantage is that
+ build directory object sizes shrink dramatically over a full
+ DEBUG_INFO build and compile times are reduced too.
+ Only works with newer gcc versions.
+
 config KERNEL_DEBUG_LL_UART_NONE
bool
default n
diff --git a/target/linux/generic/config-5.10 b/target/linux/generic/config-5.10
index a46fe13e64..806017e505 100644
--- a/target/linux/generic/config-5.10
+++ b/target/linux/generic/config-5.10
@@ -1276,7 +1276,6 @@ CONFIG_DEBUG_FS_ALLOW_ALL=y
 # CONFIG_DEBUG_INFO_BTF is not set
 # CONFIG_DEBUG_INFO_COMPRESSED is not set
 # CONFIG_DEBUG_INFO_DWARF4 is not set
-CONFIG_DEBUG_INFO_REDUCED=y
 # CONFIG_DEBUG_INFO_SPLIT is not set
 CONFIG_DEBUG_KERNEL=y
 # CONFIG_DEBUG_KMEMLEAK is not set
diff --git a/target/linux/generic/config-5.15 b/target/linux/generic/config-5.15
index 04c5d51409..9f5ca48b07 100644
--- a/target/linux/generic/config-5.15
+++ b/target/linux/generic/config-5.15
@@ -1309,7 +1309,6 @@ CONFIG_DEBUG_FS_ALLOW_ALL=y
 # CONFIG_DEBUG_INFO_DWARF4 is not set
 # CONFIG_DEBUG_INFO_DWARF5 is not set
 CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y
-CONFIG_DEBUG_INFO_REDUCED=y
 # CONFIG_DEBUG_INFO_SPLIT is not set
 # CONFIG_DEBUG_IRQFLAGS is not set
 CONFIG_DEBUG_KERNEL=y
-- 
2.35.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH v2 01/11] elfutils: move host build to tools

2022-04-03 Thread Stijn Tintel
The upcoming dwarves host package requires elfutils. As dependencies for
tools must exist in tools, we need to move elfutils host build there.

As there is at least one package that depends on this, and there is no
proper way to create such dependency in the build system, build it
unconditionally when not building on macOS.

Signed-off-by: Stijn Tintel 
---
 package/libs/elfutils/Makefile |  4 
 tools/Makefile |  3 +++
 tools/elfutils/Makefile| 32 
 3 files changed, 35 insertions(+), 4 deletions(-)
 create mode 100644 tools/elfutils/Makefile

diff --git a/package/libs/elfutils/Makefile b/package/libs/elfutils/Makefile
index 07b3ea66c6..2a7b5c50e2 100644
--- a/package/libs/elfutils/Makefile
+++ b/package/libs/elfutils/Makefile
@@ -24,11 +24,8 @@ PKG_INSTALL:=1
 PKG_USE_MIPS16:=1
 PKG_BUILD_DEPENDS:=!USE_GLIBC:argp-standalone
 
-HOST_BUILD_DEPENDS:=argp-standalone/host musl-fts/host
-
 include $(INCLUDE_DIR)/package.mk
 include $(INCLUDE_DIR)/nls.mk
-include $(INCLUDE_DIR)/host-build.mk
 
 define Package/elfutils/Default
   SECTION:=libs
@@ -114,7 +111,6 @@ define Package/libelf/install
 endef
 
 # these lines need to be ordered by dependency because of ABI versioning
-$(eval $(call HostBuild))
 $(eval $(call BuildPackage,libelf))
 $(eval $(call BuildPackage,libdw))
 $(eval $(call BuildPackage,libasm))
diff --git a/tools/Makefile b/tools/Makefile
index ec382b4122..416039cf38 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -83,6 +83,9 @@ ifneq ($(HOST_OS),Linux)
 endif
 ifeq ($(HOST_OS),Darwin)
   tools-y += bash
+else
+  $(curdir)/elfutils/compile := $(curdir)/zlib/compile
+  tools-y += elfutils
 endif
 
 ifneq ($(CONFIG_CCACHE)$(CONFIG_SDK),)
diff --git a/tools/elfutils/Makefile b/tools/elfutils/Makefile
new file mode 100644
index 00..98694beb0e
--- /dev/null
+++ b/tools/elfutils/Makefile
@@ -0,0 +1,32 @@
+# SPDX-License-Identifier: GPL-2.0-only
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=elfutils
+PKG_VERSION:=0.186
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_URL:=https://sourceware.org/$(PKG_NAME)/ftp/$(PKG_VERSION)
+PKG_HASH:=7f6fb9149b1673d38d9178a0d3e0fb8a1ec4f53a9f4c2ff89469609879641177
+
+PKG_LICENSE:=GPL-3.0-or-later
+PKG_LICENSE_FILES:=COPYING COPYING-GPLV2 COPYING-LGPLV3
+PKG_CPE_ID:=cpe:/a:elfutils_project:elfutils
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+HOST_BUILD_DEPENDS:=argp-standalone/host musl-fts/host
+
+include $(INCLUDE_DIR)/host-build.mk
+
+HOST_CONFIGURE_ARGS += \
+   --disable-debuginfod \
+   --disable-libdebuginfod \
+   --disable-nls \
+   --disable-shared \
+   --without-lzma \
+   --without-zstd
+
+$(eval $(call HostBuild))
-- 
2.35.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH v2 03/11] build: drop HOST_LOADLIBES

2022-04-03 Thread Stijn Tintel
HOST_LOADLIBES was renamed to KBUILD_HOSTLDLIBS in kernel 4.19. As the
oldest kernel version we support is 5.10, cleanup HOST_LOADLIBES use.

Signed-off-by: Stijn Tintel 
---
 include/kernel-build.mk | 1 -
 include/kernel.mk   | 1 -
 2 files changed, 2 deletions(-)

diff --git a/include/kernel-build.mk b/include/kernel-build.mk
index 80da4455bc..cc651f29b1 100644
--- a/include/kernel-build.mk
+++ b/include/kernel-build.mk
@@ -162,7 +162,6 @@ define BuildKernel
$(LINUX_RECONF_CMD) > $(LINUX_DIR)/.config
$(_SINGLE)$(KERNEL_MAKE) \
$(if $(findstring Darwin,$(HOST_OS)), \
-   HOST_LOADLIBES="-L$(STAGING_DIR_HOST)/lib -lncurses" \
HOSTLDLIBS_mconf="-L$(STAGING_DIR_HOST)/lib -lncurses" \
filechk_conf_cfg="  :" \
) \
diff --git a/include/kernel.mk b/include/kernel.mk
index e4074a48f4..f27b78bbcc 100644
--- a/include/kernel.mk
+++ b/include/kernel.mk
@@ -110,7 +110,6 @@ KERNEL_MAKE_FLAGS = \
KBUILD_BUILD_HOST="$(call qstrip,$(CONFIG_KERNEL_BUILD_DOMAIN))" \
KBUILD_BUILD_TIMESTAMP="$(KBUILD_BUILD_TIMESTAMP)" \
KBUILD_BUILD_VERSION="0" \
-   HOST_LOADLIBES="-L$(STAGING_DIR_HOST)/lib" \
KBUILD_HOSTLDLIBS="-L$(STAGING_DIR_HOST)/lib" \
CONFIG_SHELL="$(BASH)" \
$(if $(findstring c,$(OPENWRT_VERBOSE)),V=1,V='') \
-- 
2.35.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH v2 00/11] BPF events and Type Format support

2022-04-03 Thread Stijn Tintel
This series adds support for BPF events, and BPF Type Format [1]. It
supersedes [2].

BPF events can be used to send data to userspace for post-processing or
logging. Building the kernel with BTF support is required to run BPF
CO-RE applications.

Some fixes are required to make this possible, and it will not be
possible to enable BTF when building on macOS, due to incompatibilities.

Also see Github pull requests [3] and [4].

[1] https://www.kernel.org/doc/html/latest/bpf/btf.html
[2] http://lists.openwrt.org/pipermail/openwrt-devel/2022-February/038114.html
[2] https://github.com/openwrt/openwrt/pull/3855
[3] https://github.com/openwrt/openwrt/pull/9362

Stijn Tintel (8):
  elfutils: move host build to tools
  bpf-headers: drop HOST_LOADLIBES
  build: drop HOST_LOADLIBES
  build: use KBUILD_HOSTLDFLAGS
  kernel: backport build fix for tools/resolve_btfids
  layerscape/armv8_64b: enable DEBUG_INFO_REDUCED
  kernel: add DEBUG_INFO_REDUCED config option
  kernel: add KERNEL_BPF_EVENTS config option

Tony Ambardar (3):
  tools/dwarves: add host package
  build: add option KERNEL_DEBUG_INFO_BTF
  config: limit CONFIG_DEBUG_INFO to top-level generic configs

 config/Config-kernel.in   | 40 +-
 include/kernel-build.mk   |  1 -
 include/kernel.mk |  3 +-
 package/kernel/bpf-headers/Makefile   |  1 -
 package/libs/elfutils/Makefile|  4 --
 target/linux/at91/sam9x/config-default|  1 -
 target/linux/at91/sama7/config-default|  1 -
 target/linux/bcm27xx/bcm2708/config-5.10  |  1 -
 target/linux/bcm27xx/bcm2709/config-5.10  |  1 -
 target/linux/bcm27xx/bcm2710/config-5.10  |  1 -
 target/linux/bcm27xx/bcm2711/config-5.10  |  1 -
 target/linux/bcm53xx/config-5.10  |  1 -
 target/linux/bcm53xx/config-5.15  |  1 -
 target/linux/bmips/config-5.10|  1 -
 ...resolve_btfids-Build-with-host-flags.patch | 54 +++
 ...resolve_btfids-Build-with-host-flags.patch | 54 +++
 target/linux/generic/config-5.10  |  1 -
 target/linux/generic/config-5.15  |  1 -
 target/linux/layerscape/armv8_64b/config-5.10 |  2 -
 target/linux/mediatek/mt7623/config-5.10  |  1 -
 target/linux/mediatek/mt7623/config-5.15  |  1 -
 target/linux/mvebu/config-5.10|  1 -
 target/linux/omap/config-5.10 |  1 -
 target/linux/qoriq/config-5.10|  2 -
 target/linux/realtek/rtl838x/config-5.10  |  1 -
 target/linux/realtek/rtl839x/config-5.10  |  1 -
 target/linux/realtek/rtl930x/config-5.10  |  1 -
 target/linux/realtek/rtl931x/config-5.10  |  1 -
 toolchain/Config.in   |  8 +++
 tools/Makefile|  5 ++
 tools/dwarves/Makefile| 35 
 tools/elfutils/Makefile   | 32 +++
 32 files changed, 228 insertions(+), 32 deletions(-)
 create mode 100644 
target/linux/generic/backport-5.10/200-v5.18-tools-resolve_btfids-Build-with-host-flags.patch
 create mode 100644 
target/linux/generic/backport-5.15/200-v5.18-tools-resolve_btfids-Build-with-host-flags.patch
 create mode 100644 tools/dwarves/Makefile
 create mode 100644 tools/elfutils/Makefile

-- 
2.35.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH v2 02/11] bpf-headers: drop HOST_LOADLIBES

2022-04-03 Thread Stijn Tintel
HOST_LOADLIBES was renamed to KBUILD_HOSTLDLIBS in kernel 4.19. As the
oldest kernel version we support is 5.10, cleanup HOST_LOADLIBES use.

Signed-off-by: Stijn Tintel 
---
 package/kernel/bpf-headers/Makefile | 1 -
 1 file changed, 1 deletion(-)

diff --git a/package/kernel/bpf-headers/Makefile 
b/package/kernel/bpf-headers/Makefile
index b5891a9722..4df63a511d 100644
--- a/package/kernel/bpf-headers/Makefile
+++ b/package/kernel/bpf-headers/Makefile
@@ -56,7 +56,6 @@ KERNEL_MAKE := \
LLVM=1 CC="$(CLANG)" LD="$(TARGET_CROSS)ld" \
HOSTCC="$(HOSTCC)" \
HOSTCXX="$(HOSTCXX)" \
-   HOST_LOADLIBES="-L$(STAGING_DIR_HOST)/lib" \
KBUILD_HOSTLDLIBS="-L$(STAGING_DIR_HOST)/lib" \
CONFIG_SHELL="$(BASH)" \
INSTALL_HDR_PATH="$(PKG_BUILD_DIR)/user_headers"
-- 
2.35.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: OpenWrt 22.0X release plan (22.03)

2022-04-03 Thread Hauke Mehrtens

On 4/3/22 09:23, Hannu Nyman wrote:

On 2/20/22 23:57, Hauke Mehrtens wrote:

 > We would like to branch off OpenWrt 22.03 as openwrt-21.03 tomorrow.
 > We would also like to create branches on the default feeds too.
 >
 > Petr will set up the new build bot instance together with Paul and we 
would like to do an 22.03.0-rc1 soon when the build bot infrastructure 
is working fine.


Hi,

is the 22.03.0-rc1 going be tagged and built soon? It is now almost two 
weeks since the 22.03 branching, and also the 22.03 buildbot has been 
hapily crunching build for over a week by now. All targets are steadily 
green (with the exception of at91/sama7 and its packages 
arm_cortex-a7_vfpv4 ).


To get more real-life feedback (e.g. regarding firewall4), we should get 
the rc1 out soon, so that there would be an official stable build for 
the general populace.


(Based on the recent commit activity, the developer interest is quickly 
moving toward kernel 5.15 etc. new stuff, so likely not much 
22.03-specific polishing is happening. Same story as with earlier 
releases.)


Hi Hannu,

Thanks for bringing this topic up.

From my side there is nothing blocking tagging and building OpenWrt 
22.03.0-rc1 and I think we should do it soon.


Are there any objectsions from anyone to tag in the next days?
Who wants to take care of it?

Hauke

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: OpenWrt 22.0X release plan (22.03)

2022-04-03 Thread Hannu Nyman

On 2/20/22 23:57, Hauke Mehrtens wrote:

> We would like to branch off OpenWrt 22.03 as openwrt-21.03 tomorrow.
> We would also like to create branches on the default feeds too.
>
> Petr will set up the new build bot instance together with Paul and we 
would like to do an 22.03.0-rc1 soon when the build bot infrastructure is 
working fine.


Hi,

is the 22.03.0-rc1 going be tagged and built soon? It is now almost two weeks 
since the 22.03 branching, and also the 22.03 buildbot has been hapily 
crunching build for over a week by now. All targets are steadily green (with 
the exception of at91/sama7 and its packages arm_cortex-a7_vfpv4 ).


To get more real-life feedback (e.g. regarding firewall4), we should get the 
rc1 out soon, so that there would be an official stable build for the general 
populace.


(Based on the recent commit activity, the developer interest is quickly 
moving toward kernel 5.15 etc. new stuff, so likely not much 22.03-specific 
polishing is happening. Same story as with earlier releases.)




___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


netifd patch 60ghz AD AP mode

2022-04-03 Thread herman



Hello,

I believe there is a typo in netifd-wireless.sh.
My fist patch sent here so I hope it is in good format.
When an AD device is placed in AP mode the wrong hWmode is writen to 
hostapd.

This should fix it. For me it does.

Greetings

Herman


diff --git a/scripts/netifd-wireless.sh b/scripts/netifd-wireless.sh
index d5f3867..a0f91ed 100644
--- a/scripts/netifd-wireless.sh
+++ b/scripts/netifd-wireless.sh
@@ -70,7 +70,8 @@

case "$band" in
2g) hwmode=g;;
-   5g|6g|60g) hwmode=a;;
+   60g) hwmode=ad;;
+   5g|6g) hwmode=a;;
*)
case "$hwmode" in
*a) band=5g;;



___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel