Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit cd5fa5a

Browse files
committed
FAQ_AIX in 8.1.0 contains outdated information about how to deal with
postgres problems due to readline. The attached patch replaces that section of it with better ways of handling the problem. Seneca Cunningham
1 parent 04db9d2 commit cd5fa5a

File tree

1 file changed

+65
-59
lines changed

1 file changed

+65
-59
lines changed

doc/FAQ_AIX

Lines changed: 65 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
From: Zeugswetter Andreas <ZeugswetterA@spardat.at>
2-
$Date: 2005/11/04 18:16:50 $
2+
$Date: 2005/12/08 21:36:50 $
33

44
On AIX 4.3.2 PostgreSQL compiled with the native IBM compiler xlc
55
(vac.C 5.0.1) passes all regression tests. Other versions of OS and
@@ -114,62 +114,68 @@ http://www.faqs.org/faqs/aix-faq/part4/section-22.html
114114

115115
http://www.han.de/~jum/aix/ldd.c
116116
---
117-
From: Christopher Browne <cbbrowne@ca.afilias.info>
118-
Date: 2005-11-02
119-
120-
On AIX 5.3 ML3 (e.g. maintenance level 5300-03), there is some problem
121-
with the handling of the pointer to memcpy. It is speculated that
122-
this relates to some linker bug that may have been introduced between
123-
5300-02 and 5300-03, but we have so far been unable to track down the
124-
cause.
125-
126-
At any rate, the following patch, which "unwraps" the function
127-
reference, has been observed to allow PG 8.1 pre-releases to pass
128-
regression tests.
129-
130-
The same behaviour (albeit with varying underlying functions to
131-
"blame") has been observed when compiling with either GCC 4.0 or IBM
132-
XLC.
133-
134-
------------ per Seneca Cunningham -------------------
135-
136-
The following patch works on the AIX 5.3 ML3 box here and didn't cause
137-
any problems with postgres on the x86 desktop. It's just a cleaner
138-
version of what I tried earlier.
139-
140-
*** dynahash.c.orig Tue Nov 1 19:41:42 2005
141-
--- dynahash.c Tue Nov 1 20:30:33 2005
142-
***************
143-
*** 670,676 ****
144-
145-
146-
/* copy key into record */
147-
currBucket->hashvalue = hashvalue;
148-
! hashp->keycopy(ELEMENTKEY(currBucket), keyPtr, keysize);
149-
150-
151-
/* caller is expected to fill the data field on return */
152-
153-
154-
--- 670,687 ----
155-
156-
157-
/* copy key into record */
158-
currBucket->hashvalue = hashvalue;
159-
! if (hashp->keycopy == memcpy)
160-
! {
161-
! memcpy(ELEMENTKEY(currBucket), keyPtr, keysize);
162-
! }
163-
! else if (hashp->keycopy == strncpy)
164-
! {
165-
! strncpy(ELEMENTKEY(currBucket), keyPtr, keysize);
166-
! }
167-
! else
168-
! {
169-
! hashp->keycopy(ELEMENTKEY(currBucket), keyPtr, keysize);
170-
! }
171-
172-
173-
/* caller is expected to fill the data field on return */
174117

175-
------------ per Seneca Cunningham -------------------
118+
AIX, readline, and postgres 8.1.x:
119+
----------------------------------
120+
121+
If make check doesn't work on AIX with initdb going into an infinite
122+
loop or failing with child processes terminated with signal 11, the
123+
problem could be the installed copy of readline. Previously a patch to
124+
dynahash.c was suggested to get around this, don't use it, better ways
125+
to get postgres working exist.
126+
127+
See <http://archives.postgresql.org/pgsql-patches/2005-11/msg00139.php>
128+
for details about the problem.
129+
130+
Working around the problem:
131+
---------------------------
132+
1) Use the new 8.2devel backend Makefile:
133+
After the matter of readline's export list and the problems that were
134+
occurring on AIX because of it being linked to the backend, a filter
135+
to exclude unneeded libraries from being linked against the backend was
136+
added. Get revision 1.112 of src/backend/Makefile from CVS and replace
137+
the copy that came with postgres with it. Build normally.
138+
139+
2) Use libedit:
140+
There are a few libedit ports available online. Build and install the
141+
desired port. If libreadline.a can be found in /lib, /usr/lib, or in
142+
any location passed to postgres' configure via "--with-libraries=",
143+
readline will be detected and used by postgres. IBM's rpm of readline
144+
creates a symlink to /opt/freeware/lib/libreadline.a in /lib, so merely
145+
excluding /opt/freeware/lib from the passed library path does not stop
146+
readline from being used.
147+
148+
If the linker cannot avoid finding libreadline.a, use revision 1.433
149+
configure.in and 1.19 config/programs.m4 from CVS, change 8.2devel to
150+
the appropriate 8.1.x in configure.in and run autoconf. Add the
151+
configure flag "--with-libedit-preferred".
152+
153+
If the version of libedit used calls its "history.h" something other
154+
than history.h, place a symlink called history.h to it somewhere that
155+
the C preprocessor will check.
156+
157+
3) Configure with "--without-readline":
158+
postgres can be configured with the option "--without-readline". When
159+
this is enabled, postgres will not link against libreadline or libedit.
160+
psql will not have history, tab completion, or any of the other niceties
161+
that readline and libedit bring, but external readline wrappers exist
162+
that add that functionality.
163+
164+
4) Use readline 5.0:
165+
Readline 5.0 does not induce the problems, however it does export
166+
memcpy and strncpy when built using the easy method of "-bexpall". Like
167+
4.3, it is possible to do a build that does not export these symbols,
168+
but it does take considerable manual effort and the creation of export
169+
files.
170+
171+
References
172+
----------
173+
"AIX 5L Porting Guide"
174+
IBM Redbook
175+
http://www.redbooks.ibm.com/redbooks/pdfs/sg246034.pdf
176+
http://www.redbooks.ibm.com/abstracts/sg246034.html?Open
177+
178+
"Developing and Porting C and C++ Applications on AIX"
179+
IBM Redbook
180+
http://www.redbooks.ibm.com/redbooks/pdfs/sg245674.pdf
181+
http://www.redbooks.ibm.com/abstracts/sg245674.html?Open

0 commit comments

Comments
 (0)