Skip to content

Commit

Permalink
treewide: sync with upstream (coolsnowwolf#10720)
Browse files Browse the repository at this point in the history
* mpc85xx: add support for cpu type 8548

8540 cpu type corresponds to e500v1 core while
8548 cpu type corresponds to e500v2 core

See https://www.nxp.com/products/processors-and-microcontrollers/legacy-mpu-mcus/powerquicc-processors:POWERQUICC_HOME#powerquicc-iii-mpc85xx
and https://www.nxp.com/docs/en/application-note/AN2807.pdf .

Co-authored-by: Josef Schlehofer <[email protected]>
Co-authored-by: Pali Rohár <[email protected]>
Signed-off-by: Šimon Bořek <[email protected]>

* tree-wide: Do not use package librt and libpthread

The libraries libpthread, libdl, libutil, libanl have been integrated
into the libc library in version 2.34. it is not needed to explicitly
link them any more.

Most of the functions have been moved from the librt.so into libc.so
some time ago already.

Signed-off-by: Hauke Mehrtens <[email protected]>

* toolchain/binutils: backport stable patches

Add the patches with real changes from the binutils 2.39 stable branch.
I am not aware that we ran into any of these problems, but I think it is
better to take the existing stable patches.

They were exported like this:
git format-patch binutils-2_39...origin/binutils-2_39-branch
I removed the patches changing the version numbers only.

Signed-off-by: Hauke Mehrtens <[email protected]>

* toolchain/binutils: switch to version 2.39 by default

This was build tested with all core packages on all targets
successfully.

This was run tested on the following systems:
* lantiq/xrx200 musl
* sunxi/cortex53 musl
* x86/64 musl
* x86/64 glibc

Some trusted firmware arm builds needed some fixes to build with
binutils 2.39, this was merged before.

Signed-off-by: Hauke Mehrtens <[email protected]>

* tools: Improve diffability/maintainability

There's no purpose to squish multiple tools into a single line (and
spread those out over multiple lines). It might look 'nice' in certain
conditions, but it's annoying to maintain.

For example, but not limited to:
* adding/removing tools, causes hard to read diffs
* Duplicates are harder to spot
* Sorting can not be (easily?) automated

With this proposed change, the above annoyances go away. Inserting a new
tool can be done with a single line-change-diff, sorting can be done by
any editor (in vi, select, :sort for example) and dupes are much easier
to spot.

Signed-off-by: Olliver Schinagl <[email protected]>

* rules: drop -Wno-error additional flags from default TARGET_CFLAGS

We currently enable -Wno-error=unused-but-set-variable and
-Wno-error=unused-result by default on every compile package.

While this is (relatively) unharmful, we should follow other project
direction and starts enforcing good code quality. For example the linux
kernel recently started to enforce Wall by default and clean code is
mandatory for inclusion.

Drop for good these flags and and make it mandatory to correctly handle
return values at least with a warning log if they are not strictly error
condition.

Signed-off-by: Christian Marangi <[email protected]>

* bridger: update to the latest version

def7755c459d add missing copyright headers
f68307fd96d7 add hairpin mode support
9ee8f433ba4e nl: do not pass NDA_VLAN with vid=0
978c1f9eed07 add support for the bridge port isolated flag

Signed-off-by: Felix Fietkau <[email protected]>

Signed-off-by: Šimon Bořek <[email protected]>
Signed-off-by: Hauke Mehrtens <[email protected]>
Signed-off-by: Olliver Schinagl <[email protected]>
Signed-off-by: Christian Marangi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
Co-authored-by: Šimon Bořek <[email protected]>
Co-authored-by: Josef Schlehofer <[email protected]>
Co-authored-by: Pali Rohár <[email protected]>
Co-authored-by: Hauke Mehrtens <[email protected]>
Co-authored-by: Olliver Schinagl <[email protected]>
Co-authored-by: Christian Marangi <[email protected]>
Co-authored-by: Felix Fietkau <[email protected]>
  • Loading branch information
8 people authored Jan 4, 2023
1 parent fa691af commit 849ae16
Show file tree
Hide file tree
Showing 24 changed files with 1,311 additions and 27 deletions.
2 changes: 1 addition & 1 deletion include/package-defaults.mk
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# Copyright (C) 2006-2020 OpenWrt.org

PKG_DEFAULT_DEPENDS = +libc +USE_GLIBC:librt +USE_GLIBC:libpthread
PKG_DEFAULT_DEPENDS = +libc

ifneq ($(PKG_NAME),toolchain)
PKG_FIXUP_DEPENDS = $(if $(filter kmod-%,$(1)),$(2),$(PKG_DEFAULT_DEPENDS) $(filter-out $(PKG_DEFAULT_DEPENDS),$(2)))
Expand Down
1 change: 1 addition & 0 deletions include/target.mk
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ ifeq ($(DUMP),1)
ifeq ($(ARCH),powerpc)
CPU_CFLAGS_603e:=-mcpu=603e
CPU_CFLAGS_8540:=-mcpu=8540
CPU_CFLAGS_8548:=-mcpu=8548
CPU_CFLAGS_405:=-mcpu=405
CPU_CFLAGS_440:=-mcpu=440
CPU_CFLAGS_464fp:=-mcpu=464fp
Expand Down
6 changes: 3 additions & 3 deletions package/network/services/bridger/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=bridger
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=https://github.com/nbd168/bridger
PKG_SOURCE_DATE:=2022-04-06
PKG_SOURCE_VERSION:=e8f6814a85b4ea951657e7018c5d77597400f44a
PKG_MIRROR_HASH:=f917e099a9ab2a55745a7254239efabe695a722d5c448342198cdc847a4a24ac
PKG_SOURCE_DATE:=2023-01-03
PKG_SOURCE_VERSION:=978c1f9eed07504cc0b84f72ee7384aab722386a
PKG_MIRROR_HASH:=2a019b188d8de2fdc95453529d1820b0a7a5576adf161bd19e182c9c1c2b2c85

PKG_LICENSE:=GPL-2.0
PKG_MAINTAINER:=Felix Fietkau <[email protected]>
Expand Down
5 changes: 0 additions & 5 deletions package/network/services/hostapd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,6 @@ ifneq ($(LOCAL_TYPE),hostapd)
endif
endif

ifdef CONFIG_USE_GLIBC
TARGET_LDFLAGS += -lrt
TARGET_LDFLAGS_C += -lrt
endif

DRV_DEPENDS:=+PACKAGE_kmod-cfg80211:libnl-tiny


Expand Down
3 changes: 1 addition & 2 deletions package/system/fstools/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,14 @@ PKG_MAINTAINER:=John Crispin <[email protected]>
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk

TARGET_LDFLAGS += $(if $(CONFIG_USE_GLIBC),-lrt)
CMAKE_OPTIONS += $(if $(CONFIG_FSTOOLS_UBIFS_EXTROOT),-DCMAKE_UBIFS_EXTROOT=y)
CMAKE_OPTIONS += $(if $(CONFIG_FSTOOLS_OVL_MOUNT_FULL_ACCESS_TIME),-DCMAKE_OVL_MOUNT_FULL_ACCESS_TIME=y)
CMAKE_OPTIONS += $(if $(CONFIG_FSTOOLS_OVL_MOUNT_COMPRESS_ZLIB),-DCMAKE_OVL_MOUNT_COMPRESS_ZLIB=y)

define Package/fstools
SECTION:=base
CATEGORY:=Base system
DEPENDS:=+ubox +USE_GLIBC:librt +NAND_SUPPORT:ubi-utils
DEPENDS:=+ubox +NAND_SUPPORT:ubi-utils
TITLE:=OpenWrt filesystem tools
MENU:=1
endef
Expand Down
3 changes: 1 addition & 2 deletions package/system/procd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,14 @@ ifeq ($(DUMP),)
endif

CMAKE_OPTIONS += -DEARLY_PATH="$(TARGET_INIT_PATH)"
TARGET_LDFLAGS += $(if $(CONFIG_USE_GLIBC),-lrt)

TARGET_CFLAGS += -flto
TARGET_LDFLAGS += -flto

define Package/procd/Default
SECTION:=base
CATEGORY:=Base system
DEPENDS:=+ubusd +ubus +libjson-script +ubox +USE_GLIBC:librt +libubox \
DEPENDS:=+ubusd +ubus +libjson-script +ubox +libubox \
+libubus +libblobmsg-json +libjson-c +jshn
TITLE:=OpenWrt system process manager
USERID:=:dialout=20 :audio=29
Expand Down
6 changes: 2 additions & 4 deletions package/system/ubox/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,10 @@ PKG_MAINTAINER:=John Crispin <[email protected]>
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk

TARGET_LDFLAGS += $(if $(CONFIG_USE_GLIBC),-lrt)

define Package/ubox
SECTION:=base
CATEGORY:=Base system
DEPENDS:=+libubox +ubusd +ubus +libubus +libuci +USE_GLIBC:librt
DEPENDS:=+libubox +ubusd +ubus +libubus +libuci
TITLE:=OpenWrt system helper toolbox
ALTERNATIVES:=\
100:/sbin/rmmod:/sbin/kmodloader \
Expand All @@ -46,7 +44,7 @@ endef
define Package/logd
SECTION:=base
CATEGORY:=Base system
DEPENDS:=+libubox +libubus +libblobmsg-json +USE_GLIBC:librt
DEPENDS:=+libubox +libubus +libblobmsg-json
TITLE:=OpenWrt system log implementation
USERID:=logd=514:logd=514
endef
Expand Down
1 change: 0 additions & 1 deletion package/utils/e2fsprogs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ endef

TARGET_CFLAGS += $(FPIC) -ffunction-sections -fdata-sections -flto

TARGET_LDFLAGS += $(if $(CONFIG_USE_GLIBC),-lrt)
TARGET_LDFLAGS += -flto

CONFIGURE_ARGS += \
Expand Down
2 changes: 1 addition & 1 deletion package/utils/lua/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ define Build/Compile
RANLIB="$(TARGET_CROSS)ranlib" \
INSTALL_ROOT=/usr \
CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
MYLDFLAGS="$(TARGET_LDFLAGS) $(if $(CONFIG_USE_GLIBC),-lm -ldl)" \
MYLDFLAGS="$(TARGET_LDFLAGS)" \
PKG_VERSION=$(PKG_VERSION) \
linux
rm -rf $(PKG_INSTALL_DIR)
Expand Down
2 changes: 1 addition & 1 deletion rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ ifndef DUMP
-include $(TOOLCHAIN_DIR)/info.mk
export GCC_HONOUR_COPTS:=0
TARGET_CROSS:=$(if $(TARGET_CROSS),$(TARGET_CROSS),$(OPTIMIZE_FOR_CPU)-openwrt-linux$(if $(TARGET_SUFFIX),-$(TARGET_SUFFIX))-)
TARGET_CFLAGS+= -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result
TARGET_CFLAGS+= -fhonour-copts
TARGET_CPPFLAGS+= -I$(TOOLCHAIN_DIR)/usr/include
ifeq ($(CONFIG_USE_MUSL),y)
TARGET_CPPFLAGS+= -I$(TOOLCHAIN_DIR)/include/fortify
Expand Down
2 changes: 1 addition & 1 deletion toolchain/binutils/Config.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

choice
prompt "Binutils Version" if TOOLCHAINOPTS
default BINUTILS_USE_VERSION_2_37
default BINUTILS_USE_VERSION_2_39
help
Select the version of binutils you wish to use.

Expand Down
2 changes: 1 addition & 1 deletion toolchain/binutils/Config.version
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@

config BINUTILS_VERSION_2_37
default y if !TOOLCHAINOPTS
bool

config BINUTILS_VERSION_2_38
bool

config BINUTILS_VERSION_2_39
default y if !TOOLCHAINOPTS
bool

config BINUTILS_VERSION
Expand Down
27 changes: 27 additions & 0 deletions toolchain/binutils/patches/2.39/005-ld-fix-NEWS-typos.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
From 9284b63ea39cecbfc1522d9e143ecb7727d77eb5 Mon Sep 17 00:00:00 2001
From: Martin Liska <[email protected]>
Date: Mon, 8 Aug 2022 13:22:26 +0200
Subject: [PATCH 005/160] ld: fix NEWS typos

ld/ChangeLog:

* NEWS: Fix 2 typos.
---
ld/NEWS | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

--- a/ld/NEWS
+++ b/ld/NEWS
@@ -27,10 +27,10 @@ Changes in 2.39:
--enable-warn-rwx-segments=no
will make --no-warn-rwx-segments enabled by default.

- --enable-defaul-execstack=no
+ --enable-default-execstack=no
will stop the creation of an executable stack simply because an input file
is missing a .note.GNU-stack section, even on architectures where this
- ehaviour is the default.
+ behaviour is the default.

* TYPE=<type> is now supported in an output section description to set the
section type value.
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
From e8cf73215187b0c08679d726a5cc7c019fa3ea2e Mon Sep 17 00:00:00 2001
From: Jan Beulich <[email protected]>
Date: Wed, 10 Aug 2022 10:34:22 +0200
Subject: [PATCH 008/160] gas/Dwarf: properly skip zero-size functions

PR gas/29451

While out_debug_abbrev() properly skips such functions, out_debug_info()
mistakenly didn't. It needs to calculate the high_pc expression ahead of
time, in order to skip emitting any data for the function if the value
is zero.

The one case which would still leave a zero-size entry is when
symbol_get_obj(symp)->size ends up evaluating to zero. I hope we can
expect that to not be the case, otherwise we'd need to have a way to
post-process .debug_info contents between resolving expressions and
actually writing the data out to the file. Even then it wouldn't be
entirely obvious in which way to alter the data.

(cherry picked from commit d7abcbcea5ddd40a3bf28758b62f35933c59f996)
---
gas/dwarf2dbg.c | 39 ++++++++++++++++++++-------------------
1 file changed, 20 insertions(+), 19 deletions(-)

--- a/gas/dwarf2dbg.c
+++ b/gas/dwarf2dbg.c
@@ -2882,6 +2882,7 @@ out_debug_info (segT info_seg, segT abbr
{
const char *name;
size_t len;
+ expressionS size = { .X_op = O_constant };

/* Skip warning constructs (see above). */
if (symbol_get_bfdsym (symp)->flags & BSF_WARNING)
@@ -2895,6 +2896,18 @@ out_debug_info (segT info_seg, segT abbr
if (!S_IS_DEFINED (symp) || !S_IS_FUNCTION (symp))
continue;

+#if defined (OBJ_ELF) /* || defined (OBJ_MAYBE_ELF) */
+ size.X_add_number = S_GET_SIZE (symp);
+ if (size.X_add_number == 0 && IS_ELF
+ && symbol_get_obj (symp)->size != NULL)
+ {
+ size.X_op = O_add;
+ size.X_op_symbol = make_expr_symbol (symbol_get_obj (symp)->size);
+ }
+#endif
+ if (size.X_op == O_constant && size.X_add_number == 0)
+ continue;
+
subseg_set (str_seg, 0);
name_sym = symbol_temp_new_now_octets ();
name = S_GET_NAME (symp);
@@ -2920,29 +2933,17 @@ out_debug_info (segT info_seg, segT abbr
emit_expr (&exp, sizeof_address);

/* DW_AT_high_pc */
- exp.X_op = O_constant;
-#if defined (OBJ_ELF) /* || defined (OBJ_MAYBE_ELF) */
- exp.X_add_number = S_GET_SIZE (symp);
- if (exp.X_add_number == 0 && IS_ELF
- && symbol_get_obj (symp)->size != NULL)
- {
- exp.X_op = O_add;
- exp.X_op_symbol = make_expr_symbol (symbol_get_obj (symp)->size);
- }
-#else
- exp.X_add_number = 0;
-#endif
if (DWARF2_VERSION < 4)
{
- if (exp.X_op == O_constant)
- exp.X_op = O_symbol;
- exp.X_add_symbol = symp;
- emit_expr (&exp, sizeof_address);
+ if (size.X_op == O_constant)
+ size.X_op = O_symbol;
+ size.X_add_symbol = symp;
+ emit_expr (&size, sizeof_address);
}
- else if (exp.X_op == O_constant)
- out_uleb128 (exp.X_add_number);
+ else if (size.X_op == O_constant)
+ out_uleb128 (size.X_add_number);
else
- emit_leb128_expr (symbol_get_value_expression (exp.X_op_symbol), 0);
+ emit_leb128_expr (symbol_get_value_expression (size.X_op_symbol), 0);
}

/* End of children. */
Loading

0 comments on commit 849ae16

Please sign in to comment.