Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!lll-winken!uunet!fed!arccs1!m1rcd00 From: m1rcd00@arccs1.FRB.GOV (Bob Drzyzgula) Newsgroups: comp.lang.lisp Subject: Re: Trouble Compiling KCL on Sun3/SunOS4 Summary: Making Progress... Keywords: KCL, Sun, SunOS4.0 Message-ID: <478@arcfs1.fed.FRB.GOV> Date: 4 Apr 89 19:40:35 GMT References: <476@arcfs1.fed.FRB.GOV> Sender: news@fed.FRB.GOV Reply-To: rcd@fed.frb.gov (Bob Drzyzgula) Organization: Federal Reserve Board, Washington, DC Lines: 117 Thank you all very much for your responses. There were four basic suggestions: 1. Use the gcc compiler. (Moises Lejter) 2. Use -Bstatic on the Sun C compiler. (Mark Lerner) (to Mark: You suggest that there is a step in the beginning where the makefiles get rewritten. I have looked again through all of the distribution, and I cannot find any such configuration process. I got my copy from uunet. Am I missing something?) 3. Patch the source (Taizo Kojima's patches are included here). 4. Buy IBCL. (a solicitation from the purveyor) So, I first tried using the gcc comiler. To do this, I wound up having to make two changes: I put -w in the gcc commands, since it got *real* upset about one of the header files (external.h) not meeting gnu's specs. I also had to patch the dpp preprocessor to make it generate gnu-standard #line directives. (gnu uses # linenum filename, and the filename has to be in double quotes in the general case. Sun's cc uses #line linenum filename, and doesn't need the quotes. This is real easy to find... search for #line in dpp.c). This got past loading cmpmain.lsp, but choked on another memory error soon after loading setdoc.lsp (transcript later). Second, I tried putting -Bstatic on Sun's cc (yes, including the one at the bottom of unixport/makefile that doesn't use CFLAGS). This made no discernable difference in the outcome. This was when Taizo Kojima's mail came in. I applied that patch, and the Sun cc version ran through the cmpmain.lsp, but *failed in exactly the same place as gcc*. So although I have achieved syncronization between the two compilers, I have not gotten a running kcl. You've done great so far, any more ideas? (Yes, I have run memory diagnostics on my Sun and even tried a seperate compile on a different machine [a 3/180]) Again, thanks. Transcript of failure follows, followed by Taizo Kojima's patches: Initializing cmpvar... Initializing cmpvs... Initializing cmpwt... Loading ../cmpnew/cmpmain.lsp Finished loading ../cmpnew/cmpmain.lsp Loading ../cmpnew/lfun_list.lsp Finished loading ../cmpnew/lfun_list.lsp Loading ../cmpnew/cmpopt.lsp Finished loading ../cmpnew/cmpopt.lsp Warning: COMPILE-FILE is being redefined. Warning: COMPILE is being redefined. Warning: DISASSEMBLE is being redefined. Loading ../lsp/setdoc.lsp Finished loading ../lsp/setdoc.lsp Warning: LISP-IMPLEMENTATION-VERSION is being redefined.sh: 954 Memory fault - core dumped *** Error code 139 make: Fatal error: Command failed for target `saved_kcl' Current working directory /src/kcl/unixport *** Error code 1 make: Fatal error: Command failed for target `all' >Hello Mr.Drzyzgula > > The reason of a memory fault is the implicit return value of >new Sun C compiler. > To avoid this, you must add 2 lines at bottom of the functions >using asm() statement, get_mark_bit() and get_set_mark_bit() in >c/bitop.c: > >======= in bitop.c >get_mark_bit(x) >int *x; >{ > asm(" movl a6@(8),d0"); > asm(" lsrl #2,d0"); > asm(" movl d0,d1"); > asm(" lsrl #3,d1"); > asm(" movl _mark_table,a0"); > asm(" btst d0,a0@(0,d1:L)"); > asm(" sne d0"); > asm(" andl #1,d0"); > > asm(" unlk a6"); /* for SunOS4.0 */ > asm(" rts"); /* for SunOS4.0 */ > >} > >get_set_mark_bit(x) >int *x; >{ > asm(" movl a6@(8),d0"); > asm(" lsrl #2,d0"); > asm(" movl d0,d1"); > asm(" lsrl #3,d1"); > asm(" movl _mark_table,a0"); > asm(" bset d0,a0@(0,d1:L)"); > asm(" sne d0"); > asm(" andl #1,d0"); > > asm(" unlk a6"); /* for SunOS4.0 */ > asm(" rts"); /* for SunOS4.0 */ >} > > >Next, CFLAGS in unixport/makefile, add '-Bstatic' option for static binding, >and add '-Bstatic' option where '/bin/ld' is called in file c/unixfasl.c > >- - Bye. >PS: > Sorry of my poor English X-<. > Mitsubishi Electric, Amagasaki, Japan > Taizo Kojima Bob Drzyzgula rcd@fed.frb.gov, uunet!fed!rcd Federal Reserve Board, Washington, DC 20551