These are not real OSes, they are object file formats. There is a
longstanding tradition of using them for embedded/freestanding
programming, so it makes sense to parse them with `kernel=none`.

(I have a WIP future patch that systematizes parsing these non-OSes a
bit more. That also opens the door to parsing a 5th component as LLVM
can do.)

This change unblocks an issue we've been having with Nixpkgs (see
https://github.com/NixOS/nixpkgs/issues/165836 for the longer version).
---
 config.sub                | 4 ++++
 testsuite/config-sub.data | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/config.sub b/config.sub
index 9865d6e..86fbf47 100755
--- a/config.sub
+++ b/config.sub
@@ -1816,6 +1816,10 @@ case $kernel-$os in
                ;;
        *-eabi* | *-gnueabi*)
                ;;
+       none-coff* | none-elf*)
+               # None (no kernel, i.e. freestanding / bare metal),
+               # can be paired with an output format "OS"
+               ;;
        -*)
                # Blank kernel with real OS is always fine.
                ;;
diff --git a/testsuite/config-sub.data b/testsuite/config-sub.data
index bb19dc2..c696919 100644
--- a/testsuite/config-sub.data
+++ b/testsuite/config-sub.data
@@ -91,7 +91,9 @@ arm-sysgo-pikeos                              arm-sysgo-eabi
 arm-tirtos                                     arm-unknown-tirtos
 arm-uclinux-uclibcgnueabi                      
arm-unknown-uclinux-uclibcgnueabi
 arm-unknown-netbsdelf7.0                       arm-unknown-netbsdelf7.0
+arm-unknown-none-coff                          arm-unknown-none-coff
 arm-unknown-none-eabi                          arm-unknown-none-eabi
+arm-unknown-none-elf                           arm-unknown-none-elf
 arm-unknown-riscos                             arm-unknown-riscos
 arm-zephyr                                     arm-unknown-zephyr
 arm64-apple-darwin20.0.0                       aarch64-apple-darwin20.0.0
@@ -110,6 +112,7 @@ armv6-unknown-netbsdelf7.0                  
armv6-unknown-netbsdelf7.0
 armv6-unknown-netbsdelf7.0-eabi                        
armv6-unknown-netbsdelf7.0-eabi
 armv6-unknown-netbsdelf7.0-eabihf              
armv6-unknown-netbsdelf7.0-eabihf
 armv6-unknown-none-eabi                                armv6-unknown-none-eabi
+armv6-unknown-none-eabi                                armv6-unknown-none-eabi
 armv6eb-unknown-netbsdelf7.0                   armv6eb-unknown-netbsdelf7.0
 armv6eb-unknown-netbsdelf7.0-eabi              
armv6eb-unknown-netbsdelf7.0-eabi
 armv6eb-unknown-netbsdelf7.0-eabihf            
armv6eb-unknown-netbsdelf7.0-eabihf
@@ -639,6 +642,7 @@ riscv32be-elf                                       
riscv32be-unknown-elf
 riscv32be-linux                                        
riscv32be-unknown-linux-gnu
 riscv64                                                riscv64-unknown-none
 riscv64-company-elf                            riscv64-company-elf
+riscv64-company-none-elf                       riscv64-company-none-elf
 riscv64-elf                                    riscv64-unknown-elf
 riscv64-hcos                                   riscv64-unknown-hcos
 riscv64-linux                                  riscv64-unknown-linux-gnu
-- 
2.40.1


Reply via email to