⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 readme-vms

📁 这是完整的gcc源代码
💻
字号:
Return-Path: <info-gcc-request@prep.ai.mit.edu>Date: 11 Sep 90 14:07:21 GMTFrom: news@operations.dccs.upenn.edu  (USENET News System)Organization: University of PennsylvaniaSubject: Building gcc 1.37.1 with Vax CReferences: <9009102236.AA15872@wubios.wustl.edu>Sender: info-gcc-request@prep.ai.mit.eduTo: info-gcc@prep.ai.mit.eduduring it; hopefully they'll come in handy.  To build the new gcc-cpp and gcc-cc1 that come with Gnu Cversion 1.37.1 with Vax C and NOT a previous version of gcc,do the following: I - Building gcc-cpp    A - Modify cccp.c      1 - Replace 	#include <sys/types.h>	#include <sys/stat.h>        with 	#ifndef VMS	#include <sys/types.h>	#include <sys/stat.h>	#else	#include <types.h>	#include <stat.h>	#endif[It is claimed that    $ define sys sys$library will solve the same problem without source changes.]      2 - In the VMS-specific section (has perror.h etc in it),add the following: 	#include <descrip.h>	/* for dsc$descriptor_s */	#include <string.h>	/* for strchr & strrchr */	#define index	strchr	#define rindex	strrchr      3 - You have to replace all occurences of: 	extern char *index(), *rindex();  as well as any where they're separated (e.g. extern char *index() by itself or extern char *rindex() by itself), with the following: 	#ifndef VMS	extern char *index();	/* or whatever was here */	#endif  There's a total of three: one in main(), one in do_include(), and one in hack_vms_include_specification().    B - You have to have alloca.mar for cccp.c; it was distributed with vmsgcc1.34; it's also in the bison distribution. (both 1.03 and 1.06)    C - After you've compiled alloca.mar (MACRO ALLOCA.MAR), follow the instructions at the top of MAKE-CC1.COM (namely, change the CC := line to say cc/noopt instead of gcc, take the cc1_options="-mpcc-alignment" part out of the CFLAGS line, and change the LIBS line to say: 	$ LIBS :=       alloca,sys$share:vaxcrtl/libr    D - Since it doesn't come with the distribution, you have to generate cexp_tab.c yourself, either with bison on either a Vax or a Unix box, or yacc in Unix. (@make below will die if you don't have bison on your Vax or don't have this file)    E - Type: 	@make  and watch it hum. It should go through okay; it'll die on the LINKline, but don't worry about it.    F - Now link the whole thing with: 	link /nomap/exe=gcc-cpp cccp,cexp,version,alloca,-	 sys$share:vaxcrtl/libr    G - You should be screaming for joy right now; if you're not, thengive up on life. <snicker>  II - Building gcc-cc1    A - Change MAKE-CC1.COM to contain the line: 	$ libs :== sys$share:vaxcrtl/libr,alloca Yep, you have to have alloca.obj here too.    B - Modify toplev.c:      1 - Replace 	#include <sys/types.h>	#include <sys/stat.h> 	with 	#ifndef VMS	#include <sys/types.h>	#include <sys/stat.h>	#else	#include <types.h>	#include <stat.h>	#endif (You'll see this again.)      2 - Do: Repl:	rtx_equal_function_value_mattersWith:	rtx_equ_func_value_mattersNum:	once  This is cuz you can't have a name over 31 chars with theVax C compiler; and yep you guessed it this is over thatlimit. You're gonna be doing this a few more times.    C - Modify gcc.c:      1 - This is optional, since you never compile it (I'mworking on that): 	Replace 	#include <stdio.h>	#include <sys/types.h>	#include <signal.h>	#include <sys/file.h> 	with 	#include <stdio.h>	#include <signal.h>	#ifdef VMS	#include <types.h>	#include <file.h>	#else	#include <sys/types.h>	#include <sys/file.h>	#endif    D - Modify c-parse_tab.c (if this isn't there, you'll haveto create it with bison or yacc): Repl:	expand_start_loop_continue_elsewhereWith:	expand_startloop_cont_elsewhereNum:	twice    E - Modify tree.h: Repl:	expand_start_loop_continue_elsewhereWith:	expand_startloop_cont_elsewhereNum:	once    F - Modify stmt.c: Repl:	expand_start_loop_continue_elsewhereWith:	expand_startloop_cont_elsewhereNum:	twice Repl:	current_function_returns_pcc_structWith:	cur_func_ret_pcc_structNum:	nine Repl:	current_function_returns_pointerWith:	cur_func_ret_ptrNum:	2 Repl:	current_function_pretend_args_sizeWith:	cur_func_pretend_args_sizeNum:	3    G - Modify rtanal.c: Repl:	rtx_equal_function_value_mattersWith:	rtx_equ_func_values_mattersNum:	twice    H - Modify output.h: Repl:	current_function_returns_pcc_structWith:	cur_func_ret_pcc_structNum:	once Repl: 	current_function_returns_pointerWith:	cur_func_ret_ptrNum:	once Repl:	current_function_pretend_args_sizeWith:	cur_func_pretend_args_sizeNum:	once    I - Modify tree.def:  Change the line that reads: 	DEFTREECODE (FILE_TYPE, "file_type", "t", 0)  to: 	#ifdef VMS	DEFTREECODE (FILE_TYPE_GNU, "file_type", "t", 0)	#else	DEFTREECODE (FILE_TYPE, "file_type", "t", 0)	#endif  This is cuz FILE_TYPE is defined in stdio.h as beingstruct _iobuf *, which totally screws everything up.    J - Modify expr.c:  Change the line that reads: 	if (code == FILE_TYPE)  to: 	#ifdef VMS	if (code == FILE_TYPE_GNU)	#else	if (code == FILE_TYPE)	#endif    K - Modify expmed.c:  Change the line that reads:  trymode && GET_MODE_SIZE (trymode) <= maxsize;  to:  (trymode != 0) && (GET_MODE_SIZE (trymode) <= maxsize);  Enclosing the second half of the and in parenthesis may beoverkill. By the time I thought of it it was too late tochange it (read: I didn't feel like going back), but youmay want to give it a try.    L - Modify symout.c:  Change the line that has #include <stddef.h> on it to: 	#ifndef VMS	#include <stddef.h>	#else	#define NULL	(void *) 0	#endif    M - Modify insn-emit.c:  Line #1011 (in mine) is a 376-character long line that'sone HUGE return (it calls a function a few zillion timesembedded upon each other). This is a tad too big for Vax Cto chew; try cutting it down to a few lines. I made it looklike this: rtxgen_casesi (operand0, operand1, operand2, operand3)     rtx operand0;     rtx operand1;     rtx operand2;     rtx operand3;{  return gen_rtx (SET, VOIDmode, pc_rtx,   gen_rtx (IF_THEN_ELSE, VOIDmode,    gen_rtx (LE, VOIDmode,     gen_rtx (MINUS, SImode, operand0, operand1),    operand2),    gen_rtx (PLUS, SImode,     gen_rtx (SIGN_EXTEND, SImode,      gen_rtx (MEM, HImode,       gen_rtx (PLUS, SImode, pc_rtx,        gen_rtx (MINUS, SImode, operand0, operand1)))),     gen_rtx (LABEL_REF, SImode, operand3)),   pc_rtx));}  Kinda smacks of lisp, no?    N - Modify final.c:  Change the line that reads: 	rtx final_sequence;  to: 	#ifndef VMS	rtx final_sequence;	#endif  This is cuz rtx final_sequence already appears inoutput.h, and Vax C screams when it sees this.    O - You have to have alloca(), bcopy(), bcmp(), andbzero(); all are in the VMS Gcc 1.34 distribution; onlybcopy() is in the bison distribution. Since they're prettyshort, I'm gonna include 'em here. These were sent under theGnu public license.  alloca.mar:         .PSECT  $CODE,LONG,PIC,REL,SHR,EXE,RD,NOWRT        .ENTRY  ALLOCA,^M<>        SUBL2   4(AP),SP        MOVL    16(FP),R1        MOVQ    8(FP),AP        BICL2   #3,SP        ADDL2   #28,SP        MOVL    SP,R0        JMP     (R1)         .END  bcopy.mar:         .PSECT  $CODE,LONG,PIC,REL,SHR,EXE,RD,NOWRT	; bcopy(from, to, size)        .ENTRY  BCOPY,^M<R2,R3,R4,R5,R6>        MOVL    4(AP),R1        MOVL    8(AP),R3        MOVL    12(AP),R6        CMPL    R1,R3        BGTR    2$              ; NORMAL FORWARD CASE        BLSS    3$              ; OVERLAPPING, MUST DO BACKWARDS        RET                     ; EQUAL, NOTHING TO DO1$:	SUBL2   R0,R6        MOVC3   R0,(R1),(R3)2$:	MOVZWL  #65535,R0        CMPL    R6,R0        BGTR    1$        MOVC3   R6,(R1),(R3)        RET3$:	ADDL2   R6,R1        ADDL2   R6,R3        MOVZWL  #65535,R0        BRW     5$4$:	SUBL2   R0,R6        SUBL2   R0,R1        SUBL2   R0,R3        MOVC3   R0,(R1),(R3)        MOVZWL  #65535,R0        SUBL2   R0,R1        SUBL2   R0,R35$:	CMPL    R6,R0        BGTR    4$        SUBL2   R6,R1        SUBL2   R6,R3        MOVC3   R6,(R1),(R3)        RET         .END  bcmp.mar:         .PSECT  $CODE,LONG,PIC,REL,SHR,EXE,RD,NOWRT	; bcmp(s1, s2, n)        .ENTRY  BCMP,^M<R2,R3,R4,R5>        MOVL    4(AP),R1        MOVL    8(AP),R3        MOVL    12(AP),R41$:	MOVZWL  #65535,R0        CMPL    R4,R0        BLEQ    2$        SUBL2   R0,R4        CMPC3   R0,(R1),(R3)        BEQL    1$        ADDL2   R4,R0        RET2$:	CMPC3   R4,(R1),(R3)        RET         .END   bzero.mar:         .PSECT  $CODE,LONG,PIC,REL,SHR,EXE,RD,NOWRT	; bzero(ptr, size)        .ENTRY  BZERO,^M<R2,R3,R4,R5>        MOVL    4(AP),R3        BRB     2$1$:	SUBL2   R0,8(AP)        MOVC5   #0,(R3),#0,R0,(R3)2$:	MOVZWL  #65535,R0        CMPL    8(AP),R0        BGTR    1$        MOVC5   #0,(R3),#0,8(AP),(R3)        RET         .END    P - On the last lines (where it's got all of the link shit),change it so it reads: 	...blahblahblah...	...blahblah,insn-extract,insn-output,obstack,-	integrate,caller-save,-	bcopy,bcmp,bzero	$!  So now it'll link the bcopy, bcmp, and bzero routines in.    Q - You should be screaming for joy right now; if you'renot, then give up on life again. Hey, I don't get paid for my humor.    R - Finally, you have to use old versions of: 		GCC.EXE		GCC-AS.EXE		GCC.COM		GCC.CLD		GCCLIB.OLB  to make the package work properly. I've only been able to make the new preprocessors make properly; since it wasn't even in the make files that came with it, I don't think gcc.exe 1.37.1 was intended to be built for the Vax .. we'll see.  In case you're wondering, I could never get vmsgcc134 to work properly;that's why I did this with Vax C.  Good luck! This only worked under 5.3-1 (and the latest version ofVax C...3.0? 3.1?), and isn't guaranteed in any way shape or form. Ifyou have stumbling blocks and think I may have come upon it during allof this, feel free to mail me at kehoe@scotty.dccs.upenn.edu. --Brendan Kehoe | Soon: brendan@cs.widener.eduFor now: kehoe@scotty.dccs.upenn.edu | Or: bkehoe@widener.bitnet     Last resort: brendan.kehoe@cyber.widener.eduBrendan Kehoe | Soon: brendan@cs.widener.eduFor now: kehoe@scotty.dccs.upenn.edu | Or: bkehoe@widener.bitnetLast resort: brendan.kehoe@cyber.widener.edu

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -