tower@AI.MIT.EDU (Leonard H. Tower Jr.) (05/19/89)
Return-Path: <aucis!cis010!bidwell@ndcheg.cheg.nd.edu.cheg.nd.edu> Subject: updates to gcc to allow making it on 3b1 with std C To: aucis!ndcheg!prep.ai.mit.edu!gnu@ndcheg.cheg.nd.edu.cheg.nd.edu Date: Wed, 17 May 89 9:37:54 EDT From: Daniel R. Bidwell <bidwell@cis010.ai.mit.edu> X-Mailer: Elm [version 1.7 beta] GCC on the 3B1 The documentation says that gcc can not be compiled on the 3b1 using the standard C compiler for the 3b1. The following is a list of steps that I have taken to compile gcc on the 3b1 using the standard C compiler for the 3b1. STEP 1 Comment out the '#include "config.h"' line on line 37 of cccp.c and "make cpp". Save the old /lib/cpp and make the GNU version of cpp to be the system "cpp" while making gcc. Restore the '#include "config.h"' and "make cpp" again putting this version of cpp into /lib/cpp as the production version of cpp. STEP 2 There is a complex if statement in expr.c at line 3756 and in stmt.c at line 4343. Both of these statements need to be broken down to simpler statements as follows: Original: if (TYPE_MODE (TREE_TYPE (exp)) == BLKmode || RETURN_IN_MEMORY (TREE_TYPE (exp)) || (flag_pcc_struct_return && (TREE_CODE (TREE_TYPE (exp)) == RECORD_TYPE || TREE_CODE (TREE_TYPE (exp)) == UNION_TYPE))) Replacement: i=0; if (TYPE_MODE (TREE_TYPE (exp)) ==BLKmode)i=1; if (RETURN_IN_MEMORY (TREE_MODE (exp)))i=1; if (flag_pcc_struct_return && (TREE_CODE (TREE_TYPE (exp)) == RECORD_TYPE || TREE_CODE (TREE_TYPE (exp)) == UNION_TYPE))i=1; if(i==1) STEP 3 There is a complex expression which does not compile correctly in tree.c which is defined in obstack.h. The body of the macro obstack_free was copied into a separate file as a function as follows: #include "obstack.h" #undef obstack_free ob_free(h,obj)struct obstack *h; char *obj;{ struct obstack *__o; char *__obj; __o = h; __obj = obj; if ( (__obj >= (char *)__o->chunk) && (__obj < (char *)__o->chunk_limit)) __o->next_free = __o->object_base = __obj; else _obstack_free(__o,__obj); } Then replace every occurance of obstack_free in tree.c with ob_free. STEP 4 Continue with the make process as before. If there are any comments or questions about this procedure contact me at the following email address. -- Daniel R. Bidwell | sharkey!aucis!bidwell Andrews University | uunet!zds-ux!aucis!bidwell Computer Information | bidwell%aucis.uucp@mailgw.cc.umich.edu Science Department | bidwell%aucis.uucp@ndcheg.cheg.nd.edu