Annotation of gcc/README-VMS, revision 1.1.1.1

1.1       root        1: Return-Path: <[email protected]>
                      2: Date: 11 Sep 90 14:07:21 GMT
                      3: From: [email protected]  (USENET News System)
                      4: Organization: University of Pennsylvania
                      5: Subject: Building gcc 1.37.1 with Vax C
                      6: References: <[email protected]>
                      7: Sender: [email protected]
                      8: To: [email protected]
                      9: 
                     10: during it; hopefully they'll come in handy.
                     11:  
                     12:  To build the new gcc-cpp and gcc-cc1 that come with Gnu C
                     13: version 1.37.1 with Vax C and NOT a previous version of gcc,
                     14: do the following:
                     15:  
                     16: I - Building gcc-cpp
                     17:  
                     18:    A - Modify cccp.c
                     19:  
                     20:      1 - Replace
                     21:  
                     22:        #include <sys/types.h>
                     23:        #include <sys/stat.h>
                     24:  
                     25:        with
                     26:  
                     27:        #ifndef VMS
                     28:        #include <sys/types.h>
                     29:        #include <sys/stat.h>
                     30:        #else
                     31:        #include <types.h>
                     32:        #include <stat.h>
                     33:        #endif
                     34: 
                     35: [It is claimed that
                     36:     $ define sys sys$library
                     37:  will solve the same problem without source changes.]
                     38:  
                     39:      2 - In the VMS-specific section (has perror.h etc in it),
                     40: add the following:
                     41:  
                     42:        #include <descrip.h>    /* for dsc$descriptor_s */
                     43:        #include <string.h>     /* for strchr & strrchr */
                     44:        #define index   strchr
                     45:        #define rindex  strrchr
                     46:  
                     47:      3 - You have to replace all occurences of:
                     48:  
                     49:        extern char *index(), *rindex();
                     50:  
                     51:  as well as any where they're separated (e.g. extern char *index()
                     52:  by itself or extern char *rindex() by itself), with the following:
                     53:  
                     54:        #ifndef VMS
                     55:        extern char *index();   /* or whatever was here */
                     56:        #endif
                     57:  
                     58:  There's a total of three: one in main(), one in do_include(), and
                     59:  one in hack_vms_include_specification().
                     60:  
                     61:    B - You have to have alloca.mar for cccp.c; it was distributed
                     62:  with vmsgcc1.34; it's also in the bison distribution. (both 1.03
                     63:  and 1.06)
                     64:  
                     65:    C - After you've compiled alloca.mar (MACRO ALLOCA.MAR), follow
                     66:  the instructions at the top of MAKE-CC1.COM (namely, change the
                     67:  CC := line to say cc/noopt instead of gcc, take the
                     68:  cc1_options="-mpcc-alignment" part out of the CFLAGS line, and change
                     69:  the LIBS line to say:
                     70:  
                     71:        $ LIBS :=       alloca,sys$share:vaxcrtl/libr
                     72:  
                     73:    D - Since it doesn't come with the distribution, you have
                     74:  to generate cexp_tab.c yourself, either with bison on either
                     75:  a Vax or a Unix box, or yacc in Unix. (@make below will die if you
                     76:  don't have bison on your Vax or don't have this file)
                     77:  
                     78:    E - Type:
                     79:  
                     80:        @make
                     81:  
                     82:  and watch it hum. It should go through okay; it'll die on the LINK
                     83: line, but don't worry about it.
                     84:  
                     85:    F - Now link the whole thing with:
                     86:  
                     87:        link /nomap/exe=gcc-cpp cccp,cexp,version,alloca,-
                     88:         sys$share:vaxcrtl/libr
                     89:  
                     90:    G - You should be screaming for joy right now; if you're not, then
                     91: give up on life. <snicker>
                     92:  
                     93:  
                     94: II - Building gcc-cc1
                     95:  
                     96:    A - Change MAKE-CC1.COM to contain the line:
                     97:  
                     98:        $ libs :== sys$share:vaxcrtl/libr,alloca
                     99:  
                    100: Yep, you have to have alloca.obj here too.
                    101:  
                    102:    B - Modify toplev.c:
                    103:  
                    104:      1 - Replace
                    105:  
                    106:        #include <sys/types.h>
                    107:        #include <sys/stat.h>
                    108:  
                    109:        with
                    110:  
                    111:        #ifndef VMS
                    112:        #include <sys/types.h>
                    113:        #include <sys/stat.h>
                    114:        #else
                    115:        #include <types.h>
                    116:        #include <stat.h>
                    117:        #endif
                    118:  
                    119: (You'll see this again.)
                    120:  
                    121:      2 - Do:
                    122:  
                    123: Repl:  rtx_equal_function_value_matters
                    124: With:  rtx_equ_func_value_matters
                    125: Num:   once
                    126:  
                    127:  This is cuz you can't have a name over 31 chars with the
                    128: Vax C compiler; and yep you guessed it this is over that
                    129: limit. You're gonna be doing this a few more times.
                    130:  
                    131:    C - Modify gcc.c:
                    132:  
                    133:      1 - This is optional, since you never compile it (I'm
                    134: working on that):
                    135:  
                    136:        Replace
                    137:  
                    138:        #include <stdio.h>
                    139:        #include <sys/types.h>
                    140:        #include <signal.h>
                    141:        #include <sys/file.h>
                    142:  
                    143:        with
                    144:  
                    145:        #include <stdio.h>
                    146:        #include <signal.h>
                    147:        #ifdef VMS
                    148:        #include <types.h>
                    149:        #include <file.h>
                    150:        #else
                    151:        #include <sys/types.h>
                    152:        #include <sys/file.h>
                    153:        #endif
                    154:  
                    155:    D - Modify c-parse_tab.c (if this isn't there, you'll have
                    156: to create it with bison or yacc):
                    157:  
                    158: Repl:  expand_start_loop_continue_elsewhere
                    159: With:  expand_startloop_cont_elsewhere
                    160: Num:   twice
                    161:  
                    162:    E - Modify tree.h:
                    163:  
                    164: Repl:  expand_start_loop_continue_elsewhere
                    165: With:  expand_startloop_cont_elsewhere
                    166: Num:   once
                    167:  
                    168:    F - Modify stmt.c:
                    169:  
                    170: Repl:  expand_start_loop_continue_elsewhere
                    171: With:  expand_startloop_cont_elsewhere
                    172: Num:   twice
                    173:  
                    174: Repl:  current_function_returns_pcc_struct
                    175: With:  cur_func_ret_pcc_struct
                    176: Num:   nine
                    177:  
                    178: Repl:  current_function_returns_pointer
                    179: With:  cur_func_ret_ptr
                    180: Num:   2
                    181:  
                    182: Repl:  current_function_pretend_args_size
                    183: With:  cur_func_pretend_args_size
                    184: Num:   3
                    185:  
                    186:    G - Modify rtanal.c:
                    187:  
                    188: Repl:  rtx_equal_function_value_matters
                    189: With:  rtx_equ_func_values_matters
                    190: Num:   twice
                    191:  
                    192:    H - Modify output.h:
                    193:  
                    194: Repl:  current_function_returns_pcc_struct
                    195: With:  cur_func_ret_pcc_struct
                    196: Num:   once
                    197:  
                    198: Repl:  current_function_returns_pointer
                    199: With:  cur_func_ret_ptr
                    200: Num:   once
                    201:  
                    202: Repl:  current_function_pretend_args_size
                    203: With:  cur_func_pretend_args_size
                    204: Num:   once
                    205:  
                    206:    I - Modify tree.def:
                    207:  
                    208:  Change the line that reads:
                    209:  
                    210:        DEFTREECODE (FILE_TYPE, "file_type", "t", 0)
                    211:  
                    212:  to:
                    213:  
                    214:        #ifdef VMS
                    215:        DEFTREECODE (FILE_TYPE_GNU, "file_type", "t", 0)
                    216:        #else
                    217:        DEFTREECODE (FILE_TYPE, "file_type", "t", 0)
                    218:        #endif
                    219:  
                    220:  This is cuz FILE_TYPE is defined in stdio.h as being
                    221: struct _iobuf *, which totally screws everything up.
                    222:  
                    223:    J - Modify expr.c:
                    224:  
                    225:  Change the line that reads:
                    226:  
                    227:        if (code == FILE_TYPE)
                    228:  
                    229:  to:
                    230:  
                    231:        #ifdef VMS
                    232:        if (code == FILE_TYPE_GNU)
                    233:        #else
                    234:        if (code == FILE_TYPE)
                    235:        #endif
                    236:  
                    237:    K - Modify expmed.c:
                    238:  
                    239:  Change the line that reads:
                    240:  
                    241:  trymode && GET_MODE_SIZE (trymode) <= maxsize;
                    242:  
                    243:  to:
                    244:  
                    245:  (trymode != 0) && (GET_MODE_SIZE (trymode) <= maxsize);
                    246:  
                    247:  Enclosing the second half of the and in parenthesis may be
                    248: overkill. By the time I thought of it it was too late to
                    249: change it (read: I didn't feel like going back), but you
                    250: may want to give it a try.
                    251:  
                    252:    L - Modify symout.c:
                    253:  
                    254:  Change the line that has #include <stddef.h> on it to:
                    255:  
                    256:        #ifndef VMS
                    257:        #include <stddef.h>
                    258:        #else
                    259:        #define NULL    (void *) 0
                    260:        #endif
                    261:  
                    262:    M - Modify insn-emit.c:
                    263:  
                    264:  Line #1011 (in mine) is a 376-character long line that's
                    265: one HUGE return (it calls a function a few zillion times
                    266: embedded upon each other). This is a tad too big for Vax C
                    267: to chew; try cutting it down to a few lines. I made it look
                    268: like this:
                    269:  
                    270: rtx
                    271: gen_casesi (operand0, operand1, operand2, operand3)
                    272:      rtx operand0;
                    273:      rtx operand1;
                    274:      rtx operand2;
                    275:      rtx operand3;
                    276: {
                    277:   return gen_rtx (SET, VOIDmode, pc_rtx,
                    278:    gen_rtx (IF_THEN_ELSE, VOIDmode,
                    279:     gen_rtx (LE, VOIDmode,
                    280:      gen_rtx (MINUS, SImode, operand0, operand1),
                    281:     operand2),
                    282:     gen_rtx (PLUS, SImode,
                    283:      gen_rtx (SIGN_EXTEND, SImode,
                    284:       gen_rtx (MEM, HImode,
                    285:        gen_rtx (PLUS, SImode, pc_rtx,
                    286:         gen_rtx (MINUS, SImode, operand0, operand1)))),
                    287:      gen_rtx (LABEL_REF, SImode, operand3)),
                    288:    pc_rtx));
                    289: }
                    290:  
                    291:  Kinda smacks of lisp, no?
                    292:  
                    293:    N - Modify final.c:
                    294:  
                    295:  Change the line that reads:
                    296:  
                    297:        rtx final_sequence;
                    298:  
                    299:  to:
                    300:  
                    301:        #ifndef VMS
                    302:        rtx final_sequence;
                    303:        #endif
                    304:  
                    305:  This is cuz rtx final_sequence already appears in
                    306: output.h, and Vax C screams when it sees this.
                    307:  
                    308:    O - You have to have alloca(), bcopy(), bcmp(), and
                    309: bzero(); all are in the VMS Gcc 1.34 distribution; only
                    310: bcopy() is in the bison distribution. Since they're pretty
                    311: short, I'm gonna include 'em here. These were sent under the
                    312: Gnu public license.
                    313:  
                    314:  alloca.mar:
                    315:  
                    316:         .PSECT  $CODE,LONG,PIC,REL,SHR,EXE,RD,NOWRT
                    317:         .ENTRY  ALLOCA,^M<>
                    318:         SUBL2   4(AP),SP
                    319:         MOVL    16(FP),R1
                    320:         MOVQ    8(FP),AP
                    321:         BICL2   #3,SP
                    322:         ADDL2   #28,SP
                    323:         MOVL    SP,R0
                    324:         JMP     (R1)
                    325:  
                    326:         .END
                    327:  
                    328:  bcopy.mar:
                    329:  
                    330:         .PSECT  $CODE,LONG,PIC,REL,SHR,EXE,RD,NOWRT
                    331:        ; bcopy(from, to, size)
                    332:         .ENTRY  BCOPY,^M<R2,R3,R4,R5,R6>
                    333:         MOVL    4(AP),R1
                    334:         MOVL    8(AP),R3
                    335:         MOVL    12(AP),R6
                    336:         CMPL    R1,R3
                    337:         BGTR    2$              ; NORMAL FORWARD CASE
                    338:         BLSS    3$              ; OVERLAPPING, MUST DO BACKWARDS
                    339:         RET                     ; EQUAL, NOTHING TO DO
                    340: 1$:    SUBL2   R0,R6
                    341:         MOVC3   R0,(R1),(R3)
                    342: 2$:    MOVZWL  #65535,R0
                    343:         CMPL    R6,R0
                    344:         BGTR    1$
                    345:         MOVC3   R6,(R1),(R3)
                    346:         RET
                    347: 3$:    ADDL2   R6,R1
                    348:         ADDL2   R6,R3
                    349:         MOVZWL  #65535,R0
                    350:         BRW     5$
                    351: 4$:    SUBL2   R0,R6
                    352:         SUBL2   R0,R1
                    353:         SUBL2   R0,R3
                    354:         MOVC3   R0,(R1),(R3)
                    355:         MOVZWL  #65535,R0
                    356:         SUBL2   R0,R1
                    357:         SUBL2   R0,R3
                    358: 5$:    CMPL    R6,R0
                    359:         BGTR    4$
                    360:         SUBL2   R6,R1
                    361:         SUBL2   R6,R3
                    362:         MOVC3   R6,(R1),(R3)
                    363:  
                    364:        RET
                    365:  
                    366:         .END
                    367:  
                    368:  bcmp.mar:
                    369:  
                    370:         .PSECT  $CODE,LONG,PIC,REL,SHR,EXE,RD,NOWRT
                    371:        ; bcmp(s1, s2, n)
                    372:         .ENTRY  BCMP,^M<R2,R3,R4,R5>
                    373:         MOVL    4(AP),R1
                    374:         MOVL    8(AP),R3
                    375:         MOVL    12(AP),R4
                    376: 1$:    MOVZWL  #65535,R0
                    377:         CMPL    R4,R0
                    378:         BLEQ    2$
                    379:         SUBL2   R0,R4
                    380:         CMPC3   R0,(R1),(R3)
                    381:         BEQL    1$
                    382:         ADDL2   R4,R0
                    383:         RET
                    384: 2$:    CMPC3   R4,(R1),(R3)
                    385:         RET
                    386:  
                    387:         .END
                    388:  
                    389:  
                    390:  bzero.mar:
                    391:  
                    392:         .PSECT  $CODE,LONG,PIC,REL,SHR,EXE,RD,NOWRT
                    393:        ; bzero(ptr, size)
                    394:         .ENTRY  BZERO,^M<R2,R3,R4,R5>
                    395:         MOVL    4(AP),R3
                    396:         BRB     2$
                    397: 1$:    SUBL2   R0,8(AP)
                    398:         MOVC5   #0,(R3),#0,R0,(R3)
                    399: 2$:    MOVZWL  #65535,R0
                    400:         CMPL    8(AP),R0
                    401:         BGTR    1$
                    402:         MOVC5   #0,(R3),#0,8(AP),(R3)
                    403:         RET
                    404:  
                    405:         .END
                    406:  
                    407:    P - On the last lines (where it's got all of the link shit),
                    408: change it so it reads:
                    409:  
                    410:        ...blahblahblah...
                    411:        ...blahblah,insn-extract,insn-output,obstack,-
                    412:        integrate,caller-save,-
                    413:        bcopy,bcmp,bzero
                    414:        $!
                    415:  
                    416:  So now it'll link the bcopy, bcmp, and bzero routines in.
                    417:  
                    418:    Q - You should be screaming for joy right now; if you're
                    419: not, then give up on life again. Hey, I don't get paid for my humor.
                    420:  
                    421:    R - Finally, you have to use old versions of:
                    422:  
                    423:                GCC.EXE         GCC-AS.EXE
                    424:                GCC.COM         GCC.CLD
                    425:                GCCLIB.OLB
                    426:  
                    427:  to make the package work properly. I've only been able to make the
                    428:  new preprocessors make properly; since it wasn't even in the make
                    429:  files that came with it, I don't think gcc.exe 1.37.1 was intended
                    430:  to be built for the Vax .. we'll see.
                    431:  
                    432:  In case you're wondering, I could never get vmsgcc134 to work properly;
                    433: that's why I did this with Vax C.
                    434:  
                    435:  Good luck! This only worked under 5.3-1 (and the latest version of
                    436: Vax C...3.0? 3.1?), and isn't guaranteed in any way shape or form. If
                    437: you have stumbling blocks and think I may have come upon it during all
                    438: of this, feel free to mail me at [email protected].
                    439:  
                    440: --
                    441: Brendan Kehoe | Soon: [email protected]
                    442: For now: [email protected] | Or: [email protected]
                    443:      Last resort: [email protected]
                    444: Brendan Kehoe | Soon: [email protected]
                    445: For now: [email protected] | Or: [email protected]
                    446: Last resort: [email protected]
                    447: 

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.