Merge Official Source

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
This commit is contained in:
Tianling Shen 2023-07-05 20:40:39 +08:00
commit 94812e90ec
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
25 changed files with 220 additions and 52 deletions

View File

@ -159,6 +159,19 @@ menu "Global build settings"
Adds LTO flags to the CFLAGS and LDFLAGS.
Packages can choose to opt-out via setting PKG_BUILD_FLAGS:=no-lto
config MOLD
depends on (aarch64 || arm || i386 || i686 || m68k || powerpc || powerpc64 || sh4 || x86_64)
depends on !GCC_USE_VERSION_11
def_bool $(shell, ./config/check-hostcxx.sh 10 2 12)
config USE_MOLD
bool
prompt "Use the mold linker for all packages"
depends on MOLD
help
Link packages with mold, a modern linker
Packages can opt-out via setting PKG_BUILD_FLAGS:=no-mold
config IPV6
def_bool y
@ -182,7 +195,6 @@ menu "Global build settings"
help
This will install binaries stripped using strip from binutils.
config USE_SSTRIP
bool "sstrip"
depends on !USE_GLIBC
@ -199,13 +211,12 @@ menu "Global build settings"
help
Specifies arguments passed to the strip command when stripping binaries.
config SSTRIP_ARGS
string
prompt "Sstrip arguments"
depends on USE_SSTRIP
default "-z"
config SSTRIP_DISCARD_TRAILING_ZEROES
bool "Strip trailing zero bytes"
depends on USE_SSTRIP && !USE_MOLD
default y
help
Specifies arguments passed to the sstrip command when stripping binaries.
Use sstrip's -z option to discard trailing zero bytes
config STRIP_KERNEL_EXPORTS
bool "Strip unnecessary exports from the kernel image"

View File

@ -1351,3 +1351,17 @@ config KERNEL_UBIFS_FS_SECURITY
config KERNEL_JFFS2_FS_SECURITY
bool "JFFS2 Security Labels"
config KERNEL_WERROR
bool "Compile the kernel with warnings as errors"
help
A kernel build should not cause any compiler warnings, and this
enables the '-Werror' (for C) and '-Dwarnings' (for Rust) flags
to enforce that rule by default. Certain warnings from other tools
such as the linker may be upgraded to errors with this option as
well.
However, if you have a new (or very old) compiler or linker with odd
and unusual warnings, or you have some architecture with problems,
you may need to disable this config option in order to
successfully build the kernel.

12
config/check-hostcxx.sh Executable file
View File

@ -0,0 +1,12 @@
cat << EOF | "$STAGING_DIR_HOST/bin/g++" -c -x c++ -o /dev/null - >/dev/null 2>&1
#if __clang__
#if __clang_major__ < $3
#error "clang too old"
#endif
#else
#if __GNUC__ < $1 || (__GNUC__ == $1 && (__GNUC_MINOR__ < $2))
#error "gcc too old"
#endif
#endif
EOF
[ $? -eq 0 ] && echo y || echo n

View File

@ -236,7 +236,7 @@ $(call KernelPackage/$(1)/config)
$(call KernelPackage/depends)
$(call KernelPackage/hooks)
ifneq ($(if $(filter-out %=y %=n %=m,$(KCONFIG)),$(filter m y,$(foreach c,$(filter-out %=y %=n %=m,$(KCONFIG)),$($(c)))),.),)
ifneq ($(if $(filter-out %=y %=n %=m,$(KCONFIG)),$(filter m y,$(foreach c,$(call version_filter,$(filter-out %=y %=n %=m,$(KCONFIG))),$($(c)))),.),)
define Package/kmod-$(1)/install
@for mod in $$(call version_filter,$$(FILES)); do \
if grep -q "$$$$$$$${mod##$(LINUX_DIR)/}" "$(LINUX_DIR)/modules.builtin"; then \

View File

@ -78,6 +78,7 @@ define Meson/CreateCrossFile
$(STAGING_DIR_HOST)/bin/sed \
-e "s|@CC@|$(foreach BIN,$(TARGET_CC),'$(BIN)',)|" \
-e "s|@CXX@|$(foreach BIN,$(TARGET_CXX),'$(BIN)',)|" \
-e "s|@LD@|$(foreach FLAG,$(TARGET_LINKER),'$(FLAG)',)|" \
-e "s|@AR@|$(TARGET_AR)|" \
-e "s|@STRIP@|$(TARGET_CROSS)strip|" \
-e "s|@NM@|$(TARGET_NM)|" \

View File

@ -24,7 +24,7 @@ PKG_JOBS?=$(if $(PKG_BUILD_PARALLEL),$(MAKE_J),-j1)
endif
PKG_BUILD_FLAGS?=
__unknown_flags=$(filter-out no-iremap no-mips16 gc-sections no-gc-sections lto no-lto,$(PKG_BUILD_FLAGS))
__unknown_flags=$(filter-out no-iremap no-mips16 gc-sections no-gc-sections lto no-lto no-mold,$(PKG_BUILD_FLAGS))
ifneq ($(__unknown_flags),)
$(error unknown PKG_BUILD_FLAGS: $(__unknown_flags))
endif
@ -55,6 +55,11 @@ ifeq ($(call pkg_build_flag,lto,$(if $(CONFIG_USE_LTO),1,0)),1)
TARGET_CXXFLAGS+= -flto=auto -fno-fat-lto-objects
TARGET_LDFLAGS+= -flto=auto -fuse-linker-plugin
endif
ifdef CONFIG_USE_MOLD
ifeq ($(call pkg_build_flag,mold,1),1)
TARGET_LINKER:=mold
endif
endif
include $(INCLUDE_DIR)/hardening.mk
include $(INCLUDE_DIR)/prereq.mk

View File

@ -25,7 +25,7 @@ ifneq ($(BUILD_VARIANT),none)
endif
PKG_FLAGS:=nonshared
PKG_BUILD_FLAGS:=no-lto
PKG_BUILD_FLAGS:=no-lto no-mold
include $(INCLUDE_DIR)/host-build.mk
include $(INCLUDE_DIR)/package.mk

View File

@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/version.mk
PKG_NAME:=ipq-wifi
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=$(PROJECT_GIT)/project/firmware/qca-wireless.git
@ -41,6 +41,7 @@ ALLWIFIBOARDS:= \
xiaomi_ax3600 \
xiaomi_ax9000 \
zte_mf269 \
zte_mf289f \
zte_mf287plus \
zyxel_nbg7815
@ -129,6 +130,7 @@ $(eval $(call generate-ipq-wifi-package,wallys_dr40x9,Wallys DR40X9))
$(eval $(call generate-ipq-wifi-package,xiaomi_ax3600,Xiaomi AX3600))
$(eval $(call generate-ipq-wifi-package,xiaomi_ax9000,Xiaomi AX9000))
$(eval $(call generate-ipq-wifi-package,zte_mf269,ZTE MF269))
$(eval $(call generate-ipq-wifi-package,zte_mf289f,ZTE MF289F))
$(eval $(call generate-ipq-wifi-package,zte_mf287plus,ZTE MF287Plus))
$(eval $(call generate-ipq-wifi-package,zyxel_nbg7815,Zyxel NBG7815))

View File

@ -0,0 +1,28 @@
From f7d6edafe4358e3880a26775cfde4cd5c71ba063 Mon Sep 17 00:00:00 2001
From: David Bauer <mail@david-bauer.net>
Date: Wed, 5 Jul 2023 01:30:29 +0200
Subject: [PATCH] ath10k: always use mac80211 loss detection
ath10k does not report excessive loss in case of broken block-ack
sessions. The loss is communicated to the host-os, but ath10k does not
trigger a low-ack events by itself.
The mac80211 framework for loss detection however detects this
circumstance well in case of ath10k. So use it regardless of ath10k's
own loss detection mechanism.
Signed-off-by: David Bauer <mail@david-bauer.net>
---
ath10k-6.2/mac.c | 1 -
1 file changed, 1 deletion(-)
--- a/ath10k-6.2/mac.c
+++ b/ath10k-6.2/mac.c
@@ -11306,7 +11306,6 @@ int ath10k_mac_register(struct ath10k *a
ieee80211_hw_set(ar->hw, CHANCTX_STA_CSA);
ieee80211_hw_set(ar->hw, QUEUE_CONTROL);
ieee80211_hw_set(ar->hw, SUPPORTS_TX_FRAG);
- ieee80211_hw_set(ar->hw, REPORTS_LOW_ACK);
if (!test_bit(ATH10K_FLAG_RAW_MODE, &ar->dev_flags))
ieee80211_hw_set(ar->hw, SW_CRYPTO_CONTROL);

View File

@ -23,6 +23,7 @@ PKG_LICENSE_FILES:=LICENSE
PKG_EXTMOD_SUBDIRS:=src
PKG_FIXUP:=autoreconf
PKG_BUILD_FLAGS:=no-mold
include $(INCLUDE_DIR)/package.mk

View File

@ -25,6 +25,7 @@ PKG_EXTMOD_SUBDIRS:=src
PKG_FIXUP:=autoreconf
PKG_FLAGS:=nonshared
PKG_BUILD_FLAGS:=no-mold
include $(INCLUDE_DIR)/package.mk

View File

@ -23,6 +23,7 @@ PKG_LICENSE:=GPL-2.0 BSD-2-Clause
PKG_LICENSE_FILES:=LICENSE
PKG_FIXUP:=autoreconf
PKG_BUILD_FLAGS:=no-mold
include $(INCLUDE_DIR)/package.mk

View File

@ -217,6 +217,21 @@ endef
$(eval $(call KernelPackage,hwmon-it87))
define KernelPackage/hwmon-jc42
TITLE:=Jedec JC42.4 compliant temperature sensors support
KCONFIG:=CONFIG_SENSORS_JC42
FILES:=$(LINUX_DIR)/drivers/hwmon/jc42.ko
AUTOLOAD:=$(call AutoProbe,jc42)
$(call AddDepends/hwmon,+kmod-i2c-core +kmod-regmap-i2c)
endef
define KernelPackage/hwmon-jc42/description
Kernel module for Jedec JC42.4 compliant temperature sensors
endef
$(eval $(call KernelPackage,hwmon-jc42))
define KernelPackage/hwmon-lm63
TITLE:=LM63/64 monitoring support
KCONFIG:=CONFIG_SENSORS_LM63
@ -369,6 +384,21 @@ endef
$(eval $(call KernelPackage,hwmon-max6642))
define KernelPackage/hwmon-max6697
TITLE:=MAX6697 monitoring support
KCONFIG:=CONFIG_SENSORS_MAX6697
FILES:=$(LINUX_DIR)/drivers/hwmon/max6697.ko
AUTOLOAD:=$(call AutoProbe,max6697)
$(call AddDepends/hwmon,+kmod-i2c-core)
endef
define KernelPackage/hwmon-max6697/description
Kernel module for Maxim MAX6697 temperature monitor
endef
$(eval $(call KernelPackage,hwmon-max6697))
define KernelPackage/hwmon-mcp3021
TITLE:=MCP3021/3221 monitoring support
KCONFIG:=CONFIG_SENSORS_MCP3021

View File

@ -200,6 +200,22 @@ endef
$(eval $(call KernelPackage,i2c-mux-gpio))
I2C_MUX_REG_MODULES:= \
CONFIG_I2C_MUX_REG:drivers/i2c/muxes/i2c-mux-reg
define KernelPackage/i2c-mux-reg
$(call i2c_defaults,$(I2C_MUX_REG_MODULES),51)
TITLE:=Register-based I2C mux/switches
DEPENDS:=+kmod-i2c-mux
endef
define KernelPackage/i2c-mux-reg/description
Kernel modules for register-based I2C bus mux/switching devices
endef
$(eval $(call KernelPackage,i2c-mux-reg))
I2C_MUX_PCA9541_MODULES:= \
CONFIG_I2C_MUX_PCA9541:drivers/i2c/muxes/i2c-mux-pca9541

View File

@ -0,0 +1,28 @@
From f7d6edafe4358e3880a26775cfde4cd5c71ba063 Mon Sep 17 00:00:00 2001
From: David Bauer <mail@david-bauer.net>
Date: Wed, 5 Jul 2023 01:30:29 +0200
Subject: [PATCH] ath10k: always use mac80211 loss detection
ath10k does not report excessive loss in case of broken block-ack
sessions. The loss is communicated to the host-os, but ath10k does not
trigger a low-ack events by itself.
The mac80211 framework for loss detection however detects this
circumstance well in case of ath10k. So use it regardless of ath10k's
own loss detection mechanism.
Signed-off-by: David Bauer <mail@david-bauer.net>
---
drivers/net/wireless/ath/ath10k/mac.c | 1 -
1 file changed, 1 deletion(-)
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -10080,7 +10080,6 @@ int ath10k_mac_register(struct ath10k *a
ieee80211_hw_set(ar->hw, CHANCTX_STA_CSA);
ieee80211_hw_set(ar->hw, QUEUE_CONTROL);
ieee80211_hw_set(ar->hw, SUPPORTS_TX_FRAG);
- ieee80211_hw_set(ar->hw, REPORTS_LOW_ACK);
if (!test_bit(ATH10K_FLAG_RAW_MODE, &ar->dev_flags))
ieee80211_hw_set(ar->hw, SW_CRYPTO_CONTROL);

View File

@ -1,36 +0,0 @@
From cdf461888f900c3a149b10a04d72b4a590ecdec3 Mon Sep 17 00:00:00 2001
From: David Bauer <mail@david-bauer.net>
Date: Tue, 16 May 2023 23:11:32 +0200
Subject: [PATCH] mac80211: always use mac80211 loss detection
ath10k does not report excessive loss in case of broken block-ack
sessions. The loss is communicated to the host-os, but ath10k does not
trigger a low-ack events by itself.
The mac80211 framework for loss detection however detects this
circumstance well in case of ath10k. So use it regardless of ath10k's
own loss detection mechanism.
Patching this in mac80211 does allow this hack to be used with any
flavor of ath10k/ath11k.
Signed-off-by: David Bauer <mail@david-bauer.net>
---
net/mac80211/status.c | 6 ------
1 file changed, 6 deletions(-)
--- a/net/mac80211/status.c
+++ b/net/mac80211/status.c
@@ -794,12 +794,6 @@ static void ieee80211_lost_packet(struct
unsigned long pkt_time = STA_LOST_PKT_TIME;
unsigned int pkt_thr = STA_LOST_PKT_THRESHOLD;
- /* If driver relies on its own algorithm for station kickout, skip
- * mac80211 packet loss mechanism.
- */
- if (ieee80211_hw_check(&sta->local->hw, REPORTS_LOW_ACK))
- return;
-
/* This packet was aggregated but doesn't carry status info */
if ((info->flags & IEEE80211_TX_CTL_AMPDU) &&
!(info->flags & IEEE80211_TX_STAT_AMPDU))

View File

@ -211,6 +211,10 @@ ifndef DUMP
endif
endif
endif
TARGET_LINKER?=bfd
TARGET_LDFLAGS+= -fuse-ld=$(TARGET_LINKER)
TARGET_PATH_PKG:=$(STAGING_DIR)/host/bin:$(STAGING_DIR_HOSTPKG)/bin:$(TARGET_PATH)
ifeq ($(CONFIG_SOFT_FLOAT),y)
@ -252,6 +256,7 @@ TARGET_RANLIB:=$(TARGET_CROSS)gcc-ranlib
TARGET_NM:=$(TARGET_CROSS)gcc-nm
TARGET_CC:=$(TARGET_CROSS)gcc
TARGET_CXX:=$(TARGET_CROSS)g++
TARGET_LD:=$(TARGET_CROSS)ld.$(TARGET_LINKER)
KPATCH:=$(SCRIPT_DIR)/patch-kernel.sh
FILECMD:=$(STAGING_DIR_HOST)/bin/file
SED:=$(STAGING_DIR_HOST)/bin/sed -i -e
@ -305,7 +310,7 @@ endif
TARGET_CONFIGURE_OPTS = \
AR="$(TARGET_AR)" \
AS="$(TARGET_CC) -c $(TARGET_ASFLAGS)" \
LD=$(TARGET_CROSS)ld \
LD="$(TARGET_LD)" \
NM="$(TARGET_NM)" \
CC="$(TARGET_CC)" \
GCC="$(TARGET_CC)" \
@ -325,7 +330,7 @@ else
STRIP:=$(TARGET_CROSS)strip $(call qstrip,$(CONFIG_STRIP_ARGS))
else
ifneq ($(CONFIG_USE_SSTRIP),)
STRIP:=$(STAGING_DIR_HOST)/bin/sstrip $(call qstrip,$(CONFIG_SSTRIP_ARGS))
STRIP:=$(STAGING_DIR_HOST)/bin/sstrip $(if $(CONFIG_SSTRIP_DISCARD_TRAILING_ZEROES),-z)
endif
endif
RSTRIP= \

View File

@ -1169,7 +1169,7 @@ TARGET_DEVICES += zte_mf287plus
define Device/zte_mf289f
$(call Device/zte_mf28x_common)
DEVICE_MODEL := MF289F
DEVICE_PACKAGES += ath10k-firmware-qca9984-ct
DEVICE_PACKAGES += ipq-wifi-zte_mf289f ath10k-firmware-qca9984-ct
endef
TARGET_DEVICES += zte_mf289f

View File

@ -334,7 +334,7 @@ CONFIG_NR_CPUS_DEFAULT=64
CONFIG_NR_CPUS_RANGE_BEGIN=2
CONFIG_NR_CPUS_RANGE_END=512
CONFIG_NVME_CORE=y
# CONFIG_NVME_HWMON is not set
CONFIG_NVME_HWMON=y
CONFIG_NVME_MULTIPATH=y
CONFIG_OUTPUT_FORMAT="elf64-x86-64"
CONFIG_PADATA=y

View File

@ -27,7 +27,7 @@
curdir:=toolchain
# subdirectories to descend into
$(curdir)/builddirs := $(if $(CONFIG_GDB),gdb) $(if $(CONFIG_EXTERNAL_TOOLCHAIN),wrapper,kernel-headers binutils gcc/initial gcc/final $(LIBC) fortify-headers) $(if $(CONFIG_NASM),nasm)
$(curdir)/builddirs := $(if $(CONFIG_GDB),gdb) $(if $(CONFIG_EXTERNAL_TOOLCHAIN),wrapper,kernel-headers binutils gcc/initial gcc/final $(LIBC) fortify-headers) $(if $(CONFIG_NASM),nasm) $(if $(CONFIG_USE_MOLD),mold)
# builddir dependencies
ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),)

22
toolchain/mold/Makefile Normal file
View File

@ -0,0 +1,22 @@
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/toolchain-build.mk
define Host/Configure
endef
define Host/Compile
endef
define Host/Install
$(INSTALL_DIR) $(TOOLCHAIN_DIR)/bin
$(INSTALL_BIN) $(STAGING_DIR_HOST)/bin/mold $(TOOLCHAIN_DIR)/bin/$(REAL_GNU_TARGET_NAME)-ld.mold
endef
define Host/Clean
endef
$(eval $(call HostBuild))

View File

@ -84,6 +84,7 @@ tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(CONFIG_TARGET_tegra),y) += cbootimage
tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(CONFIG_USES_MINOR),y) += kernel2minor
tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(CONFIG_USE_SPARSE),y) += sparse
tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(CONFIG_USE_LLVM_BUILD),y) += llvm-bpf
tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(CONFIG_USE_MOLD),y) += mold
# builddir dependencies
$(curdir)/autoconf/compile := $(curdir)/m4/compile
@ -116,6 +117,7 @@ $(curdir)/meson/compile := $(curdir)/ninja/compile
$(curdir)/missing-macros/compile := $(curdir)/autoconf/compile
$(curdir)/mkimage/compile += $(curdir)/bison/compile $(curdir)/libressl/compile
$(curdir)/mklibs/compile := $(curdir)/libtool/compile
$(curdir)/mold/compile := $(curdir)/cmake/compile $(curdir)/zlib/compile $(curdir)/zstd/compile
$(curdir)/mpc/compile := $(curdir)/mpfr/compile $(curdir)/gmp/compile
$(curdir)/mpfr/compile := $(curdir)/gmp/compile
$(curdir)/mtd-utils/compile := $(curdir)/libtool/compile $(curdir)/e2fsprogs/compile $(curdir)/zlib/compile

View File

@ -2,6 +2,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=meson
PKG_VERSION:=1.1.1
PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/mesonbuild/meson/releases/download/$(PKG_VERSION)

View File

@ -1,6 +1,8 @@
[binaries]
c = [@CC@]
c_ld = [@LD@]
cpp = [@CXX@]
cpp_ld = [@LD@]
ar = '@AR@'
strip = '@STRIP@'
nm = '@NM@'

22
tools/mold/Makefile Normal file
View File

@ -0,0 +1,22 @@
# SPDX-License-Identifier: GPL-2.0-only
include $(TOPDIR)/rules.mk
PKG_NAME:=mold
PKG_VERSION:=1.11.0
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL_FILE:=v$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/rui314/mold/archive/refs/tags
PKG_HASH:=99318eced81b09a77e4c657011076cc8ec3d4b6867bd324b8677974545bc4d6f
include $(INCLUDE_DIR)/host-build.mk
include $(INCLUDE_DIR)/cmake.mk
CMAKE_HOST_OPTIONS += \
-DMOLD_LTO=ON \
-DMOLD_MOSTLY_STATIC=ON \
-DMOLD_USE_SYSTEM_MIMALLOC=OFF \
-DMOLD_USE_SYSTEM_TBB=OFF
$(eval $(call HostBuild))