bug-commoncpp
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Porting CommonC++ to AiX-4.3


From: Bernhard Trummer
Subject: Porting CommonC++ to AiX-4.3
Date: Thu, 17 Jan 2002 11:38:16 +0100
User-agent: Mutt/1.2.5i

Hello,

I'm trying to port the current CVS-version of the CommonC++ library
(:pserver:address@hidden:/cvsroot/cplusplus)
to AiX using the Visual Age C++ 5.0 (xlC) compiler.
(We cannot use the AiX-version of GNU g++, since its C++ binary format
 is incompatible to our xlC-generated C++ libraries)

I had to apply the patches in the attachment to make it compilable:

patch.src:
  * Added forward declarations for endKeydata() and siginstall(int).
  * Added missing typename's in persist.h.
  * thread.h: CCXX_SYSV_SEMAPHORES will be defined for AiX [1].

patch.m4:
  * The namespace and mutable test will now use AC_TRY_COMPILE.
    This is, because the manual compilation didn't work.
  * sys/libcsys.h exists on AiX, but it must not be included,
    because otherwise, duplicate declarations of memcpy() will occur.

patch.demo:
  * Removed duplicate default-parameter declarations to make xlC happy.


Currently, I'm using a hand-written Makefile for the compiling,
because xlC needs other compiler-options (especially for the linking)
than g++ does. I hope, I can find a way to let automake/libtool create
the right compiler-flags...


Other feedback:

1.)
The demo-program "threadtest" doesn't run through:
----- snip -----
Testing suspend & resume
 
- thread should not change n...ko
----- snap -----

If I have some time, I will take a closer look at what's going wrong...


2.)
The SocketService currently crashes immediately, after Start()
is called. Maybe it works, if the thread-stuff above is fixed...


[1]
AiX actually has pthread-semaphores, but they don't work!
The sem_xxx calls always return -1 and errno==ENOSYS.
There are two possibilities to solve this problem:
1. Use SysV semaphores, like there seems to be done for FreeBSD <=3.
2. Use an alternative semaphore implementation using a pthread_mutex
   and a pthread_cond.

In the second case, the following autoconf-macro may be useful:

----- snip -----
AC_MSG_CHECKING(if POSIX semaphores are working)
AC_TRY_RUN([
#include <semaphore.h>
int main() {
   sem_t sem;
   int rc;
   rc = sem_init(&sem, 0, 0);
   return rc;
}],
        AC_DEFINE(HAVE_POSIX_SEMAPHORES)
        AC_MSG_RESULT(yes),
        AC_MSG_RESULT(no),
        AC_MSG_RESULT(no)
)
----- snap -----


Thank you and ciao.

-- 
"I gained nothing at all from Supreme Enlightenment, and for that very
reason it is called Supreme Enlightenment."
                -- Gotama Buddha

Attachment: patch.src
Description: WAIS Source

Attachment: patch.m4
Description: Text document

Attachment: patch.demo
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]