...

Поиск
Список
Период
Сортировка
От Tegge, Bernd
Тема ...
Дата
Msg-id 5.0.2.1.0.20010502113246.02380560@dragon.dr.repas.de
обсуждение исходный текст
Список pgsql-ports
>Peter Eisentraut <peter_e@gmx.net> writes:
> > ... The patch for
> > pg_regress.sh should be taken out as well.  If someone wants to run the
> > parallel regression tests he can install a real shell.
>
>Fine with me (it's a mighty ugly patch) but if we treat it that way
>then FAQ_QNX4 had best mention that the parallel regress tests do not
>work without <some shell>.  Compare FAQ_HPUX.

Yes, it is rather ugly but I couldn't come up with something better. Will
change the FAQ accordingly.

> > Postgres on qnx4 should now be operational.
>
>Can you fix the compiler installation so you won't need the weird
>-I/usr/local/lib/gcc-lib/i386-pc-qnx4/egcs-2.91.60/include/g++ option
>anymore?

I believe it's necessary only if you're going to build the libpq++
interface.
I don't have gpp installed, so I can't check it, but from the default
install script I would say it is safe to change this to
/usr/local/include/g++ .


>Also, can you check the comment in src/backend/bootstrap/Makefile, "qnx4's
>wlink currently crashes with bootstrap.o".  Is this fixed?

No, effectively support for the Watcom compiler suite has stopped some
time after Watcom was bought by Sybase. Until the OpenWatcom project
releases the open source version of the compiler and QSSL adds their
part of the QNX port we will be stuck with this problem.

Am 14:06 30.04.01 -0400 schrieb Tom Lane:
>Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > I looked this over and it looks safe for 7.1.1.  Only QNX changes are
> > made.  Can someone confirm?
>
>No!  It also reverts my 1.91 changes in s_lock.h.  Please correct the
>patch to not do that.
Done.

Am 00:36 01.05.01 +0200 schrieb Peter Eisentraut:
>Bruce Momjian writes:
>
> > I looked this over and it looks safe for 7.1.1.  Only QNX changes are
> > made.  Can someone confirm?  If no one confirms it is save, I will keep
> > it for 7.2.
>
>The patch for plpgsql/Makefile is unnecessary.
This is another instance of wlib dying while trying to build the library.
Since plpgsql does not work on QNX anyway I saw no reason to let it
enter that directory at all.

I have added an on_proc_exit function in semget() so that the process which
creates the semaphore shared memory will remove it on exit. This seems to
work but if this is not not The Right Way to do this, please enlighten me.

  TIA, Bernd


--
Bernd Tegge                  mailto:tegge@repas-aeg.de
Tel: ++49-511-87449-12       repas AEG Automation GmbH
Fax: ++49-511-87449-20       GS Hannover, Germany
diff -X /home/repas/expat -rw postgresql-7.1/doc/FAQ_QNX4 postgresql-7.1.qnx4/doc/FAQ_QNX4
10,11c10
< shared memory and IPC and of some IEEE floating-point functionality. For
< the Watcom compiler spinlocks have been implemented using POSIX semaphores.
---
> shared memory and IPC and of some IEEE floating-point functionality.
13c12
< It is recomended to use the GNU C compiler instead of the Watcom compiler
---
> It is necessary to use the GNU C compiler instead of the Watcom compiler
34,36c33,36
< QNX 4.25
< Watcom C 10.6
< GNU make
---
> QNX standard:
> QNX 4.25, Watcom C 10.6, GNU make
>
> Available from http://www.teaser.fr/~jcmichot/
38c38,43
< egcs111-qnx4-r20.tar[.gz] (GNU C)
---
> egcs-112-qnx4-r20.tar[.gz] (GNU C)
>
> Available from ftp://ftp.visi.com/users/hawkeyd/qnx/
> bison-1.2.5.tar.gz
>
> Available from http://quics.qnx.com/cgi-bin/dir_find.cgi?/usr/free/
39a45,48
>
> from ftp://ftp.freesoftware.com/pub/infozip/zlib/
> zlib 1.1.3
>
41a51,56
> In order to achieve meaningful results for the regression tests, you need
> a different shell. The standard QNX shell is quite broken with regard to
> scripting (even QSSL suggested to use pdksh or bash). Both are available
> in source and binaries at
> http://quics.qnx.com/cgi-bin/dir_find.cgi?/usr/free/
>
43a59,63
> The current version of bison (1.2.8 at the time of this writing) does not
> build cleanly on QNX4 with gcc installed, but you can download src and
> binary of a previous version from the above mentioned ftp site.
>
> download source
45c65
< /etc/install -u egcs111-qnx4-r20.tar[.gz]
---
> /etc/install -u egcs112-qnx4-r20.tar[.gz]
82c102
< /usr/local/lib/gcc-lib/i386-pc-qnx4/egcs-2.91.60/include/g++/stl_alloc.h
---
> /usr/local/lib/gcc-lib/i386-pc-qnx4/egcs-2.91.66/include/g++/stl_alloc.h
86,88d105
< If you use another ecpg version the include/g++ path in Makefile.qnx4
< (CXXFLAGS) has to be adopted.
<
91,92c108,109
< ./configure --with-tcl --with-perl --with-x
< gmake all > make.log 2>&1
---
> ./configure --with-tcl --without-tk --with-perl
> gmake > make.log 2>&1
116,117c133,135
< parse.h, gram.c, preproc.h and preporc.c are included in official
< distributions.
---
> parse.h, gram.c, preproc.h and preproc.c are included in official
> distributions. In order to avoid this, install the bison binary mentioned
> above.
120a139,141
> please don't use the QNX shell for the parallel regression tests. Download
> bash from quics.qnx.com and run 'make SHELL=/usr/local/bin/bash check'
> instead.
139c160,161
< create_function_2, triggers, misc, plpgsql:
---
> create_function_1, create_function_2, create_type, create_operator,
> create_view, select_views, triggers, misc, plpgsql:
150c172
< The reached state of this port should be sufficient for lot of applications.
---
> The current state of this port should be sufficient for lot of applications.
155d176
< kardos@repas-aeg.de
157a179,181
> Bernd Tegge
> tegge@repas-aeg.de
> 2001-03-01
diff -X /home/repas/expat -rw postgresql-7.1/src/backend/Makefile postgresql-7.1.qnx4/src/backend/Makefile
28c28,29
< # necessary?)
---
> # necessary?) [ Yes, until the Watcom compiler goes open source it's
> # effectively unsupported ]
diff -X /home/repas/expat -rw postgresql-7.1/src/backend/port/qnx4/sem.c
postgresql-7.1.qnx4/src/backend/port/qnx4/sem.c
25a26,27
> #include <sys/mman.h>
> #include <sys/stat.h>
28c30
< #define SETMAX    ((MAXBACKENDS + PROC_NSEMS_PER_SET - 1) / PROC_NSEMS_PER_SET)
---
> #define SETMAX    ((MAXBACKENDS + PROC_NSEMS_PER_SET + 1) / PROC_NSEMS_PER_SET)
33c35
< #define SHM_INFO_NAME    "SysV_Sem_Info"
---
> #define SHM_INFO_NAME    "PgSysV_Sem_Info"
58a61,71
> /* ----------------------------------------------------------------
>  * semclean - remove the shared memory file on exit
>  *            only called by the process which created the shm file
>  * ----------------------------------------------------------------
>  */
>
> static void
> semclean( void )
> {
>   remove( "/dev/shmem/" SHM_INFO_NAME );
> }
134a148
>   struct stat statbuf;
155a170,189
>     if ( fstat( fd, &statbuf ) ) /* would be strange : the only doc'ed */
>     {                            /* error is EBADF */
>       close( fd );
>       return -1;
>     }
>     /*
>      * size is rounded by proc to the next __PAGESIZE
>      */
>     if ( statbuf.st_size !=
>          ((( sizeof(struct sem_info) /__PAGESIZE)+1) * __PAGESIZE) )
>     {
>        fprintf( stderr,
>          "Found a pre-existing shared memory block for the semaphore memory\n"
>          "of a different size (%ld instead %ld). Make sure that all executables\n"
>          "are from the same release or remove the file \"/dev/shmem/%s\"\n"
>          "left by a previous version.\n", statbuf.st_size,
>          sizeof(struct sem_info), SHM_INFO_NAME);
>          errno = EACCES;
>        return -1;
>     }
169a204
>       on_proc_exit( semclean, NULL );
diff -X /home/repas/expat -rw postgresql-7.1/src/backend/port/qnx4/shm.c
postgresql-7.1.qnx4/src/backend/port/qnx4/shm.c
17a18
> #include <string.h>
20a22
> #include <sys/stat.h>
43a46,51
> static char *
> keytoname(key_t key, char *name)
> {
>   sprintf( name,"PgShm%x", key );
>   return name;
> }
174a183,185
>   int     result;
>   int     fd;
>   struct stat statbuf;
176c187,188
<     if (cmd == IPC_RMID)
---
>
>     switch( cmd )
177a190
>     case IPC_RMID :
183c196,217
<         return shm_unlink(itoa(info.key, name, 16));
---
>       close( info.shmid );
>       keytoname(info.key, name);
>       return shm_unlink( name );
>
>     case IPC_STAT :
>       /*
>        * we have to open it first. stat() does no prefix tracking
>        * -> the call would go to fsys instead of proc
>        */
>       keytoname(shmid, name);
>       fd = shm_open( name, 0, MODE );
>       if ( fd >= 0 )
>       {
>         result = fstat( fd, &statbuf );
>         /*
>          * if the file exists, subtract 2 from linkcount :
>          *  one for our own open and one for the dir entry
>          */
>         if ( ! result )
>           buf->shm_nattch = statbuf.st_nlink-2;
>         close( fd );
>         return result;
185c219
<     if (cmd == IPC_STAT)
---
>       else
187d220
<
189,190c222,223
<          * Can we support IPC_STAT?  We only need shm_nattch ... For now,
<          * punt and assume the shm seg does not exist.
---
>          * if there's no entry for this key it doesn't matter
>          * the next shmget() would get a different shm anyway
192,193c225,227
<         errno = EINVAL;
<         return -1;
---
>         buf->shm_nattch = 0;
>         return 0;
>       }
217c251
<     info.shmid = shm_open(itoa(key, name, 16), oflag, MODE);
---
>     info.shmid = shm_open(keytoname(key, name), oflag, MODE);
225c259,263
<         if (shm_putinfo(&info) == -1)
---
>         if (shm_putinfo(&info) == -1) {
>       close( info.shmid );
>       if ( (oflag & (O_CREAT|O_EXCL)) == (O_CREAT|O_EXCL) ) {
>         shm_unlink( name );
>       }
226a265
>     }
diff -X /home/repas/expat -rw postgresql-7.1/src/backend/port/qnx4/tstsem.c
postgresql-7.1.qnx4/src/backend/port/qnx4/tstsem.c
42a43,46
> void on_proc_exit( void (*function)(), Datum arg )
> {
>   atexit( function );
> }
diff -X /home/repas/expat -rw postgresql-7.1/src/bin/ipcclean/ipcclean.sh
postgresql-7.1.qnx4/src/bin/ipcclean/ipcclean.sh
36c36,46
<
---
> #
> # This is QNX 4.25
> #
> if [ `uname` = 'QNX' ]; then
>     if ps -eA  | grep -s '[p]ostmaster' >/dev/null 2>&1 ; then
>         echo "$CMDNAME: You still have a postmaster running." 1>&2
>         exit 1
>     fi
>     rm -f /dev/shmem/PgS*
>     exit $?
> fi
diff -X /home/repas/expat -rw postgresql-7.1/src/include/port/qnx4.h postgresql-7.1.qnx4/src/include/port/qnx4.h
7,9d6
< #if !defined(__GNUC__)
< #include <semaphore.h>            /* for sem_t */
< #endif
12d8
< #define HAVE_STRING_H
29d24
< #if defined(__GNUC__)
31,35d25
<
< #else
< typedef sem_t slock_t;
<
< #endif
diff -X /home/repas/expat -rw postgresql-7.1/src/include/storage/s_lock.h
postgresql-7.1.qnx4/src/include/storage/s_lock.h
109c109
< #if defined(__i386__) && !defined(__QNX__)
---
> #if defined(__i386__)
399,400c399
<
< #if defined(__QNX__)
---
> #if defined(__QNX__) && defined(__WATCOMC__)
402,404c401
<  * QNX 4
<  *
<  * Note that slock_t under QNX is sem_t instead of char
---
>  * QNX 4 using WATCOM C
406,410c403,412
< #define TAS(lock)        (sem_trywait((lock)) < 0)
< #define S_UNLOCK(lock)    sem_post((lock))
< #define S_INIT_LOCK(lock)        sem_init((lock), 1, 1)
< #define S_LOCK_FREE(lock)        ((lock)->value)
< #endif     /* __QNX__ */
---
> #define TAS(lock) tas(lock)
> static tas(volatile slock_t *lock)
> #pragam aux tas =\
>         "    mov   al,1    " \
>         "    lock              " \
>         "    xchgb    al,[esi]" \
>         parm [esi]        \
>         value [al]
>
> #endif     /* __QNX__ and __WATCOMC__*/
diff -X /home/repas/expat -rw postgresql-7.1/src/makefiles/Makefile.qnx4
postgresql-7.1.qnx4/src/makefiles/Makefile.qnx4
16,17c16
< # Hack alert!  Fix your compiler installation...
< override CXXFLAGS +=-I/usr/local/lib/gcc-lib/i386-pc-qnx4/egcs-2.91.60/include/g++
---
> override CXXFLAGS +=-I/usr/local/include/g++
diff -X /home/repas/expat -rw postgresql-7.1/src/pl/plpgsql/Makefile postgresql-7.1.qnx4/src/pl/plpgsql/Makefile
14a15,16
> ifneq ($(PORTNAME), qnx4)
>
16a19,25
>
> else  #qnx4
>
> all install installdirs uninstall distprep:
>     echo plpgsql not supported with QNX due to lack of shared library support
>
> endif # qnx4

В списке pgsql-ports по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Patches for 7.1 on QNX4
Следующее
От: "Tegge, Bernd"
Дата:
Сообщение: postgresql 7.1 on linux alpha