This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [00/11] TI C6X binutils port: introduction
... here is the config.git patch I forgot to attach.
This patch improves config.sub handling of tic6x-* and c6x-* targets -
and, since C54X and C55X are handled in the same places by essentially
the same code, the same changes are made to their handling.
The motivation is an ELF-based binutils port that I will soon be
submitting. The present handling of these targets has clear
inconsistencies that are obviously problematic for such a port:
$ ./config.sub c6x-elf
tic6x-unknown-coff
$ ./config.sub c6x-none-elf
c6x-none-elf
$ ./config.sub tic6x-none-elf
tic6x-none-elf
$ ./config.sub tic6x-elf
tic6x-unknown-coff
The canonical names remain of the form tic6x-* (with c6x-* as
aliases), and I didn't change the use of -coff as a default if no OS
is specified, for compatibility with any existing code that expects
particular semantics from targets such as plain "c6x". TI's tools are
in the process of transitioning from COFF to ELF (see
<http://tiexpressdsp.com/index.php/C6000_EABI:C6000_EABI_Migration>)
but their default is still COFF. However, with this patch config.sub
now *consistently* uses tic6x-* as canonical (see above for how this
was previously inconsistent), and does not override the OS with -coff
(again, see above for previous inconsistency in such overriding) if
another OS was specified by the user. The patch adds testcases to
show what I think the correct handling of these targets is.
(I have no information about actual existence of ELF tools for C54X
and C55X beyond the existence of an official e_machine value for C55X,
but I think overriding an OS explicitly specified by the user, other
than translating an alias for an OS name to a canonical version, is
always wrong.)
Please commit if OK.
2010-03-22 Joseph Myers <joseph@codesourcery.com>
* config.sub: Always map c54x-*, c55x-* and c6x-* to corresponding
tic54x, tic55x and tic6x names. Only use -coff as a default OS if
no OS specified.
* testsuite/config-sub.data: Add test cases.
diff --git a/config.sub b/config.sub
index c2d1257..ae35431 100755
--- a/config.sub
+++ b/config.sub
@@ -4,7 +4,7 @@
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
# Free Software Foundation, Inc.
-timestamp='2010-01-22'
+timestamp='2010-03-22'
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
@@ -295,7 +295,7 @@ case $basic_machine in
| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
| spu | strongarm \
- | tahoe | thumb | tic4x | tic80 | tron \
+ | tahoe | thumb | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
| ubicom32 \
| v850 | v850e \
| we32k \
@@ -303,6 +303,15 @@ case $basic_machine in
| z8k | z80)
basic_machine=$basic_machine-unknown
;;
+ c54x)
+ basic_machine=tic54x-unknown
+ ;;
+ c55x)
+ basic_machine=tic55x-unknown
+ ;;
+ c6x)
+ basic_machine=tic6x-unknown
+ ;;
m6811 | m68hc11 | m6812 | m68hc12 | picochip)
# Motorola 68HC11/12.
basic_machine=$basic_machine-unknown
@@ -334,7 +343,7 @@ case $basic_machine in
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
| avr-* | avr32-* \
| bfin-* | bs2000-* \
- | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
+ | c[123]* | c30-* | [cjt]90-* | c4x-* \
| clipper-* | craynv-* | cydra-* \
| d10v-* | d30v-* | dlx-* \
| elxsi-* \
@@ -482,6 +491,15 @@ case $basic_machine in
basic_machine=powerpc-ibm
os=-cnk
;;
+ c54x-*)
+ basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ c55x-*)
+ basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ c6x-*)
+ basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
c90)
basic_machine=c90-cray
os=-unicos
@@ -1075,18 +1093,6 @@ case $basic_machine in
basic_machine=t90-cray
os=-unicos
;;
- tic54x | c54x*)
- basic_machine=tic54x-unknown
- os=-coff
- ;;
- tic55x | c55x*)
- basic_machine=tic55x-unknown
- os=-coff
- ;;
- tic6x | c6x*)
- basic_machine=tic6x-unknown
- os=-coff
- ;;
# This must be matched before tile*.
tilegx*)
basic_machine=tilegx-unknown
@@ -1484,6 +1490,15 @@ case $basic_machine in
c4x-* | tic4x-*)
os=-coff
;;
+ tic54x-*)
+ os=-coff
+ ;;
+ tic55x-*)
+ os=-coff
+ ;;
+ tic6x-*)
+ os=-coff
+ ;;
# This must come before the *-dec entry.
pdp10-*)
os=-tops20
diff --git a/testsuite/config-sub.data b/testsuite/config-sub.data
index a579755..80c5fc6 100644
--- a/testsuite/config-sub.data
+++ b/testsuite/config-sub.data
@@ -166,3 +166,35 @@ ubicom32-elf ubicom32-unknown-elf
i586-auroraux i586-pc-auroraux
i586-auroraux5.0 i586-pc-auroraux5.0
i386-pc-nacl i386-pc-nacl
+c54x tic54x-unknown-coff
+c54x-coff tic54x-unknown-coff
+c54x-none-coff tic54x-none-coff
+c54x-unknown-coff tic54x-unknown-coff
+tic54x tic54x-unknown-coff
+tic54x-coff tic54x-unknown-coff
+tic54x-none-coff tic54x-none-coff
+tic54x-unknown-coff tic54x-unknown-coff
+c55x tic55x-unknown-coff
+c55x-coff tic55x-unknown-coff
+c55x-none-coff tic55x-none-coff
+c55x-unknown-coff tic55x-unknown-coff
+tic55x tic55x-unknown-coff
+tic55x-coff tic55x-unknown-coff
+tic55x-none-coff tic55x-none-coff
+tic55x-unknown-coff tic55x-unknown-coff
+c6x tic6x-unknown-coff
+c6x-coff tic6x-unknown-coff
+c6x-none-coff tic6x-none-coff
+c6x-unknown-coff tic6x-unknown-coff
+c6x-elf tic6x-unknown-elf
+c6x-none-elf tic6x-none-elf
+c6x-unknown-elf tic6x-unknown-elf
+c6x-uclinux tic6x-unknown-uclinux
+tic6x tic6x-unknown-coff
+tic6x-coff tic6x-unknown-coff
+tic6x-none-coff tic6x-none-coff
+tic6x-unknown-coff tic6x-unknown-coff
+tic6x-elf tic6x-unknown-elf
+tic6x-none-elf tic6x-none-elf
+tic6x-unknown-elf tic6x-unknown-elf
+tic6x-uclinux tic6x-unknown-uclinux
--
Joseph S. Myers
joseph@codesourcery.com