[gnu.emacs] GNU Emacs build with X11

brister@td2cad.intel.com (James Brister) (09/27/89)

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

ld -X -o temacs 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
unexec.o mocklisp.o bytecode.o 	process.o callproc.o doprnt.o termcap.o
tparam.o lastfile.o malloc.o -lX11 -lg -lc
_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

I guess the question WHY is for comp.windows.x, but could someone clue me in on
how to get around this? Thanks.

James
--
James Brister                                          brister@td2cad.intel.com
Intel Corp.                                      {decwrl,oliveb}!td2cad!brister

pinkas@cadev5.intel.com (Israel Pinkas ~) (09/28/89)

In article <BRISTER.89Sep26222116@aries.td2cad.intel.com> 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

<ld command deleted.>

> _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

prakash@aiag.dec.com (Phone: (508)490.8139 [DTN 291.8139] To do is to be - Nietzsche; To be is to do - Sartre; Do be do be do - Sinatra. 27-Sep-1989 1738) (09/28/89)

In src/config.h, include the line

#define SYSTEM_MALLOC

and rebuild.

-mayank.

+--------------------------------------------------------------------------+
| InterNet: Prakash@AIAG.DEC.COM                                           |
| UUCP:     ...!decwrl!aiag.dec.com!Prakash                                |
| VoiceNet: (617)490.8139                                                  |
| SnailNet: DEC, 290 Donald Lynch Blvd. DLB5-2/B4, Marlboro, MA 01752      |
+--------------------------------------------------------------------------+

Disclaimer: The above is probably only line noise, and does not reflect the
            opinions of anybody, including mine, far less my employer's.