1
0
mirror of https://github.com/openwrt/openwrt.git synced 2025-08-07 22:30:33 +08:00

1529 Commits

Author SHA1 Message Date
d6200f2502 toolchain: glibc: Update glibc 2.41 to recent HEAD
1e16d0096d80 posix: Fix double-free after allocation failure in regcomp (bug 33185) [CVE-2025-8058]
e7c419a29575 iconv: iconv -o should not create executable files (bug 33164)

Signed-off-by: Konstantin Demin <rockdrilla@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/19543
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-07-29 22:41:17 +02:00
c1c1112006 toolchain/gcc: prevent the use of LDRD/STRD on ARMv5TE
These instructions are for 64-bit load/store. On ARMv5TE, the CPU
requires addresses to be aligned to 64-bit. When misaligned, behavior is
undefined (effectively either loads the same word twice on LDRD, or
corrupts surrounding memory on STRD).

On ARMv6 and newer, unaligned access is safe.

Removing these instructions for ARMv5TE is necessary, because GCC
ignores alignment information in pointers and does unsafe optimizations
that have shown up as bugs in various places.

This patch was originally added more than 11 years ago in commit b050f87d13,
but got lost 6 years ago, when gcc 9.1 was added in 88c07c6552.

This primarily affects the kirkwood and ixp4xx targets

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-07-22 12:03:05 +02:00
8a40ccac37 toolchain: glibc: Update glibc 2.41 to recent HEAD
9f48a8abb2b2 Remove advisories from release branch
0a7c7a3e283a NEWS: start new section
bdccbfbc52d3 math: Fix log10p1f internal table value (BZ 32626)
d85a7719536f math: Fix sinhf for some inputs (BZ 32627)
cb7f20653724 nptl: Correct stack size attribute when stack grows up [BZ #32574]
cf88351b685d math: Fix tanf for some inputs (BZ 32630)
69fda28279b4 assert: Add test for CVE-2025-0395
1e0e33e1b19a Fix tst-aarch64-pkey to handle ENOSPC as not supported
a900dbaf70f0 x86 (__HAVE_FLOAT128): Defined to 0 for Intel SYCL compiler [BZ #32723]
2cb04444b934 math: Fix `unknown type name '__float128'` for clang 3.4 to 3.8.1 (bug 32694)
07288c7445bb math: Add optimization barrier to ensure a1 + u.d is not reused [BZ #30664]
30992cb5e9d7 RISC-V: Fix IFUNC resolver cannot access gp pointer
7c9a0868077c Aarch64: Improve codegen in SVE asinh
94859e86807a Aarch64: Improve codegen in SVE exp and users, and update expf_inline
f3d9c116cb0a AArch64: Improve codegen for SVE erfcf
2025e27a817f AArch64: Improve codegen for SVE pow
7774a9d07ab2 AArch64: Improve codegen for SVE powf
6d1f97bb0667 aarch64: Add configure checks for GCS support
fda5730898bc aarch64: Add tests for Guarded Control Stack
61ba3cdfa9e9 aarch64: Add GCS tests for transitive dependencies
8d98ee8d70cd aarch64: Add GCS tests for dlopen
009c5a2dca7c aarch64: Add GCS test with signal handler
e0bc5f64eaf7 math: Improve layout of exp/exp10 data
c47c3890f15e AArch64: Add SVE memset
89be78704ed8 AArch64: Use prefer_sve_ifuncs for SVE memset
56609f8df1fa Pass -Wl,--no-error-execstack for tests where -Wl,-z,execstack is used [PR32717]
746ef8e93964 static-pie: Skip the empty PT_LOAD segment at offset 0 [BZ #32763]
fd202462c5f8 elf: Check if __attribute__ ((aligned (65536))) is supported
91f8cff2c48f configure: Fix spelling of -Wl,--no-error-execstack option
1a3083b99992 posix: Move environ helper variables next to environ definition (bug 32541)
66fc3bd75871 math: Remove an extra semicolon in math function declarations
33bfd9020fda Linux: Remove attribute access from sched_getattr (bug 32781)
e22c132484ea nptl: clear the whole rseq area before registration
98c712855d66 nptl: PTHREAD_COND_INITIALIZER compatibility with pre-2.41 versions (bug 32786)
ce9b765522f0 nptl: Check if thread is already terminated in sigcancel_handler (BZ 32782)
6a3a4a5e583a x86_64: Add tanh with FMA
7e72fa7577f2 x86_64: Add sinh with FMA
bcd4cf9d5ff2 x86_64: Add atanh with FMA
a282e2c0aee8 x86: Skip XSAVE state size reset if ISA level requires XSAVE
80cd6566496e x86: Use separate variable for TLSDESC XSAVE/XSAVEC state size (bug 32810)
200d20123cb8 x86: Link tst-gnu2-tls2-x86-noxsave{,c,xsavec} with libpthread
b861755a84ee elf: Extend glibc.rtld.execstack tunable to force executable stack (BZ 32653)
d6d56af6e78c elf: Fix arm-linux-gnueabihf build break from b861755a84
f68b407d4bc5 x86: Optimize xstate size calculation
aca31d27123d x86: Add ARL/PTL/CWF model detection support
a53e76465791 x86: Handle unknown Intel processor with default tuning
046b33800c3e x86: Detect Intel Diamond Rapids
5cb575ca9a3d elf: tst-audit10: split AVX512F code into dedicated functions [BZ #32882]
5b4c4617016d nptl: Fix pthread_getattr_np when modules with execstack are allowed (BZ 32897)
5cf17ebc659c hurd: Fix tst-stack2 test build on Hurd
dab44a3b2bb5 elf: Keep using minimal malloc after early DTV resize (bug 32412)
2ca34d76270d support: Use const char * argument in support_capture_subprogram_self_sgid
624285af3bfc elf: Test case for bug 32976 (CVE-2025-4802)
899dd3ab2fc2 x86_64: Fix typo in ifunc-impl-list.c.
515d4166f4db elf: Fix subprocess status handling for tst-dlopen-sgid (bug 32987)
d952c6efaa87 sparc: Fix argument passing to __libc_start_main (BZ 32981)
84bdbf8a6f2f ppc64le: Revert "powerpc: Optimized strncmp for power10" (CVE-2025-5745)
55cdcadf7306 ppc64le: Revert "powerpc: Fix performance issues of strcmp power10" (CVE-2025-5702)
b48d7ab03643 ppc64le: Revert "powerpc : Add optimized memchr for POWER10" (Bug 33059)
0c76c951620f ppc64le: Revert "powerpc: Optimized strcmp for power10" (CVE-2025-5702)
61e461ed0c16 sparc: Fix sparc32 Fix argument passing to __libc_start_main (BZ 32981)
11e634ccf32e support: Pick group in support_capture_subprogram_self_sgid if UID == 0
6e489c17f827 Fix error reporting (false negatives) in SGID tests

Signed-off-by: Konstantin Demin <rockdrilla@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/19293
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-07-12 23:38:18 +02:00
39c1ca3332 toolchain: glibc: update to 2.41
glibc 2.39 has removed libcrypt completely:
- configuration flag "--enable-crypt" is obsolete and removed
- patch "050-Revert-Disallow-use-of-DES-encryption-functions-in-n.patch"
  does not matter anymore

Signed-off-by: Konstantin Demin <rockdrilla@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/19293
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-07-12 23:38:18 +02:00
1f8391346e toolchain: gcc: 15: fix build error with glibc for aarch64 targets
GCC 14+ fails to build due to libatomic specific -march handling.
This build error triggers only with glibc and not with musl libc
which is default.

It seems that this patch from GCC14 was forgotten when GCC15 support was
being added [1].

[1] 44ef343500

Fixes: 68cb84183e ("toolchain: add support for GCC 15.1")
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-07-08 14:19:18 +02:00
1ce0eb5bf2 toolchain/wrapper: add missing qstrip to info.mk export
When using an external toolchain, the SetToolchainInfo function
is missing a qstrip call on GCC_VERSION, which results in quotes
making it to the toolchain info.mk file.

This leads to a failure to build the libgcc ipk package because
the quotes make it to its version and filename. For some reason,
it only fails on the first make invocation, but succeeds on
subsequent ones on my setup.

Fix this issue by adding the qstrip, making it consistent with
the internal toolchain approach.

Signed-off-by: Ondrej Cierny <o.cierny@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/19192
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-06-23 13:30:15 +02:00
b44a97a9f5 toolchain: binutils: add support for 2.44
Release notes: https://lists.gnu.org/archive/html/info-gnu/2025-02/msg00001.html

Auto refresh patches
Test device: Xiaomi ax3600

Signed-off-by: Olcay Korkmaz <nuke_mania@hotmail.com>
Link: https://github.com/openwrt/openwrt/pull/18614
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-06-08 19:29:37 +02:00
68cb84183e toolchain: add support for GCC 15.1
All patches automatically refreshed.

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/18600
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-06-08 12:20:15 +02:00
fb2c59b942 toolchain: gcc: drop GCC11
There is no practical value in keeping GCC11 around, as even OpenWrt 23.05
uses GCC12 as the default one, so drop it.

Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-05-26 19:20:56 +02:00
ec4afc4c1b toolchain: gcc: update GCC14 to 14.3
Remove upstreamed patches:
- 020-MIPS-Include-missing-mips16.S-in-libgcc-lib1funcs.S.patch
- 021-Reuse-scratch-registers-generated-by-LRA.patch

All other patches are automatically refreshed.

Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/18891
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-05-24 21:04:07 +02:00
328eb84ee4 toolchain: glibc: Update glibc 2.38 to recent HEAD
3be3728d elf: Ignore LD_LIBRARY_PATH and debug env var for setuid for static
454f24e9 support: Use const char * argument in support_capture_subprogram_self_sgid
4335cd9b support: Add support_record_failure_barrier
31fa0f73 elf: Test case for bug 32976 (CVE-2025-4802)
ca41fe44 x86_64: Fix typo in ifunc-impl-list.c.

Signed-off-by: Konstantin Demin <rockdrilla@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/18863
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-05-21 13:50:25 +02:00
45889aecf8 toolchain: glibc: set min kernel version to 6.6
Minimum kernel version is 6.6 so it's safe to increase minimum kernel version to 6.6 for glibc too.
This change effectively removes last compatibility quirk in [1] which leads to better/faster detection of SVE support in string ifuncs for aarch64.
Furthermore, this change will allow to use "fchmodat2" syscall within fchmodat() wrapper in future glibc versions (starting from 2.39) as noted in [2] and [3].

[1] https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/aarch64/cpu-features.c;h=4a205a6b35050ffcfac771b4b4ff2d9fb7581f93;hb=refs/heads/release/2.38/master
[2] https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/kernel-features.h;h=86b2d3ce512588c8823c11076c91116092836402;hb=refs/heads/release/2.41/master
[3] https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/fchmodat.c;h=dd1fa5db86bde99fe3eb4804b06c5adf11914b94;hb=refs/heads/release/2.41/master

Signed-off-by: Konstantin Demin <rockdrilla@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/18850
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-05-20 11:42:24 +02:00
18de64d87b toolchain: gcc: backport patch to fix ICE with PowerPC targets
During the build of perl, the following ICE was reported in
https://github.com/openwrt/packages/issues/24565 when targeting PowerPC:

    during RTL pass: reload
    blocksort.c: In function 'mainSort.isra':
    blocksort.c:1011:1: internal compiler error: in patch_jump_insn, at cfgrtl.cc:1303
     1011 | }
          | ^
    0x7d49cee29d8f __libc_start_call_main
            ../sysdeps/nptl/libc_start_call_main.h:58
    0x7d49cee29e3f __libc_start_main_impl
            ../csu/libc-start.c:392
    Please submit a full bug report, with preprocessed source (by using -freport-bug).
    Please include the complete backtrace with any bug report.
    See <http://bugs.openwrt.org/> for instructions.

The same issue also caused the CI failures in
https://github.com/openwrt/packages/pull/26501.

The issue only occurs with GCC 14.2.0, but not with the head of the
releases/gcc-14 maintenance branch; a bisect found that this patch fixes
it.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
Link: https://github.com/openwrt/openwrt/pull/18797
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-05-14 11:23:34 +02:00
44ef343500 toolchain: gcc: fix build error with glibc for aarch64 targets
GCC 14+ fails to build due to libatomic specific -march handling.
This build error triggers only with glibc and not with musl libc
which is default.

Related: https://github.com/openwrt/openwrt/issues/16073

Signed-off-by: Konstantin Demin <rockdrilla@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/18647
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-05-12 11:13:20 +02:00
0b1e1943d5 toolchain/musl: fix build regression on x86_64
Fix whitespace mangling which broke matching opcodes in the CFI patch

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-05-06 14:29:09 +02:00
edd997a9ee musl: add pending patch to fix CFI annotations
Fixes debugging at least on aarch64, possibly others.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-05-05 13:57:08 +02:00
0744d77779 toolchain: gcc: Backport patch to fix mips16 linking
Backport patch from upstream GCC 14 branch which fixes linking with
MIPS16 on the pistachio target.

This fixes the following link problem:
```
/builder/shared-workdir/build/staging_dir/toolchain-mipsel_24kc+24kf_gcc-14.2.0_musl/lib/gcc/mipsel-openwrt-linux-musl/14.2.0/../../../../mipsel-openwrt-linux-musl/bin/ld.bfd: ./liblua.so: undefined reference to `__mips16_ledf2'
/builder/shared-workdir/build/staging_dir/toolchain-mipsel_24kc+24kf_gcc-14.2.0_musl/lib/gcc/mipsel-openwrt-linux-musl/14.2.0/../../../../mipsel-openwrt-linux-musl/bin/ld.bfd: ./liblua.so: undefined reference to `__mips16_call_stub_df_2'
/builder/shared-workdir/build/staging_dir/toolchain-mipsel_24kc+24kf_gcc-14.2.0_musl/lib/gcc/mipsel-openwrt-linux-musl/14.2.0/../../../../mipsel-openwrt-linux-musl/bin/ld.bfd: ./liblua.so: undefined reference to `__mips16_muldf3'
```

Link: https://github.com/openwrt/openwrt/pull/18688
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-05-03 22:04:13 +02:00
e184be34ab toolchain: gcc: Refresh patches
Refresh all GCC patches.

Link: https://github.com/openwrt/openwrt/pull/18688
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-05-03 22:04:13 +02:00
bf91381451 Revert "toolchain: gcc: make config consistent with glibc/musl"
This reverts commit 57841c83d9.

This is completely breaking the inital GCC configuration and most likely
was not even compile tested, so revert until fixed.

Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-05-02 19:30:47 +02:00
d3216173ab toolchain: binutils: fix compilation with GCC15
GCC15 has switched the C language default from GNU17 to GNU23[1] and this
causes builds to fail with:
In file included from mips-opc.c:29:
mips-opc.c: In function 'decode_mips_operand':
mips-formats.h:86:7: error: expected identifier or '(' before 'static_assert'
   86 |       static_assert[(1 << (SIZE)) == ARRAY_SIZE (MAP)]; \
      |       ^~~~~~~~~~~~~
mips-opc.c:214:15: note: in expansion of macro 'MAPPED_REG'
  214 |     case 'z': MAPPED_REG (0, 0, GP, reg_0_map);
      |               ^~~~~~~~~~

So, backport upstream fix for this[2] to fix compilation with GCC15.
Patch for 2.40 was manually refreshed as part of the S390 code does not
exist in 2.40 as it was added after it.

[1] https://gcc.gnu.org/gcc-15/porting_to.html#c23
[2] https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=8ebe62f3f0d27806b1bf69f301f5e188b4acd2b4

Fixes: #18678
Link: https://github.com/openwrt/openwrt/pull/18681
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-05-02 18:01:34 +02:00
57841c83d9 toolchain: gcc: make config consistent with glibc/musl
I've observed configuration drift for GCC between musl and glibc
(especially it's final stage):

  # musl
  lt_cv_prog_compiler_static_works=yes
  lt_cv_prog_compiler_static_works_CXX=yes
  lt_cv_sys_max_cmd_len=1572864

  # glibc
  lt_cv_prog_compiler_static_works=no
  lt_cv_prog_compiler_static_works_CXX=no
  lt_cv_sys_max_cmd_len=512

These changes should prevent this issue in future:

  export lt_cv_prog_compiler_static_works=yes
  export lt_cv_prog_compiler_static_works_CXX=yes
  export lt_cv_sys_max_cmd_len=1572864

Also:

- provide custom autotools/libtool variables via properly named
  variable ("GCC_CONFIGURE_VARS"),
- move variables from "GCC_MAKE" to "GCC_CONFIGURE_VARS"
  (at this moment only "gcc_cv_libc_provides_ssp=yes" for musl),
- propagate it's usage for both "./configure" and "make".

Signed-off-by: Konstantin Demin <rockdrilla@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/18646
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2025-05-02 17:27:33 +02:00
c1cbcd35e7 toolchain: glibc: Update glibc 2.38 to recent HEAD
f510d75f nscd: Use time_t for return type of addgetnetgrentX
5aa4bb67 resolv: Fix some unaligned accesses in resolver [BZ #30750]
249646f1 Force DT_RPATH for --enable-hardcoded-path-in-tests
697ab62d i386: Disable Intel Xeon Phi tests for GCC 15 and above (BZ 31782)
c8cb4d2b misc: Add support for Linux uio.h RWF_NOAPPEND flag
71245363 s390x: Fix segfault in wcsncmp [BZ #31934]
7bfc3595 nptl: fix potential merge of __rseq_* relro symbols
d9d019d6 elf: Make dl-rseq-symbols Linux only
bb30bd21 Linux: Make __rseq_size useful for feature detection (bug 31965)
dc512364 resolv: Allow short error responses to match any query (bug 31890)
6cad0f54 resolv: Do not wait for non-existing second DNS response after error (bug 30081)
1bed6acf resolv: Track single-request fallback via _res._flags (bug 31476)
0301637b linux: Update the mremap C implementation [BZ #31968]
f0e21145 mremap: Update manual entry
6bb75212 Add mremap tests
3ac7ba61 Update syscall lists for Linux 6.5
9184c136 resolv: Fix tst-resolv-short-response for older GCC (bug 32042)
059f82c3 Fix name space violation in fortify wrappers (bug 32052)
c005d1bd x86: Fix bug in strchrnul-evex512 [BZ #32078]
28f358bc support: Add FAIL test failure helper
99ffa84b stdio-common: Add test for vfscanf with matches longer than INT_MAX [BZ #27650]
87a1968a Make tst-ungetc use libsupport
804d3c8d ungetc: Fix uninitialized read when putting into unused streams [BZ #27821]
b9f72bd5 ungetc: Fix backup buffer leak on program exit [BZ #27821]
15ca6630 posix: Use <support/check.h> facilities in tst-truncate and tst-truncate64
f30501ca nptl: Use <support/check.h> facilities in tst-setuid3
370be858 libio: Attempt wide backup free only for non-legacy code
4dd86414 Add crt1-2.0.o for glibc 2.0 compatibility tests
fa4ad104 elf: Change ldconfig auxcache magic number (bug 32231)
9423cc53 nptl: initialize rseq area prior to registration
37ded328 nptl: initialize cpu_id_start prior to rseq registration
cf067723 x86: Avoid integer truncation with large cache sizes (bug 32470)
5c9be512 x86_64: Sort fpu/multiarch/Makefile
49016f21 x86_64: Add log2 with FMA
b2a45f1e x86_64: Add expm1 with FMA
c92946d9 x86_64: Add log1p with FMA
58822f95 x86: Check the lower byte of EAX of CPUID leaf 2 [BZ #30643]
7772f935 elf: Fix slow tls access after dlopen [BZ #19924]
5a64f933 x86: Only align destination to 1x VEC_SIZE in memset 4x loop
0d14bf07 sysdeps/x86/Makefile: Split and sort tests
dc176211 x86_64: Fix missing wcsncat function definition without multiarch (x86-64-v4)
04b8d484 x86: Improve large memset perf with non-temporal stores [RHEL-29312]
12fec8aa x86/string: Fixup alignment of main loop in str{n}cmp-evex [BZ #32212]
48642ef1 elf: Avoid some free (NULL) calls in _dl_update_slotinfo
549e7f7c elf: Support recursive use of dynamic TLS in interposed malloc
c32fd593 Fix underallocation of abort_msg_s struct (CVE-2025-0395)
650a0aaa stdlib: Test using setenv with updated environ [BZ #32588]
f984e2d7 assert: Add test for CVE-2025-0395
9ca74b8a AArch64: Improve generic strlen
95aa2143 AArch64: Optimize memset
5fe151d8 AArch64: Remove zva_128 from memset
3de51123 math: Improve layout of expf data
52c2b155 AArch64: Add SVE memset
097299ff AArch64: Use prefer_sve_ifuncs for SVE memset
5a08d049 math: Improve layout of exp/exp10 data

Signed-off-by: Konstantin Demin <rockdrilla@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/18648
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2025-05-01 19:26:53 +02:00
5c8301e800 toolchain: gcc: switch default to 14
Its time to use GCC14 as the default compiler instead of GCC13.

Link: https://github.com/openwrt/openwrt/pull/18597
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-04-29 12:27:32 +02:00
b9cb07eced toolchain: mold: add PKG_NAME to Makefile
In include/host-build.mk, HOST_BUILD_DIR is set by default value:
HOST_BUILD_DIR ?= $(BUILD_DIR_HOST)/$(PKG_NAME)

However the mold package has no PKG_NAME set at all. This means the
HOST_BUILD_DIR is identical to $(BUILD_DIR_HOST).

In the Host/Prepare stage, by default, the $(HOST_BUILD_DIR) will be
deleted at first unconditionally. Since HOST_BUILD_DIR is identical
to $(BUILD_DIR_HOST), the entire build_dir/toolchain-* directory will
be removed and this will cause build failure.

Adding PKG_NAME:=ld.mold can solve this issue.

Signed-off-by: Weijie Gao <hackpascal@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/18567
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-04-23 12:19:26 +02:00
a06ed856bb gdb: update to 16.2
See news file for changes:
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=blob_plain;f=gdb/NEWS;hb=gdb-16.2-release

It fixes compilation with GCC15.

Link: https://github.com/openwrt/openwrt/pull/18519
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-04-18 02:10:48 +02:00
d3bb23946e toolchain: gcc: fix build error with Xcode 16.3
Xcode 16.3 defines TARGET_OS_MAC, it was not defined in prior versions.
zutil.h conditionally defines fdopen as NULL when this macro is defined,
resulting in the following build error:

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_stdio.h:318:7: e>
  318 | FILE    *fdopen(int, const char *) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_2_0, __DARWIN_ALIAS(fdopen));
      |          ^
./zutil.h:147:33: note: expanded from macro 'fdopen'
  147 | #        define fdopen(fd,mode) NULL /* No fdopen() */

In Xcode 16.2 and earlier, TARGET_OS_MAC was not defined so this entire
block was ignored, gcc and gdb used to compile and work fine.

This may have been used for compatibility with older versions of macOS,
but is no longer needed. By pure luck, the build worked fine for a long
time, because it did not properly detect macOS.
Fixed by removing the check for TARGET_OS_MAC.

Note that since Xcode 16.3, an entire set of TARGET_OS macros
are now defined, most of which are set to 0:
TARGET_OS_LINUX 0
TARGET_OS_MAC 1
TARGET_OS_OSX 1

Signed-off-by: Georgi Valkov <gvalkov@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/18467
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-04-16 14:38:34 +02:00
dfb8115d0c toolchain: gdb: fix build error with Xcode 16.3
Xcode 16.3 defines TARGET_OS_MAC, it was not defined in prior versions.
zutil.h conditionally defines fdopen as NULL when this macro is defined,
resulting in the following build error:

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_stdio.h:318:7: error: expected identifier or '('
  318 | FILE    *fdopen(int, const char *) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_2_0, __DARWIN_ALIAS(fdopen));
      |          ^
./zutil.h:147:33: note: expanded from macro 'fdopen'
  147 | #        define fdopen(fd,mode) NULL /* No fdopen() */

In Xcode 16.2 and earlier, TARGET_OS_MAC was not defined so this entire
block was ignored, gcc and gdb used to compile and work fine.

This may have been used for compatibility with older versions of macOS,
but is no longer needed. By pure luck, the build worked fine for a long
time, because it did not properly detect macOS.
Fixed by removing the check for TARGET_OS_MAC.

Note that since Xcode 16.3, an entire set of TARGET_OS macros
are now defined, most of which are set to 0:
TARGET_OS_LINUX 0
TARGET_OS_MAC 1
TARGET_OS_OSX 1

Signed-off-by: Georgi Valkov <gvalkov@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/18467
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-04-16 14:38:34 +02:00
6605e45676 build: conditionally build llvm bpf toolchain by default
Unless another toolchain is present (or selected), build the bpf toolchain
whenever a package is selected that needs it.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-02-07 11:16:08 +01:00
72731b445e toolchain/binutils: remove old versions
Reduce supported versions to 3.
Since 2.40 is supported by previous release, this commit
keeps it.

Signed-off-by: Yanase Yuki <dev@zpc.st>
Link: https://github.com/openwrt/openwrt/pull/16597
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-10-12 22:12:39 +02:00
1cd7708eb3 toolchain: gdb: Update to version 15.2
See news file for changes:
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=blob_plain;f=gdb/NEWS;hb=gdb-15.1-release

This requires a C++17 compiler compatible compiler.

Link: https://github.com/openwrt/openwrt/pull/16665
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-10-12 21:51:01 +02:00
4a5da15b3d toolchain/nasm: update to 2.16.03
Use gzip archive to avoid xz usage.

Signed-off-by: Yanase Yuki <dev@zpc.st>
Link: https://github.com/openwrt/openwrt/pull/16373
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-09-22 19:06:22 +02:00
a1b9c28edd toolchain: gcc: drop 110-Fix-MIPS-PR-84790.patch
According to the bugzilla link, this is fixed in gcc 14.2.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
2024-09-17 21:43:32 +08:00
802be2457f toolchain: binutils: add support for 2.43.1
Release notes:
https://lists.gnu.org/archive/html/info-gnu/2024-08/msg00003.html

No need to refresh patches
Test device: Xiaomi ax3600

Signed-off-by: Olcay Korkmaz <nuke_mania@hotmail.com>
Link: https://github.com/openwrt/openwrt/pull/16405
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-17 11:30:26 +02:00
ee64e7f202 toolchain/fortify-headers: update download url
Development of fortify-headers has been moved to GitHub.
Gentoo [1] and Alpine Linux [2] already uses it.

Since updating fortify-headers to new version causes a lot of
compile errors, this commit does not bump version.

This commit also refresh patch.

[1]: https://packages.gentoo.org/packages/sys-libs/fortify-headers
[2]: https://git.alpinelinux.org/aports/log/main/fortify-headers

Signed-off-by: Yanase Yuki <dev@zpc.st>
Link: https://github.com/openwrt/openwrt/pull/16374
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-14 13:55:15 +02:00
9cf6ce5179 toolchain: binutils: add support for 2.43
Drop two backported patches, and autorefresh the rest.

Release notes:
https://lists.gnu.org/archive/html/info-gnu/2024-08/msg00001.html

Link: https://github.com/openwrt/openwrt/pull/16175
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
2024-08-16 20:10:38 +08:00
30092019fe toolchain: gcc: update GCC 14 to 14.2.0
All patches automatically rebased.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
Link: https://github.com/openwrt/openwrt/pull/16047
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-08-13 00:30:29 +02:00
cc6a1e2abc toolchain/musl: add support for renameat2()
Backport an upstream patch to support the renameat2 syscall, added in Linux
3.15 and supported by glibc since 2.28. It is commonly used in filesystem
or security contexts, and needed building upstream kernel bpf selftests.

Link:
https://inbox.vuxu.org/musl/20240421153640.379015-1-Tony.Ambardar@gmail.com/

Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
Link: https://github.com/openwrt/openwrt/pull/15697
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2024-06-13 14:16:32 +02:00
3b63abfbfc toolchain: gcc: update to 13.3
Release Notes:
https://gcc.gnu.org/pipermail/gcc/2024-May/243980.html

Remove upstreamed patches:
- patches-13.x/020-Include-safe-ctype.h-after-C-standard-headers-to-avo.patch
- patches-13.x/021-libcc1-fix-vector-include.patch
- patches-13.x/400-LoongArch-Fix-MUSL_DYNAMIC_LINKER.patch
- patches-13.x/401-LoongArch-Modify-MUSL_DYNAMIC_LINKER.patch

Refresh patches:
- patches-13.x/300-mips_Os_cpu_rtx_cost_model.patch
- patches-13.x/970-macos_arm64-building-fix.patch

Signed-off-by: Olcay Korkmaz <nuke_mania@hotmail.com>
2024-05-28 23:55:27 +02:00
c758d6427c toolchain: gcc: add support for GCC 14
Deleted (upstreamed):
- 020-Include-safe-ctype.h-after-C-standard-headers-to-avo.patch [1]
- 021-libcc1-fix-vector-include.patch [2]

All other patches automatically rebased.

Note that selecting GCC 14, as of now, *will* result in build failures. The
packages that fail to build will be fixed as they're found. Thus, GCC 13.x is
the default, for the time being.

[1] https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=9970b576b7e4ae337af1268395ff221348c4b34a
[2] https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=5213047b1d50af63dfabb5e5649821a6cb157e33

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2024-05-12 12:47:12 +01:00
6b3195ae62 toolchain: glibc: Update glibc 2.38 to recent HEAD
23514c72b7 syslog: Fix heap buffer overflow in __vsyslog_internal (CVE-2023-6246)
d0338312aa syslog: Fix heap buffer overflow in __vsyslog_internal (CVE-2023-6779)
d37c2b20a4 syslog: Fix integer overflow in __vsyslog_internal (CVE-2023-6780)
30e546d76e x86_64: Optimize ffsll function code size.
18876c9ff5 S390: Fix building with --disable-mutli-arch [BZ #31196]
6f68075869 sparc: Fix broken memset for sparc32 [BZ #31068]
0e383d2d4e sparc64: Remove unwind information from signal return stubs [BZ#31244]
aac57faf54 sparc: Fix sparc64 memmove length comparison (BZ 31266)
0c5e5bace5 sparc: Remove unwind information from signal return stubs [BZ #31244]
b09073e631 arm: Remove wrong ldr from _dl_start_user (BZ 31339)
506e47da1d malloc: Use __get_nprocs on arena_get2 (BZ 30945)
ee4806e978 S390: Do not clobber r7 in clone [BZ #31402]
5753cda1ca linux: Use rseq area unconditionally in sched_getcpu (bug 31479)
0518bb0c16 LoongArch: Correct {__ieee754, _}_scalb -> {__ieee754, _}_scalbf
5456ff5d80 Add HWCAP2_MOPS from Linux 6.5 to AArch64 bits/hwcap.h
d8a2b56b4f AArch64: Add support for MOPS memcpy/memmove/memset
25b66e8c4a AArch64: Cleanup ifuncs
1521237c32 AArch64: Cleanup emag memset
156e44845f AArch64: Add memset_zva64
a08ff92294 AArch64: Remove Falkor memcpy
168ae58e6e aarch64: correct CFI in rawmemchr (bug 31113)
1bf17ce978 aarch64: fix check for SVE support in assembler
92da7c2cfe AArch64: Check kernel version for SVE ifuncs
20534f8176 powerpc: Fix ld.so address determination for PCREL mode (bug 31640)
e1135387de iconv: ISO-2022-CN-EXT: fix out-of-bound writes when writing escape sequence (CVE-2024-2961)
61484011e7 sparc: Remove 64 bit check on sparc32 wordsize (BZ 27574)
78d9f91da6 login: Check default sizes of structs utmp, utmpx, lastlog
68bff88592 login: structs utmp, utmpx, lastlog _TIME_BITS independence (bug 30701)
decc9f504a nptl: Fix tst-cancel30 on kernels without ppoll_time64 support
29e20bd122 i386: ulp update for SSE2 --disable-multi-arch configurations
5968aebb86 CVE-2024-33599: nscd: Stack-based buffer overflow in netgroup cache (bug 31677)
541ea5172a CVE-2024-33600: nscd: Do not send missing not-found response in addgetnetgrentX (bug 31678)
2ae9446c1b CVE-2024-33600: nscd: Avoid null pointer crashes after notfound response (bug 31678)
71af8ca864 CVE-2024-33601, CVE-2024-33602: nscd: netgroup: Use two buffers in addgetnetgrentX (bug 31680)
e9f05fa1c6 elf: Also compile dl-misc.os with $(rtld-early-cflags)

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-05-04 20:03:47 +02:00
7fcb82665e loongarch64: new target
Add target for Loongson LoongArch64-based boards.

LoongArch is a new RISC ISA developed by Loongson. It's a bit like
MIPS or RISC-V. LoongArch includes both 32-bit and 64-bit versions
(LoongArch32/LoongArch64).

Loongson 3A5000 and 3A6000 are the two existing CPUs of LoongArch64
and is used for PC products. It's BIOS supports ACPI and UEFI-only
boot. These CPUs supports SMP and SMT.

At present only LoongArch64 is supported by linux kernel.

Toolchain requirement:
binutils >= 2.40
gcc >= 13.1

For details, please check the following links:
https://lwn.net/Articles/861951/
https://loongson.github.io/LoongArch-Documentation/README-EN.html

Signed-off-by: Weijie Gao <hackpascal@gmail.com>
2024-05-04 14:14:16 +08:00
197d90dc31 toolchain/musl: fix loongarch64 ldso file name
GCC has changed musl dynamic linker name from
ld-musl-loongarch-lp64d.so.1 to ld-musl-loongarch64.so.1 recently [1].

This means there are two dynamic linker names will be used across different
ersions of GCC. But musl 1.2.5 only supports the new name while the GCC
we're currently using uses the old name.

To maintain compatibility with all versions of GCC, the musl is then patched
to generate two symbolic links to libc.so with both old and new names.

[1] https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=8bccee51f0deac64b79cd9ad75df599422f4c8ff

Signed-off-by: Weijie Gao <hackpascal@gmail.com>
2024-05-04 14:12:56 +08:00
c5946c0724 toolchain/gcc: fix loongarch64 ldso file name
GCC has changed musl dynamic linker name from
ld-musl-loongarch-lp64d.so.1 to ld-musl-loongarch64.so.1 recently [1].

Meanwhile musl 1.2.5 only supports the new name. So it's better to follow
the new name.

[1] https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=8bccee51f0deac64b79cd9ad75df599422f4c8ff

Signed-off-by: Weijie Gao <hackpascal@gmail.com>
2024-05-04 14:12:56 +08:00
5ee2b6fe57 toolchain: glibc: update to glibc 2.38
This updates glibc to version 2.38.

Add --enable-crypt since the crypt function got disabled in 2.38, but we
still need it.
Also add the newly introduced --enable-fortify-source flag and hook it up
to the build system.

Switch to .zst archive while at it.

Signed-off-by: Kazuki H <kazukih0205@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/14259
[ switch to .zst and fix mirror HASH ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2024-04-29 22:55:02 +02:00
c390c6c709 toolchain: binutils: switch to version 2.42 by default
Change the default binutils version to 2.42.

Tested-by: Jonathan Lancett <j.lancett@ntlworld.com>
Tested-by: Andre Heider <a.heider@gmail.com>
Signed-off-by: Nick Hainke <vincent@systemli.org>
2024-04-29 00:41:47 +02:00
e1ca08518e toolchain/nasm: fix PKG_CPE_ID
cpe:/a:nasm:netwide_assembler is the correct CPE ID for nasm:
https://nvd.nist.gov/products/cpe/search/results?keyword=cpe:2.3🅰️nasm:netwide_assembler

Fixes: bcf02c5d31 (toolchain: assign PKG_CPE_ID)

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2024-04-27 12:08:41 +02:00
0e161968a7 toolchain/wrapper: fill and reference info.mk in staging_dir ext toolchain
Currently when external toolchain is used, a info.mk is created (with
to-be-filled values) but is never actually filled with real values and
is never actually used in rules.mk.

This info.mk is used down the code with special packages like libgcc to
reference info like gcc version and package special library.

To mimic what is done with internal toolchain, add the include in
rules.mk for info.mk also for external library and in fix
toolchain/wrapper to fill the staging_dir info.mk.

The logic is to check if the external toolchain provide an info.mk and
if it doesn't we at least fill the GCC_VERSION with the value set in the
.config file.

With this special library like libgcc correctly reference and have set the
GCC_VERSION variable.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2024-04-21 17:59:17 +02:00
87d7fa8885 toolchain/musl: Update to 1.2.5
Update musl C library to 1.2.5

This release adds extension functions statx and preadv2/pwritev2,
with fallback implementations for older kernels, and adds two new
ports: loongarch64 and riscv32. Minor changes to the printf family
of functions have been made for conformance to new standards
interpretations/requirements. TLSDESC support for riscv64 has also
been added.

Bugs fixed include some DNS issues related to new TCP fallback
functionality, several rare race conditions, potentially incorrect
return value when glob aborts, and several signifiant arch-specific
bugs affecting TLSDESC on arm, riscv64 icache flushing, and
sh sigsetjmp and dlsym RTLD_NEXT.

1.2.5 release notes:

new features:
- statx function (linux extension; via syscall and fallback using fstatat)
- clone function is now usable and gives _Fork-like consistency in child
- statvfs now provides f_type result
- preadv2 and pwritev2 (linux extension) syscall wrappers
- riscv64 TLSDESC support

new ports:
- loongarch64
- riscv32

compatibility:
- DNS resolver can now handle answers with long CNAME chains
- string.h no longer provides (C23-incompat) non-prototype decl of basename
- fstatat statx backend now matches stat syscall non-automounting behavior
- mntent interfaces now handle escaped whitespace in paths/options

standards updates:
- printf %lc of nul wchar now produces output
- snprintf and swprintf no longer fail on n > INT_MAX
- ppoll is now exposed in default feature profile

bugs fixed:
- some long DNS answers were wrongly rejected despite new TCP support
- glob could wrongly return GLOB_NOMATCH if aborted before any matches
- multithreaded set*id could malfunction from thread sequencing logic bug
- certain use of threads after fork could deadlock thread-list lock
- posix_spawn child could deadlock in race with async parent death
- mbrtowc return value was wrong if argument n exceeded UINT_MAX
- 80-bit extended acoshl and powl got some corner cases wrong
- syslog incorrectly generated localized timestamps

arch-specific bugs fixed:
- arm (32-bit) TLSDESC malfunctioned due to addends being processed wrong
- riscv64 icache flush operation was non-functional
- sh sigsetjmp failed to properly restore call-saved register r8 on return
- sh dlsym RTLD_NEXT did not identify calling module correctly

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
[Removed patch adding basename hack again]
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-04-14 17:38:09 +02:00
12b2cb2ec3 config: fix CONFIG_GDB appearing in main menuconfig menu
I noticed that CONFIG_GDB was suddenly appearing in the main menuconfig
menu despite the fact that it should be visible only when TOOLCHAINOPTS
is selected and under a dedicated menu.

After some trial and error, it seems that this was caused by the recent
addition of GCC_USE_DEFAULT_VERSION, and after even more trial and error
it gets fixed as soon GCC_USE_DEFAULT_VERSION is placed after GCC_VERSION.

So, lets simply put GCC_USE_DEFAULT_VERSION after GCC_VERSION.

Fixes: 501ef81040 ("config: select KERNEL_WERROR if building with default GCC version")
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-04-09 19:30:41 +02:00
501ef81040 config: select KERNEL_WERROR if building with default GCC version
At the moment we have to manually follow the default GCC version
also in config/Config-kernel.in. This tends to be forgotten at GCC
version bumps (just happened when switching from version 12 to 13).
Instead, introduce a hidden Kconfig symbol which implies KERNEL_WERROR
in toolchain/gcc/Config.in where it is visible for developers changing
the default version.

Also remove the explicit default on BUILDBOT to avoid a circular
dependency and also because buildbots anyway implicitly always select
the default GCC version.

Reference: https://github.com/openwrt/openwrt/pull/15064
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2024-04-08 01:40:15 +01:00