~vcs-imports/mammoth-replicator/trunk

« back to all changes in this revision

Viewing changes to doc/FAQ_QNX4

  • Committer: alvherre
  • Date: 2005-12-16 21:24:52 UTC
  • Revision ID: svn-v4:db760fc0-0f08-0410-9d63-cc6633f64896:trunk:1
Initial import of the REL8_0_3 sources from the Pgsql CVS repository.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
PostgreSQL on QNX 4
 
2
--------------------
 
3
last updated:           $Date: 2004-03-23 01:23:47 $
 
4
 
 
5
current maintainer:     Bernd Tegge (tegge@repas-aeg.de)
 
6
original author:        Andreas Kardos (kardos@repas-aeg.de)
 
7
 
 
8
This port is an important step because PostgreSQL is still the only free
 
9
relational database with full SQL and ODBC support available for QNX 4.
 
10
The only commercial databases available are Empress RDBMS and Velocis
 
11
Database Server (not supported for Digital Unix).
 
12
 
 
13
The most effort required the emulation of System V semaphore sets,
 
14
shared memory and IPC and of some IEEE floating-point functionality.
 
15
 
 
16
It is recommended to use the GNU C compiler instead of the Watcom compiler
 
17
because the Watcom compiler doesn't support a int8 datatype (long or
 
18
long long int) and it does not have a C++ frontend. The only advantage
 
19
using Watcom C would be support of Tk and pgaccess.
 
20
 
 
21
QNX 4 does not offer native support of shared libraries. Therefore the related
 
22
functionality cannot be used. Shared library support could probably be
 
23
implemented in future.
 
24
 
 
25
QNX 4 does not support UNIX domain sockets. Clients must use TCP/IP
 
26
sockets. Therefore, do not set "listen_addresses" to empty in your
 
27
postgresql.conf file.  In fact, it's advisable to explicitly set
 
28
"listen_addresses" in an environment using native QNX networking.
 
29
Otherwise the postmaster might not use the IP-Address you think it does :-)
 
30
 
 
31
Prerequisites:
 
32
--------------
 
33
 
 
34
The following prerequisites have been used:
 
35
 
 
36
QNX standard:
 
37
QNX 4.25, Watcom C 10.6, GNU make
 
38
 
 
39
Available from http://www.teaser.fr/~jcmichot/
 
40
flex-2.5.4a.tar.gz (flex)
 
41
egcs-112-qnx4-r20.tar[.gz] (GNU C)
 
42
 
 
43
Available from ftp://ftp.visi.com/users/hawkeyd/qnx/
 
44
bison-1.2.5.tar.gz
 
45
 
 
46
Available from http://quics.qnx.com/cgi-bin/dir_find.cgi?/usr/free/
 
47
perl 5.004_04
 
48
 
 
49
from ftp://ftp.freesoftware.com/pub/infozip/zlib/
 
50
zlib 1.1.3
 
51
 
 
52
tcl8.0.3.tar.Z (Tcl)
 
53
 
 
54
In order to achieve meaningful results for the regression tests, you need
 
55
a different shell. The standard QNX shell is quite broken with regard to
 
56
scripting (even QSSL suggested to use pdksh or bash). Both are available
 
57
in source and binaries at
 
58
http://quics.qnx.com/cgi-bin/dir_find.cgi?/usr/free/
 
59
 
 
60
flex can be built without any problems using the Watcom or GNU C compilers.
 
61
 
 
62
The current version of bison (1.2.8 at the time of this writing) does not
 
63
build cleanly on QNX4 with gcc installed, but you can download src and
 
64
binary of a previous version from the above mentioned ftp site.
 
65
 
 
66
download source
 
67
GNU C can be installed by
 
68
/etc/install -u egcs112-qnx4-r20.tar[.gz]
 
69
 
 
70
Although Tcl can be built after some slight code changes using the Watcom
 
71
compiler, the GNU C compiler should be used instead. Otherwise it would be
 
72
impossible to link postgres built with GNU C together with libtcl8.0.a built
 
73
with the Watcom compiler. However, if you are going to build a Watcom version
 
74
you must build the tcl and tk libraries with Watcom too.
 
75
 
 
76
To make unix/tclUnixTest.c compilable uncomment
 
77
#include <sys/resource.h>
 
78
in it or
 
79
touch /usr/include/sys/resource.h
 
80
In unix/Makefile.in replace
 
81
        ( echo cd $(TOP_DIR)/tests\; source all ) | ./tcltest
 
82
by
 
83
        ( echo cd ../tests\; source all ) | ./tcltest
 
84
After that Tcl can be built and tested as stated in README.
 
85
 
 
86
Tk cannot be built with GNU C due to the lack of a stack version of the
 
87
X11 library. With the Watcom compiler Tk could be built but this is not useful
 
88
because of the link problems mentioned above.
 
89
 
 
90
Therefore the Tk interface and the pgaccess tool cannot be supported for a GNU C
 
91
version of PostgreSQL on QNX 4.
 
92
 
 
93
PostgreSQL:
 
94
-----------
 
95
 
 
96
On QNX 4 some headers are not in the directories expected. To avoid
 
97
modifications of the code the following links should be made:
 
98
 
 
99
ln -s /usr/local/bin/perl /usr/local/bin/perl5
 
100
ln -s /usr/include/errno.h /usr/include/sys/errno.h
 
101
ln -s /usr/include/ioctl.h /usr/include/sys/ioctl.h
 
102
ln -s /usr/src/pgsql/src/backend/port/qnx4/ipc.h /usr/include/sys/ipc.h
 
103
ln -s /usr/src/pgsql/src/backend/port/qnx4/sem.h /usr/include/sys/sem.h
 
104
ln -s /usr/src/pgsql/src/backend/port/qnx4/shm.h /usr/include/sys/shm.h
 
105
 
 
106
For ecgs-2.91.60 the file
 
107
/usr/local/lib/gcc-lib/i386-pc-qnx4/egcs-2.91.66/include/g++/stl_alloc.h
 
108
had to be patched (extern "C++" { ... } // extern "C++").
 
109
See attached patch.
 
110
 
 
111
If all prerequisites are available postgres can be built and installed by
 
112
cd pgsql/src
 
113
./configure --with-tcl --without-tk --with-perl
 
114
gmake > make.log 2>&1
 
115
gmake install > make.install.log 2>&1
 
116
su
 
117
cd interfaces/perl5
 
118
gmake install
 
119
exit
 
120
 
 
121
All other steps can be carried out as stated in the INSTALL file.
 
122
 
 
123
Make problems:
 
124
--------------
 
125
 
 
126
Sometimes the Watcom library manager wlib crashes with SIGSEGV on some
 
127
object files. This is a general problem and not PostgreSQL related.
 
128
Currently bootstrap.o causes such a crash. The workaround is not to include
 
129
the object file into the SUBSYS.o but link it directly. For further information
 
130
see backend/Makefile and backend/bootstrap/Makefile.
 
131
libpgsql.a currently cannot be generated because of the same problem. But this
 
132
doesn't matter since shared libraries are not supported.
 
133
(The Makefiles are already changed to ignore this, you don't have to
 
134
do anything)
 
135
 
 
136
Regression tests:
 
137
-----------------
 
138
please don't use the QNX shell for the parallel regression tests. Download
 
139
bash from quics.qnx.com and run 'make SHELL=/usr/local/bin/bash check'
 
140
instead.
 
141
 
 
142
The majority of regression tests succeeded. The following tests failed:
 
143
 
 
144
geometry:
 
145
Some slight deviation in the last digit and "0" instead of "-0".
 
146
Can be ignored.
 
147
 
 
148
timestamp, tinterval, abstime, horology:
 
149
Differences for years before the UNIX epoch. The QNX library probably treats
 
150
time_t as unsigned -> dates before 1970 get moved into the far future.
 
151
Can be ignored.
 
152
 
 
153
create_function_1, create_function_2, create_type, create_operator,
 
154
create_view, select_views, triggers, misc, plpgsql:
 
155
Error messages due to the lack of shared library support.
 
156
 
 
157
rules, select_views:
 
158
looks like it fails because it depends on tables created by previously
 
159
failing tests.
 
160
 
 
161
alter_table:
 
162
An expected failure message contains one blank more than expected.
 
163
Possibly a faulty output file.
 
164
 
 
165
int8, subselect, union
 
166
fails for Watcom version because of lacking int8 support.
 
167
 
 
168
The current state of this port should be sufficient for lot of applications.
 
169
 
 
170
 
 
171
Have fun!
 
172
 
 
173
Andreas Kardos
 
174
2000-04-04
 
175
 
 
176
Bernd Tegge
 
177
tegge@repas-aeg.de
 
178
2001-12-10
 
179
 
 
180
---------------------------------------------------------------------------
 
181
 
 
182
*** ./stl_alloc.h.orig  Sat Feb 28 05:17:28 1998
 
183
--- ./stl_alloc.h       Tue Nov 23 04:14:09 1999
 
184
***************
 
185
*** 120,125 ****
 
186
--- 120,126 ----
 
187
  #pragma set woff 1174
 
188
  #endif
 
189
  
 
190
+ extern "C++" {
 
191
  // Malloc-based allocator.  Typically slower than default alloc below.
 
192
  // Typically thread-safe and more storage efficient.
 
193
  #ifdef __STL_STATIC_TEMPLATE_MEMBER_BUG
 
194
***************
 
195
*** 682,687 ****
 
196
--- 683,689 ----
 
197
  # endif
 
198
  
 
199
  #endif /* ! __USE_MALLOC */
 
200
+ } // extern "C++"
 
201
  
 
202
  #if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
 
203
  #pragma reset woff 1174
 
204
 
 
205
 
 
206
Patch required to build with gcc:
 
207
 
 
208
*** /usr/src/postgresql-7.2b3/src/backend/port/qnx4/sem.h       Thu Nov  8 21:37:52 2001
 
209
--- src/backend/port/qnx4/sem.h Mon Dec 10 13:22:18 2001
 
210
***************
 
211
*** 55,60 ****
 
212
--- 55,71 ----
 
213
        ushort_t        sem_num;                /* semaphore #                  */
 
214
        short           sem_op;                 /* semaphore operation          */
 
215
        short           sem_flg;                /* operation flags              */
 
216
+ };
 
217
+
 
218
+ /*
 
219
+  * command union for semctl.
 
220
+  */
 
221
+
 
222
+ union semun {
 
223
+   int val;                    /* value for SETVAL */
 
224
+   struct semid_ds *buf;       /* buffer for IPC_STAT, IPC_SET */
 
225
+   unsigned short int *array;  /* array for GETALL, SETALL */
 
226
+   struct seminfo *__buf;      /* buffer for IPC_INFO */
 
227
  };
 
228
 
 
229
  extern int    semctl(int semid, int semnum, int cmd, /* ... */ union semun arg);