[comp.emacs] Elxsi/BSD 4.3 installation problem

jspear@afit-ab.arpa (Jon L. Spear) (10/29/88)

Fellow Emacsers,

Sorry to bother the list with this, but our local ELXSI/Unix wizards haven't
been able to help much (yet?). And we have no Emacs wizards, just users.

I'm trying to get GNU Emacs 18.52 running on our ELXSI which recently had
BSD 4.3 Unix installed. (GNU wasn't running previously on our ELXSI, but
I've installed 18.51 with few problems on SUN-3s and a VMS VAX 8650.)  I
edited config.h, paths.h, and the install-config file to use s-bsd4-3.h
and m-elxsi.h and appropriate pathnames. I looked over these files, INSTALL
instructions, and etc/MACHINES notes and didn't see anything else obvious
that needed to be changed. I ran install-config and kept my fingers
crossed.  All the .c files compiled without error, and all auxilliary
(ctags, etags, etc...)  programs linked OK and appeared to execute OK. 
	However, when it came time to link temacs, the linker (ld)
complains that "_stdinit", called in crt0.c is undefined. The _stdinit call
is bracketed by #ifdef ELXSI, so somebody thought it was appropriate for
an ELXSI. Not being a Unix wizard, I have no idea what this routine
might be for or how to fix crt0.c. But I can make a few guesses...
	Could this be something that used to be available in a system
library for the ELXSI BSD 4.2 Unix, having something to do with terminal
handling, but isn't there any more, has changed names, or must be explicitly
pulled in from a library somewhere? I don't know.
	Some short terminal session and code transcriptions are attached.
I'd really appreciate any assistance anyone could lend in helping me get GNU
Emacs going.

Thanks,
	Jon

==============

Following is partial output from when make tries to link temacs (from
running install-build or running make directly):

|make    -f xmakefile  all
|ld  -X  -o temacs crt0.o dispnew.o [...many others...]  malloc.o -lg -lc
|undefined               first referenced
| symbol                     in file
|_stdinit                        crt0.o
|
|[at this point there is a delay of several seconds, possibly indicating]
|[that all other references were resolved. Then I get:]
|
|ld fatal: Symbol referencing errors. No output written to temacs
|*** Exit 13
|
|Stop.
|*** Exit 1
|
|Stop.

Grepping through all files in the etc/ and src/ directories, the ONLY
reference to _stdinit is in the file the linker complained about,
"src/crt0.c".  The purpose of "crt0.c" seems to be very machine-dependent,
but is otherwise opaque to me. Here's possibly relevent sections of crt0.c:

|/* C code startup routine.
|   [GNU copyleft and other machine-specific (I think) comments omitted] */
|#include "config.h"
|
|/*		********  WARNING ********
|    Do not insert any data definitions before data_start!
|    Since this is the first file linked, the address of the following
|    variable should correspond to the start of initialized data space.
|    On some systems this is a constant that is independent of the text
|    size for shared executables.  On others, it is a function of the
|    text size. In short, this seems to be the most portable way to
|    discover the start of initialized data space dynamically at runtime,
|    for either shared or unshared executables, on either swapping or
|    virtual systems.  It only requires that the linker allocate objects
|    in the order encountered, a reasonable model for most Unix systems.
|    Similarly, note that the address of _start() should be the start
|    of text space.   Fred Fish, UniSoft Systems Inc.  */

[That was all of the comments that looked potentially useful. The following
 code is all that remains when I use "cc -E crt0.c" to run it through the
 preprocessor. Nearly all of the deleted code was machine-specific.]

|int data_start = 0;
|
|extern int errno;
|extern char **environ;
|
|_start()
|{
|  register int r;
|  
|  errno = 0;
|  environ = *(&environ + 8);
|  _stdinit();
|  r = main(*(&environ + 6), *(&environ + 7), environ);
|  exit(r);
|  _exit(r);
|}

And that's all I can think of at the moment that might apply. Thanks for
your attention if you've read this far. 

-Jon
-- 
----
random rumors from Jon Spear, comp eng student | With computers we can make a
jspear@blackbird.afit.af.mil or @afit-ab.arpa  | billion mistakes every second.