compile failure on xmalloc()

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: compile failure on xmalloc()
Date: 2004-01-25 04:39:21
Message-ID: 200401250439.i0P4dLw14151@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


I am seeing the following compile failure in currrent CVS. Seems there
is a conflict between readline and psql's use of the xmalloc function
name.

---------------------------------------------------------------------------

gcc -O2 -fno-strict-aliasing -Wall -Wmissing-prototypes -Wmissing-declarations -O1 -Wall -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith -Wcast-align command.o common.o help.o input.o stringutils.o mainloop.o copy.o startup.o prompt.o variables.o large_obj.o print.o describe.o tab-complete.o mbprint.o -L../../../src/interfaces/libpq -lpq -L../../../src/port -L/usr/local/lib -L/usr/contrib/lib -Wl,-rpath,/usr/local/pgsql/lib -O1 -Wall -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith -Wcast-align -lssl -lcrypto -lz -lreadline -ltermcap -lgetopt -lcompat -lipc -ldl -lm -lutil -lpgport -o psql
/usr/local/lib/libreadline.a(xmalloc.o): In function `xmalloc':
/u/src/lib/readline/readline-2.2.1/xmalloc.c:51: multiple definition of `xmalloc'
common.o(.text+0x5c): first defined here
ld: Warning: size of symbol `xmalloc' changed from 54 to 47 in xmalloc.o

---------------------------------------------------------------------------

It seems it is from these commits:

---------------------------------------------------------------------------

----------------------------
revision 1.82
date: 2004/01/25 03:07:22; author: neilc; state: Exp; lines: +7 -8
More fallout from the recent psql patch: rename xmalloc and friends to
pg_malloc, to avoid linker failures on same platforms.
----------------------------
revision 1.81
date: 2004/01/24 19:38:49; author: neilc; state: Exp; lines: +39 -7
This patch makes some of the memory manipulation performed by psql a
little more sane. Some parts of the code was using a static function
xmalloc() that did safe memory allocation (where "safe" means "bail
out on OOM"), but most of it was just invoking calloc() or malloc()
directly. Now almost everything invokes xmalloc() or xcalloc().

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2004-01-25 04:55:11 Re: Regarding development and the submittal of patches
Previous Message Bruce Momjian 2004-01-25 04:07:28 Re: Getting the results columns before execution