diff --git a/recipes/devel/cross-toolchain.yaml b/recipes/devel/cross-toolchain.yaml index 8d64fb80..e85115b1 100644 --- a/recipes/devel/cross-toolchain.yaml +++ b/recipes/devel/cross-toolchain.yaml @@ -159,7 +159,7 @@ multiPackage: environment: AUTOCONF_TARGET: "x86_64-l4re" ARCH: "x86_64" - GCC_LIBC: "uclibc-l4re" + GCC_LIBC: "musl-l4re" # x86_64 "cross" compiling toolchain. Ships its own glibc. x86_64-linux-gnu: @@ -213,7 +213,7 @@ multiPackage: environment: AUTOCONF_TARGET: "aarch64-l4re" ARCH: "arm64" - GCC_LIBC: "uclibc-l4re" + GCC_LIBC: "musl-l4re" GCC_TARGET_ARCH: "armv8-a" # ARMv8-A AArch64 "cross" compiling toolchain. Ships its own glibc. diff --git a/recipes/devel/gcc.yaml b/recipes/devel/gcc.yaml index 80ca51e6..f9bbeb92 100644 --- a/recipes/devel/gcc.yaml +++ b/recipes/devel/gcc.yaml @@ -238,7 +238,7 @@ multiPackage: glibc: newlib: uclibc-ng: - uclibc-l4re: + musl-l4re: mingw-w64: GCC_ENABLE_LANGUAGES: @@ -289,7 +289,7 @@ multiPackage: - libs::glibc - libs::newlib - libs::uclibc-ng - - libs::uclibc-l4re + - libs::musl-l4re - libs::mingw-w64 multiPackage: @@ -314,8 +314,8 @@ multiPackage: if: "$(eq,${GCC_LIBC},newlib)" - name: libs::uclibc-ng if: "$(eq,${GCC_LIBC},uclibc-ng)" - - name: libs::uclibc-l4re - if: "$(eq,${GCC_LIBC},uclibc-l4re)" + - name: libs::musl-l4re + if: "$(eq,${GCC_LIBC},musl-l4re)" - name: libs::mingw-w64 if: "$(eq,${GCC_LIBC},mingw-w64)" diff --git a/recipes/devel/gcc/0106-l4re-use-musl.patch b/recipes/devel/gcc/0106-l4re-use-musl.patch new file mode 100644 index 00000000..255e5646 --- /dev/null +++ b/recipes/devel/gcc/0106-l4re-use-musl.patch @@ -0,0 +1,43 @@ +From: Adam Lackorzynski +Subject: [PATCH] L4Re: use musl as the libc + +L4Re switched from uClibc-ng to musl. musl has the dynamic linker built into +libc, and libstdc++ uses the generic OS configuration with it, as for +linux-musl. + +diff -Nurp a/gcc/config/i386/l4re64.h b/gcc/config/i386/l4re64.h +--- a/gcc/config/i386/l4re64.h ++++ b/gcc/config/i386/l4re64.h +@@ -14,7 +14,7 @@ + %{!static: \ + %{!static-pie: \ + %{rdynamic:-export-dynamic} \ +- -dynamic-linker=/rom/libld-l4.so.1}} \ ++ -dynamic-linker=/rom/libc.so.1}} \ + %{static:-static} \ + %{static-pie:-static -pie --no-dynamic-linker -z text}}" + +diff -Nurp a/gcc/config/l4re.h b/gcc/config/l4re.h +--- a/gcc/config/l4re.h ++++ b/gcc/config/l4re.h +@@ -35,7 +35,7 @@ + %{!static: \ + %{!static-pie: \ + %{rdynamic:-export-dynamic} \ +- -dynamic-linker=/rom/libld-l4.so.1}} \ ++ -dynamic-linker=/rom/libc.so.1}} \ + %{static:-static} \ + %{static-pie:-static -pie --no-dynamic-linker -z text}}" + +diff -Nurp a/libstdc++-v3/configure.host b/libstdc++-v3/configure.host +--- a/libstdc++-v3/configure.host ++++ b/libstdc++-v3/configure.host +@@ -256,7 +256,7 @@ + os_include_dir="os/bsd/freebsd" + ;; + l4re*) +- os_include_dir="os/uclibc" ++ os_include_dir="os/generic" + ;; + linux-musl*) + os_include_dir="os/generic" diff --git a/recipes/libs/uclibc-l4re.yaml b/recipes/libs/musl-l4re.yaml similarity index 85% rename from recipes/libs/uclibc-l4re.yaml rename to recipes/libs/musl-l4re.yaml index 1478c6c0..fc8cde43 100644 --- a/recipes/libs/uclibc-l4re.yaml +++ b/recipes/libs/musl-l4re.yaml @@ -1,7 +1,7 @@ inherit: [make, strip] metaEnvironment: - PKG_VERSION: "r-2025-W50" + PKG_VERSION: "r-2026-W43" PKG_LICENSE: "MIT AND GPL-3.0-only with GCC-exception-3.1 AND GPL-3.0-or-later AND GPL-2.0-only" checkoutSCM: @@ -18,22 +18,23 @@ checkoutSCM: buildTools: [host-toolchain, target-toolchain, flex, bison] buildToolsWeak: [m4, perl] -buildVars: [ARCH, CROSS_COMPILE] +buildVars: [AUTOCONF_HOST, CROSS_COMPILE] buildScript: | - case $ARCH in - arm64) + case ${AUTOCONF_HOST%%-*} in + aarch64) DEFCONFIG=config.arm64-virt-v8a ;; x86_64) DEFCONFIG=config.amd64 ;; *) - echo "Unsupported: $ARCH" >&2 + echo "Unsupported: $AUTOCONF_HOST" >&2 exit 1 esac if [[ ! -e build/.bob-init-done ]] ; then cp "$1/mk/defconfig/$DEFCONFIG" defconfig + echo "CONFIG_L4_LIBC_MUSL=y" >> defconfig echo "CONFIG_COMPILER_RT_USE_TOOLCHAIN_LIBGCC=n" >> defconfig echo "CONFIG_BID_STRIP_BINARIES=n" >> defconfig rm -rf build