[comp.windows.x] Problems building GNU Emacs with DECwindows

iglesias@orion.cf.uci.edu (Mike Iglesias) (09/13/89)

I'm trying to build GNU Emacs v18.55 on a DECstation 3100 running
Ultrix v3.0 and DECwindows.  When ld links the executable, it
complains that malloc, realloc and free are multiply defined.  ld does
leave a src/temacs file, which seems to run ok if I chmod it to have
execute permissions.  I then run make again and it builds the dumped
verions of Emacs, which also appears to run ok in the limited testing
I've done on it.

Has anyone else built GNU Emacs on a DECstation 3100 using the
DECwindows X11 library and gotten around this problem? 

Below is a script of the ld of emacs.

Thanks in advance for any information!


Mike Iglesias
University of California, Irvine
Internet:  iglesias@orion.cf.uci.edu
BITNET:    iglesias@uci
UUCP:      ...!ucbvax!ucivax!iglesias


------------------------------------------------------------------------
Script started on Mon Sep 11 22:02:07 1989
csh> make
        cd etc; make  all
        cd src; make  all
        make    -f xmakefile  all
        ld  -X -D 800000  -o temacs pre-crt0.o /lib/crt0.o dispnew.o scroll.o xdisp.o window.o  term.o cm.o x11term.o x11fns.o  emacs.o keyboard.o macros.o keymap.o sysdep.o  buffer.o filelock.o insdel.o marker.o  minibuf.o fileio.o dired.o filemode.o  cmds.o casefiddle.o indent.o search.o regex.o undo.o  alloc.o data.o doc.o editfns.o callint.o  eval.o fns.o print.o lread.o  abbrev.o syntax.o unexmips.o mocklisp.o bytecode.o  process.o callproc.o   doprnt.o termcap.o tparam.o lastfile.o malloc.o   -lX11  




  -lc 
ld:
/lib/libX11.a(XvmsAlloc.o): malloc: multiply defined
/lib/libX11.a(XvmsAlloc.o): realloc: multiply defined
/lib/libX11.a(XvmsAlloc.o): free: multiply defined
*** Error code 1

Stop.
*** Error code 1

Stop.
*** Error code 1

Stop.
csh> 

jsw@UMIACS.UMD.EDU (09/13/89)

 > I'm trying to build GNU Emacs v18.55 on a DECstation 3100 running
 > Ultrix v3.0 and DECwindows.  When ld links the executable, it
 > complains that malloc, realloc and free are multiply defined.  ld does
 > leave a src/temacs file, which seems to run ok if I chmod it to have
 > execute permissions.  I then run make again and it builds the dumped
 > verions of Emacs, which also appears to run ok in the limited testing
 > I've done on it.

 > Has anyone else built GNU Emacs on a DECstation 3100 using the
 > DECwindows X11 library and gotten around this problem? 


I have had a similar problem with many X applications and DEC's version
of libX11.a .  I usually get a message that calloc is multiply defined.
I have been able to get around this message in the past by expressly 
specifying linking with libc.a right before libX11.a  

example:

	ld -o bozo foo.o bar.o -lc -lX11

I think this causes libc.a to be read twice, but, I get no warnings and the
executables have the correct permissions.


Why does DEC define calloc (and some other memory allocation funcs) in 
libX11.a ?  The libX11.a has malloc defined (external text) in XvmsAlloc.o
in libX11.a and calloc defined in XvmsCalloc.o in libX11.a ?  Are these
for VMS?

Jeff Webber /   U of Maryland Institute for Advanced Computer Studies
path: uunet!mimsy!jsw  phone (301)-454-7687  jsw@lorax.umiacs.umd.edu 

frank@croton.dec.com (Frank Wortner) (09/13/89)

In article <2684@orion.cf.uci.edu>, iglesias@orion.cf.uci.edu (Mike Iglesias) writes:
> From: iglesias@orion.cf.uci.edu (Mike Iglesias)
> Subject: Problems building GNU Emacs with DECwindows
> Date: 12 Sep 89 21:29:28 GMT
> 
> I'm trying to build GNU Emacs v18.55 on a DECstation 3100 running
> Ultrix v3.0 and DECwindows.  When ld links the executable, it
> complains that malloc, realloc and free are multiply defined.

Here's what I did to kludge around this problem.  I created a file called
"s-ultrix3.h" and #include'd it in "config.h" instead of the supplied "s-bsd4.3.h".  ... Ugly, but effective.

					Frank

P.S.  Here's s-ultrix3.h:

/*
  ULTRIX 3.0 has a name conflict in its X11 library, so we have to
  map these names to something else.  Otherwise, the OS is just like
  4.3 BSD.
*/
#define C_SWITCH_SYSTEM -Dmalloc=gnumalloc -Drealloc=gnurealloc -Dfree=gnufree

#include "s-bsd4-3.h"
croton>

klee@gilroy.pa.dec.com (Ken Lee) (09/14/89)

In article <2684@orion.cf.uci.edu>, iglesias@orion.cf.uci.edu (Mike Iglesias) writes:
> I'm trying to build GNU Emacs v18.55 on a DECstation 3100 running
> Ultrix v3.0 and DECwindows. 

Try defining SYSTEM_MALLOC in your GNU emacs s-*.h file.  If you then 
have problems with "sequence lost" errors, you should upgrade to a more
recent version of DECwindows.

Ken Lee
DEC Western Software Laboratory, Palo Alto, Calif.
Internet: klee@decwrl.dec.com
uucp: uunet!decwrl!klee

klee@gilroy.pa.dec.com (Ken Lee) (09/14/89)

In article <8909130047.AA05734@lorax.umiacs.UMD.EDU>, jsw@UMIACS.UMD.EDU writes:
> Why does DEC define calloc (and some other memory allocation funcs) in 
> libX11.a ?  The libX11.a has malloc defined (external text) in XvmsAlloc.o
> in libX11.a and calloc defined in XvmsCalloc.o in libX11.a ? 

DEC's Ultrix libX11.a has it's memory functions because these are much
faster than the libc routines.  If you're not interested, remove these
2 files from the libX11.a archive.

Ken Lee
DEC Western Software Laboratory, Palo Alto, Calif.
Internet: klee@decwrl.dec.com
uucp: uunet!decwrl!klee

margaret%cs.utah.edu@wasatch.utah.edu (Malgorzata Sturgill) (09/14/89)

In article <8909130047.AA05734@lorax.umiacs.UMD.EDU> jsw@UMIACS.UMD.EDU writes:
>
>
>Why does DEC define calloc (and some other memory allocation funcs) in 
>libX11.a ?  The libX11.a has malloc defined (external text) in XvmsAlloc.o
>in libX11.a and calloc defined in XvmsCalloc.o in libX11.a ?  Are these
>for VMS?
>
>Jeff Webber /   U of Maryland Institute for Advanced Computer Studies
>path: uunet!mimsy!jsw  phone (301)-454-7687  jsw@lorax.umiacs.umd.edu 


Those are defined for VMS, as far as I can tell. what you can dois
to unboundle the library, remove the vms files, and archive it again
			margaret

Malgorzata Marek Sturgill		margaret@cs.utah.edu
					margaret@ms.uky.edu
"Violence never settles anything"
	Genghis Khan

jv@mh.nl (Johan Vromans) (09/14/89)

| I'm trying to build GNU Emacs v18.55 on a DECstation 3100 running
| Ultrix v3.0 and DECwindows.  When ld links the executable, it
| complains that malloc, realloc and free are multiply defined.

There is a remark (including a fix) about this problem in etc/MACHINES.
It is also solved with Ultrix3.1 (UWS2.1)

| I have had a similar problem with many X applications and DEC's version
| of libX11.a .  I usually get a message that calloc is multiply defined.
| I have been able to get around this message in the past by expressly 
| specifying linking with libc.a right before libX11.a  
| 
| example:
| 
| 	ld -o bozo foo.o bar.o -lc -lX11
| 
| I think this causes libc.a to be read twice, but, I get no warnings and the
| executables have the correct permissions.

The relase notes for Ultrix3.1 (UWS2.1) describe that this problem is
fixed, and what to do if you want your own *alloc routines.

Johan

--
Johan Vromans				       jv@mh.nl via internet backbones
Multihouse Automatisering bv		       uucp: ..!{mcvax,hp4nl}!mh.nl!jv
Doesburgweg 7, 2803 PL Gouda, The Netherlands  phone/fax: +31 1820 62944/62500
------------------------ "Arms are made for hugging" -------------------------