To achieve this, the `kernel' pseudo-OS value was added, intended to identify targets requiring a kernel-specific compiler and base system.
Signed-off-by: Arsen Arsenović <ar...@aarsen.me> --- Evening, This is version 2 of the config.sub patch we sent in for Managarm. This version locks down on the `kernel' pseudo-OS value so that it can only be used with OSes that have a separate kernel target, as to not be too generic/confusing. Apologies for taking a while to submit v2, and thank you in advance. config.sub | 25 ++++++++++++++++++++++--- testsuite/config-sub.data | 9 +++++++++ 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/config.sub b/config.sub index fbaa37f..e65e0ac 100755 --- a/config.sub +++ b/config.sub @@ -145,7 +145,7 @@ case $1 in nto-qnx* | linux-* | uclinux-uclibc* \ | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \ | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \ - | storm-chaos* | os2-emx* | rtmk-nova*) + | storm-chaos* | os2-emx* | rtmk-nova* | managarm-*) basic_machine=$field1 basic_os=$maybe_os ;; @@ -1341,6 +1341,10 @@ EOF kernel=linux os=`echo "$basic_os" | sed -e 's|linux|gnu|'` ;; + managarm*) + kernel=managarm + os=$(echo $basic_os | sed -e 's|managarm|mlibc|') + ;; *) kernel= os=$basic_os @@ -1754,7 +1758,7 @@ case $os in | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \ | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr* \ - | fiwix* ) + | fiwix* | mlibc* ) ;; # This one is extra strict with allowed versions sco3.2v2 | sco3.2v[4-9]* | sco5v6*) @@ -1762,6 +1766,9 @@ case $os in ;; none) ;; + kernel* ) + # Restricted further below + ;; *) echo Invalid configuration \`"$1"\': OS \`"$os"\' not recognized 1>&2 exit 1 @@ -1776,12 +1783,24 @@ case $kernel-$os in ;; uclinux-uclibc* ) ;; - -dietlibc* | -newlib* | -musl* | -relibc* | -uclibc* ) + managarm-mlibc* ) + ;; + managarm-kernel* ) + ;; + -dietlibc* | -newlib* | -musl* | -relibc* | -uclibc* | -mlibc* ) # These are just libc implementations, not actual OSes, and thus # require a kernel. echo "Invalid configuration \`$1': libc \`$os' needs explicit kernel." 1>&2 exit 1 ;; + -kernel* ) + echo "Invalid configuration \`$1': -kernel must not appear on its own." 1>&2 + exit 1 + ;; + *-kernel* ) + echo "Invalid configuration \`$1': Kernel \`$kernel' does not support -kernel." 1>&2 + exit 1 + ;; kfreebsd*-gnu* | kopensolaris*-gnu*) ;; vxworks-simlinux | vxworks-simwindows | vxworks-spe) diff --git a/testsuite/config-sub.data b/testsuite/config-sub.data index ed05281..ac06881 100644 --- a/testsuite/config-sub.data +++ b/testsuite/config-sub.data @@ -16,6 +16,9 @@ aarch64-bme aarch64-unknown-bme aarch64-elf aarch64-unknown-elf aarch64-genode aarch64-unknown-genode aarch64-linux aarch64-unknown-linux-gnu +aarch64-managarm aarch64-unknown-managarm-mlibc +aarch64-managarm-kernel aarch64-unknown-managarm-kernel +aarch64-managarm-mlibc aarch64-unknown-managarm-mlibc aarch64-unknown-elf aarch64-unknown-elf aarch64-unknown-linux aarch64-unknown-linux-gnu aarch64-wrs-vxworks aarch64-wrs-vxworks @@ -615,6 +618,9 @@ riscv-company-elf riscv-company-elf riscv-company-hcos riscv-company-hcos riscv-elf riscv-unknown-elf riscv-linux riscv-unknown-linux-gnu +riscv-managarm riscv-unknown-managarm-mlibc +riscv-managarm-kernel riscv-unknown-managarm-kernel +riscv-managarm-mlibc riscv-unknown-managarm-mlibc riscv-twizzler riscv-unknown-twizzler riscv-zephyr riscv-unknown-zephyr riscv32 riscv32-unknown-none @@ -842,6 +848,9 @@ x86_64-fuchsia x86_64-pc-fuchsia x86_64-genode x86_64-pc-genode x86_64-glidix x86_64-pc-glidix x86_64-linux-relibc x86_64-pc-linux-relibc +x86_64-managarm x86_64-pc-managarm-mlibc +x86_64-managarm-kernel x86_64-pc-managarm-kernel +x86_64-managarm-mlibc x86_64-pc-managarm-mlibc x86_64-nto x86_64-pc-nto-qnx x86_64-os108 x86_64-pc-os108 x86_64-pc-ptx x86_64-pc-ptx -- 2.35.1