[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
4-component parsing, and arm*-*-none-eabi in particular
From: |
John Ericson |
Subject: |
4-component parsing, and arm*-*-none-eabi in particular |
Date: |
Mon, 23 Apr 2018 15:20:32 -0400 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 |
Hello,
I've long noticed that configs like `armv7m-unknown-none-eabi`, though
supported by LLVM, are not supported by gnu-config. [LLVM would treat
"none" as the kernel, and "eabi" as the OS/ABI.] I recently found the
time to go investigate why, and this is what I found and patched.
The problem is the way 4-component configs (i.e. 3 dashes) are parsed.
Commit b7ab42761455e051a57876252740cb398aa952eb is the source of this
support, which works by special-casing certain KERNEL-OPERATING_SYSTEM
pairs, to disambiguate between CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
and CPU_TYPE-KERNEL-OPERATING_SYSTEM.
This is fine for 3-component triples, but is overkill in the 4-component
case where the config is always unambiguously
CPU_TYPE-KERNEL-OPERATING_SYSTEM. Additionally, the original `if [
$basic_machine != $1 ]` check to disambiguate between 1- and 2-component
configs is a bit obtuse.
I rewrote the whole chunk of code in what I hope you all agree is a more
readable manner, using sed only to pull out the (up to 4) components and
then doing everything else with simple pure bash. Finally, I whitelisted
and tested `arm*-*-none-eabi`, which I hope a conservative starting point.
Hopefully this all makes sense, and the commit messages add additional
clarity.
Thanks,
John
0001-Rewrite-basic_machine-if-with-case.patch
Description: Text document
0002-Rewrite-logic-handling-n-separated-components.patch
Description: Text document
0003-Accept-arm-none-eabi.patch
Description: Text document
- 4-component parsing, and arm*-*-none-eabi in particular,
John Ericson <=