Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!shelby!apple!oliveb!mipos3!pinkas
From: pinkas@cadev5.intel.com (Israel Pinkas ~)
Newsgroups: gnu.emacs
Subject: Re: GNU Emacs build with X11
Message-ID: 
Date: 27 Sep 89 21:06:18 GMT
References: 
Sender: news@mipos3.intel.com
Distribution: gnu
Organization: Corporate CAD, INTeL Corporation, Santa Clara, CA
Lines: 58
In-reply-to: brister@td2cad.intel.com's message of 27 Sep 89 05:21:16 GMT

In article  brister@td2cad.intel.com (James Brister) writes:

> I've just run make to re-build 18.51 under X11. Everything goes fine
> until the load of temacs. Then I get the following message



> _malloc: ld:/lib/libX11.a(XvmsAlloc.o): multiply defined
> _free: /lib/libX11.a(XvmsAlloc.o): multiply defined
> _realloc: /lib/libX11.a(XvmsAlloc.o): multiply defined
> *** Error code 2

This problem is caused by libX11.a under UWS 2.0 (Ultrix 3.0).  There are a
number of other problems with this library that cause Emacs to lose events
and crash.  The correct thing to do is to upgrade to UWS 2.1 (Ultrix 3.1).

The problem is that libX11.a defines free(), malloc(), realloc(), and
calloc() in the same module.  Emacs defines the first three in malloc.c.
Emacs uses calloc().  When searching the libraries, it finds calloc() in
libX11.a and pulls in the module.  As a result, you get a duplicate
declaration.

If for some reason you cannot upgrade to Ultrix 3.1, you can work around
this by either explicitly listing -lc on the ld line before -lX11, or by
doing the following (as quoted from etc/MACHINES in 18.5[45]):


Vax running Ultrix (m-vax.h; s-bsd4-2.h or s-bsd4-3.h)

  Works.  Note that "ultrix" is essentially 4.2 or 4.3, depending on version.

  Ultrix 3.0 has incompatibilities in its X library if you have the
  Ultrix version of X.  To solve them, you need to prevent XvmsAlloc.o
  in Xlib from being used.  Israel Pinkas says:

    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


Hope this helps.

-Israel Pinkas
--
--------------------------------------
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!cadev4!pinkas
ARPA:	pinkas%cadev4.intel.com@relay.cs.net
CSNET:	pinkas@cadev4.intel.com