This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: ebcdic support for binutils...
On Fri, Dec 07, 2001 at 07:26:34PM -0500, DJ Delorie wrote:
>
> > In particular, in libiberty/safe-ctype.c:
> >
> > So. I was wondering if there was a workaround for this, or if not, how I could
> > get the EBCDIC equivalent for what is in this file, and put it in the #if
> > clause...
>
> You'll note a similar check in libiberty/hex.c, although that table
> could be initialized at runtime (hex_init) in a coding-independent way
> (i.e. _hex['A'] = 10;). Patches for libiberty go to
> gcc-patches@gcc.gnu.org once you figure out what the table should be.
Ok all -
I've made the patch to safe-ctype.c as suggested (see below), and libiberty
builds just fine, but continuing on os/390, I get the following:
creating cache ./config.cache
checking for Cygwin environment... no
checking for mingw32 environment... no
checking host system type... i370-ibm-openedition
checking target system type... i370-ibm-openedition
checking build system type... i370-ibm-openedition
checking for gcc... no
checking for cc... cc
checking whether the C compiler (cc ) works... yes
checking whether the C compiler (cc ) is a cross-compiler... no
checking whether we are using GNU C... no
checking whether cc accepts -g... yes
checking for POSIXized ISC... no
checking for a BSD compatible install... ./../install-sh -c
checking whether build environment is sane... yes
checking whether make sets ${MAKE}... yes
checking for working aclocal... found
checking for working autoconf... found
checking for working automake... found
checking for working autoheader... found
checking for working makeinfo... found
checking for non-GNU ld... no
configure: error: no acceptable ld found in $PATH
that's just.... silly. You need ld to make ld? What if your linker is bundled
with the *compiler* just in non-ld form - as so happens - os/390 open edition
does it. What the hell? How do you get around *this* one?
Anyways, here's the patch. If someone could commit it to the binutils branch
(or give me feedback on how to change it):
Ed
(
ps - whosoever designed ebcdic should be shot. what #%#@@ rationale could
anyone possibly have for splitting control characters,upper and lower case
numbers into small groups and sprinkling them all across the 0-255 range?
)
*** binutils-2.11.2/libiberty/safe-ctype.c Mon Dec 10 17:43:36 2001
--- binutils-2.11.2.new/libiberty/safe-ctype.c Mon Dec 10 17:43:02 2001
***************
*** 158,163 ****
240,241,242,243, 244,245,246,247, 248,249,250,251, 252,253,254,255,
};
#else
#error "Unsupported host character set"
! #endif /* not ASCII */
--- 158,282 ----
240,241,242,243, 244,245,246,247, 248,249,250,251, 252,253,254,255,
};
+ /* EBCDIC */
+
+ #elif '\n' == 0x15 && ' ' == 0x40 && '0' == 0xF0 \
+ && 'A' == 0xC1 && 'a' == 0x81 && '!' == 0x5A \
+ && EOF == -1
+
+ const unsigned short _sch_istable[256] =
+ {
+ Z, C, C, C, 0, T, 0, 0, /* NUL SOH STX ETX SEL HT RNL DEL */
+ 0, 0, 0, C, C, V, C, C, /* GE SPS RPT VT FF CR SO SI */
+ C, C, C, C, 0, V, C, 0, /* DLE DC1 DC2 DC3 RES LF BS POC */
+ C, C, 0, 0, 0, 0, C, C, /* CAN EM UBS CU1 FS GS RS US */
+ 0, 0, 0, 0, 0, 0, C, C, /* DS SOS fs WUS BYP LF ETB ESC */
+ 0, 0, 0, 0, 0, C, C, C, /* SA SFE SM CSP MFA ENQ ACK BEL */
+ 0, 0, C, 0, 0, 0, 0, C, /* UND UND SYN IR PP TRN NBS EOT */
+ 0, 0, 0, 0, C, C, 0, C, /* SBS IT RFF CU3 DC4 NAK UND SUB */
+ S, 0, 0, 0, 0, 0, 0, 0, /* SP01 SP30 LA15 LA17 LA13 LA11 LA19 LA27 */
+ 0, 0, 0, P, P, P, P, P, /* LC41 LN19 SC04 SP11 < ( + | */
+ P, 0, 0, 0, 0, 0, 0, 0, /* & LE11 LE15 LE17 LE13 LI11 LI15 LI17 */
+ 0, 0, P, P, P, P, P, P, /* LI13 LS61 ! $ * ) ; ^ */
+ P, P, 0, 0, 0, 0, 0, 0, /* - / LA16 LA18 LA14 LA12 LA20 LA28 */
+ 0, 0, 0, P, P, _, P, P, /* LC42 LN20 SM65 , % _ > ? */
+ 0, 0, 0, 0, 0, 0, 0, 0, /* LO61 LE12 LE16 LE18 LE14 LI12 LI16 LI18 */
+ 0, P, P, P, P, P, P, P, /* LI14 SD13 : # @ ' = " */
+ 0,XL,XL,XL,XL,XL,XL, L, /* LO62 a b c d e f g */
+ L, L, 0, 0, 0, 0, 0, 0, /* h i SP17 SP18 LD63 LY11 LT63 SA02 */
+ 0, L, L, L, L, L, L, L, /* SM19 j k l m n o p */
+ L, L, 0, 0, 0, 0, 0, 0, /* q r SM21 SM20 LA51 SD41 LA52 SC01 */
+ 0, 0, L, L, L, L, L, L, /* SM17 SD19 s t u v w x */
+ L, L, 0, 0, 0, 0, 0, 0, /* y z SP03 SP16 LD62 [ LT64 SM53 */
+ 0, 0, 0, 0, 0, 0, 0, 0, /* SM66 SC02 SC05 SD63 SM52 SM24 SM25 NF04 */
+ 0, 0, 0, 0, 0, P, 0, 0, /* NF01 NF05 LY12 SD17 SM15 ] SD11 SA07 */
+ P,XU,XU,XU,XU,XU,XU, U, /* { A B C D E F G */
+ U, U, 0, 0, 0, 0, 0, 0, /* H I SP32 LO15 LO17 LO13 LO11 LO19 */
+ P, U, U, U, U, U, U, U, /* } J K L M N O P */
+ U, U, 0, 0, 0, 0, 0, 0, /* Q R ND011 LU15 LU17 LU13 LU11 LY17 */
+ P, 0, U, U, U, U, U, U, /* \ SA06 S T U V W X */
+ U, U, 0, 0, 0, 0, 0, 0, /* Y Z ND021 LO16 LO18 LO14 LO12 LO20 */
+ D, D, D, D, D, D, D, D, /* 0 1 2 3 4 5 6 7 */
+ D, D, 0, 0, 0, 0, 0, 0 /* 8 9 ND031 LU16 LU18 LU14 LU12 EOF */
+ };
+
+ const unsigned char _sch_tolower [256] =
+ {
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
+ 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
+ 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
+ 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
+ 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
+ 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
+ 96, 97, 98, 99, 100,101,102,103, 104,105,106,107, 108,109,110,111,
+ 112,113,114,115, 116,117,118,119, 120,121,122,123, 124,125,126,127,
+ 128,
+
+ 'a','b','c','d', 'e','f','g','h', 'i',
+
+ 138,139,140,141, 142,143,144,
+
+ 'j','k','l','m', 'n','o','p','q', 'r',
+
+ 154,155,156,157, 158,159,160,161,
+
+ 's','t','u','v', 'w','x','y','z',
+
+ 170,171,172,173, 174,175,176,177, 178,179,180,181, 182,183,184,185,
+ 186,187,188,189, 190,191,192,
+
+ 'a','b','c','d', 'e','f','g','h', 'i',
+
+ 202,203,204,205, 206,207,208,
+
+ 'j','k','l','m', 'n','o','p','q', 'r',
+
+ 218,219, 220,221,222,223,224,225,
+
+ 's','t','u','v', 'w','x','y','z',
+
+ 234,235,236,237, 238,239,240,241, 242,243,244,245, 246,247,248,249,
+ 250,251,252,253, 254,255,
+ };
+
+ const unsigned char _sch_toupper[256] =
+ {
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
+ 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
+ 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
+ 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
+ 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
+ 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
+ 96, 97, 98, 99, 100,101,102,103, 104,105,106,107, 108,109,110,111,
+ 112,113,114,115, 116,117,118,119, 120,121,122,123, 124,125,126,127,
+ 128,
+
+ 'A','B','C','D', 'E','F','G','H', 'I',
+
+ 138,139,140,141, 142,143,144,
+
+ 'J','K','L','M', 'N','O','P','Q', 'R',
+
+ 154,155,156,157, 158,159,160,161,
+
+ 'S','T','U','V', 'W','X','Y','Z',
+
+ 170,171,172,173, 174,175,176,177, 178,179,180,181, 182,183,184,185,
+ 186,187,188,189, 190,191,192,
+
+ 'A','B','C','D', 'E','F','G','H', 'I',
+
+ 202,203,204,205, 206,207,208,
+
+ 'J','K','L','M', 'N','O','P','Q', 'R',
+
+ 218,219, 220,221,222,223,224,225,
+
+ 'S','T','U','V', 'W','X','Y','Z',
+
+ 234,235,236,237, 238,239,240,241, 242,243,244,245, 246,247,248,249,
+ 250,251,252,253, 254,255,
+ };
#else
#error "Unsupported host character set"
! #endif /* not ASCII or EBCDIC */