[gnu.emacs.bug] 18.52 won't compile with Ultrix 3.0 Xlib

caby@vax5.CIT.CORNELL.EDU (02/23/89)

Has anyone successfully compiled 18.52 with X11 support under Ultrix 3.0?
Ld complains that malloc, free, and realloc are multiply defined, once
by emacs and once in XvmsAlloc.o in Xlib.  What can I do about this?

Philippe Lacroute
caby@ionvax.tn.cornell.edu

pinkas@hobbit.intel.com (Israel Pinkas ~) (02/24/89)

In article <18007@vax5.CIT.CORNELL.EDU> caby@vax5.CIT.CORNELL.EDU writes:

> Has anyone successfully compiled 18.52 with X11 support under Ultrix 3.0?
> Ld complains that malloc, free, and realloc are multiply defined, once
> by emacs and once in XvmsAlloc.o in Xlib.  What can I do about this?

I did this just last week.  I could not figure out which to use, but when I
looked into the problem, I realized that I probably should use the GNU
code.

I added the following lines to config.h after the X defines:

#if defined(ultrix) && defined(X11)
#define OBJECTS_SYSTEM calloc.o
#endif

Then I ran the following:

ar x /usr/lib/libc.a calloc.o

When I did the build, calloc.o was included.  XvmsAlloc.o was no longer
needed, and was not included.  (XvmsAlloc.o defines malloc, realloc, free,
and calloc.  libc.a on every machine that I have examined puts calloc in a
separate module.  Since DEC's X library makes extensive use of calloc,
this module was included.)

Hope this helps,

-Israel

P.S.  I checked with my DEC rep and they said that it was OK to do this as
long as the binary was only used on DEC machines that were licensed for the
same version of the OS as calloc was supplied with.  Your mileage may vary,
so you might want to check if you plan to distribute this to other sites.
--
--------------------------------------
Disclaimer: The above are my personal opinions, and in no way represent
the opinions of Intel Corporation.  In no way should the above be taken
to be a statement of Intel.

UUCP:	{amdcad,decwrl,hplabs,oliveb,pur-ee,qantel}!intelca!mipos3!cad001!pinkas
ARPA:	pinkas%cad001.intel.com@relay.cs.net
CSNET:	pinkas@cad001.intel.com

weening@Gang-of-Four.Stanford.EDU (Joe Weening) (02/24/89)

In article <18007@vax5.CIT.CORNELL.EDU> caby@vax5.CIT.CORNELL.EDU writes:

   Has anyone successfully compiled 18.52 with X11 support under Ultrix 3.0?
   Ld complains that malloc, free, and realloc are multiply defined, once
   by emacs and once in XvmsAlloc.o in Xlib.  What can I do about this?

This is apparently because libX11.a on Ultrix 3.0 is for Decwindows,
not plain X11.  Installing X11 from the MIT distribution will fix
this, and it also runs noticeably faster than Decwindows, I'm told.
--

Joe Weening                                Computer Science Dept.
weening@Gang-of-Four.Stanford.EDU          Stanford University