Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions recipes/devel/cross-toolchain.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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.
Expand Down
8 changes: 4 additions & 4 deletions recipes/devel/gcc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ multiPackage:
glibc:
newlib:
uclibc-ng:
uclibc-l4re:
musl-l4re:
mingw-w64:

GCC_ENABLE_LANGUAGES:
Expand Down Expand Up @@ -289,7 +289,7 @@ multiPackage:
- libs::glibc
- libs::newlib
- libs::uclibc-ng
- libs::uclibc-l4re
- libs::musl-l4re
- libs::mingw-w64

multiPackage:
Expand All @@ -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)"

Expand Down
43 changes: 43 additions & 0 deletions recipes/devel/gcc/0106-l4re-use-musl.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
From: Adam Lackorzynski <adam@l4re.org>
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"
11 changes: 6 additions & 5 deletions recipes/libs/uclibc-l4re.yaml → recipes/libs/musl-l4re.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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
Expand Down
Loading