From 998ba1414387b4ce1a519be234e1609bc7912e0c Mon Sep 17 00:00:00 2001 From: John Ericson Date: Tue, 4 Jul 2023 18:52:51 -0400 Subject: [PATCH] config.sub: Accept $cpu-$vendor-none-{coff,elf} 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 (none-coff*, none-elf*): Recognize. * testsuite/config-sub.data (arm-unknown-none-coff, arm-unknown-none-elf, riscv64-company-none-elf): New tests. * doc/config.sub.1: Regenerate. --- config.sub | 6 +++++- doc/config.sub.1 | 2 +- testsuite/config-sub.data | 3 +++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/config.sub b/config.sub index 9865d6e..f28eb2f 100755 --- a/config.sub +++ b/config.sub @@ -4,7 +4,7 @@ # shellcheck disable=SC2006,SC2268 # see below for rationale -timestamp='2023-06-26' +timestamp='2023-07-04' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -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/doc/config.sub.1 b/doc/config.sub.1 index 94c6d20..bad6b39 100644 --- a/doc/config.sub.1 +++ b/doc/config.sub.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.48.5. -.TH CONFIG.SUB "1" "July 2023" "GNU config.sub (2023-06-26)" "User Commands" +.TH CONFIG.SUB "1" "July 2023" "GNU config.sub (2023-07-04)" "User Commands" .SH NAME config.sub \- validate and canonicalize a configuration triplet .SH SYNOPSIS diff --git a/testsuite/config-sub.data b/testsuite/config-sub.data index bb19dc2..2bacb05 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 @@ -639,6 +641,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