Skip to content

Commit 617d6b3

Browse files
committed
devel::gcc: wire up uclibc support
Unfortunately, we have to explicitly disable libsanitizer for uclibc because it does not build. The libc::libc-tgt package is now virtual because the right package needs to be selected, depending on the libc flavour.
1 parent 83ae2d5 commit 617d6b3

3 files changed

Lines changed: 34 additions & 11 deletions

File tree

aliases/libs/libc.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
multiPackage:
2+
tgt: "libs::libc-$(libc-flavour,$(get-tool-env,target-toolchain,AUTOCONF_HOST))-tgt"

recipes/devel/gcc.yaml

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -182,14 +182,15 @@ multiPackage:
182182
- name: devel::gcc-cross-bare
183183
use: [tools]
184184
forward: True
185-
- name: libs::glibc
186-
if: "$(eq,${GCC_LIBC},glibc)"
187-
tools:
188-
target-toolchain: cross-target-toolchain
189-
- name: libs::newlib
190-
if: "$(eq,${GCC_LIBC},newlib)"
191-
tools:
185+
- tools:
192186
target-toolchain: cross-target-toolchain
187+
depends:
188+
- name: libs::glibc
189+
if: "$(eq,${GCC_LIBC},glibc)"
190+
- name: libs::newlib
191+
if: "$(eq,${GCC_LIBC},newlib)"
192+
- name: libs::uclibc-ng
193+
if: "$(eq,${GCC_LIBC},uclibc-ng)"
193194

194195
Config:
195196
GCC_LIBC:
@@ -198,6 +199,7 @@ multiPackage:
198199
choice:
199200
glibc:
200201
newlib:
202+
uclibc-ng:
201203

202204
GCC_ENABLE_LANGUAGES:
203205
help: >
@@ -216,9 +218,15 @@ multiPackage:
216218
OPTIONS=( "--with-multilib-list=$GCC_MULTILIB" )
217219
fi
218220
219-
if [[ "$GCC_LIBC" = newlib ]] ; then
220-
OPTIONS+=( --with-newlib )
221-
fi
221+
case "$GCC_LIBC" in
222+
newlib)
223+
OPTIONS+=( --with-newlib )
224+
;;
225+
uclibc-ng)
226+
# libsanitizer does not build with uclibc-ng
227+
OPTIONS+=( --disable-libsanitizer )
228+
;;
229+
esac
222230
223231
configureGcc \
224232
--with-sysroot=/usr/sysroots/${AUTOCONF_TARGET} \
@@ -235,6 +243,7 @@ multiPackage:
235243
- devel::binutils
236244
- libs::glibc
237245
- libs::newlib
246+
- libs::uclibc-ng
238247

239248
multiPackage:
240249
# Straightforward cross compiler. This is a regular cross compiler

recipes/libs/libc.yaml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@ buildScript: |
3030
}
3131
3232
multiPackage:
33-
tgt:
33+
# the "tgt" multipackage is provided by aliases/libs/libc.yaml
34+
35+
# glibc flavour
36+
glibc-tgt:
3437
buildScript: |
3538
copyFiles /lib/ /lib64/ /lib32/ /usr/ /usr/lib/ \
3639
"/usr/lib/gconv/***" \
@@ -51,6 +54,15 @@ multiPackage:
5154
"libutil*.so*" \
5255
"!*"
5356
57+
# uclibc flavour
58+
uclibc-tgt:
59+
buildScript: |
60+
copyFiles /lib/ /usr/ /usr/lib/ \
61+
"ld*.so*" \
62+
"libc.so.*" \
63+
"libuClibc*.so" \
64+
"!*"
65+
5466
threaddb-tgt:
5567
buildScript: |
5668
copyFiles /usr/ /usr/lib/ \

0 commit comments

Comments
 (0)