[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

report on the south Palo Alto Sun OS 4.1 KCL problem

0. DISCLAIMER: i feel a little strange that no one else is having these
problems -- either things are locally wierd at my place (well, yeah, so?)
or none of the rest of you are running 4.1 yet. Also, i had some help with
this, but the help wishes to remain anonymous until votes are in.

1. SYMPTOMS: "bad secondary magic number" error when try to
load or build CLX, or build KCL. 

  when do make -f Smakefile, gets to
    cc -DVOL=  -I/usr1/local/akcl-1-470/o -Bstatic -temp=.  -o raw_kcl
  then prints out a lot of  " ../o/main.o ../o/alloc.o " stuff and then
    ld: ../lsp/defmacro.o: bad secondary magic number
    *** Error code 4

  ;;; Default paths: #"" #""
  ;;; cc -c socket.c -o socket.o -DUNIXCONN
  Compiling sockcl.lsp.
  End of Pass 1.
  End of Pass 2.
  OPTIMIZE levels: Safety=0 (No runtime error checking), Space=0, Speed=3
  Finished compiling sockcl.o.ld: sockcl.o: bad secondary magic number
  Error: The linkage editor failed.
  Error signalled by SYSTEM:FASLINK.

However, kcl 4.0.3 binaries seem to work (modulo section 6 below) for
compiling and loading regular files.

2. THEORY: Under 4.1 SUN changed .o format, so now the OS and KCL collide
since both caching stuff in the same place (at the end of .o files).  Page
25 4.1 Release Notes: programs may not work if they "... depend upon the
ojbect file format in a way that can be confused by extra infromation now
appearing at the end of some object files in support of #ident directives
in C source programs". We conjecture the opposite may be the case, where
SUN OS is confused by the stuff KCL is putting there; depends on who put
what where last, and who looks for it next.

3. GROSS FIX: Determine new .o format, hint in /usr/include/machine/a.out.h :

 #define EXTRA_MAGIC     1040            /* taxing concept  */
 #define EXTRA_IDENT     0               /* ident's in 0th extra section */

We think secondary = extra, and looks like may need extra_ident too ..
Figured ^@^@^D^P was the 1040 it wanted; and ^@^@^@^@ = 0 for the ident number.

So i just edited sockcl.o with emacs and inserted the 8 bytes, putting
^@^@^D^P^@^@^@^@ after the string table in sockcl.o (represented here by
16 chars for emailing).  Actually it was after the \243\243\243 after the
string table and before the ^\ before the stuff kcl stuck in there ...

I can now load and run CLX.

4. PLEA: since the above sorta works, altho gross, perhaps it will
be enough of a hint for real hackers to engineer a more graceful fix.

5. RANDOM THOT: if NULLFILE is defined, and then the file pted to has the
extra bytes in it, (as in ../h.sgi.defs and twelve_null), will the
necessary info be concatenated magically into the right place?

6. BONUS PROBLEM: requests.lsp in CLX never finishes compiling (well, after
an hour i stopped it, all of CLX will build in an hour under 4.0.3). Also
one of my files unchanged since compiling sucessfuly under 4.0.3 .  this
may or may not be related to the magic problem.

cheers, f