I sent this message to Shawn Hsiao a few weeks ago, but received no
response, and neither have there have been any updates to pwlib in the
intervening time.  Is there anyone else who can help me with this
issue?  (I've CC'ed James Gibbs as he is mentioned in DescPackaging as
having packaged Version 1.5.2-10).

Begin forwarded message:
From: Kyle Moffett <[EMAIL PROTECTED]>
Date: June 23, 2005 19:03:26 EDT
To: Shawn Hsiao <[EMAIL PROTECTED]>
Subject: Compiling pwlib on 10.4 (Tiger)


While attempting to compile pwlib (which is required for GnomeMeeting), I get
the following error:


g++3 -DP_MACOSX=810 -DNO_LONG_DOUBLE -D_REENTRANT -Wall - DPHAS_TEMPLATES -I/sw/build/pwlib-1.5.2-12/pwlib/include/ptlib/ unix -I/usr/include/pwlib -I/sw/build/pwlib-1.5.2-12/pwlib/include -O2 -DNDEBUG -I/sw/include -fno-common -dynamic -fno-common - dynamic -DPTRACING=1 -x c++ -c ../../ptclib/asner.cxx -o /sw/build/ pwlib-1.5.2-12/pwlib/lib/obj_Darwin_ppc_r/asner.o In file included from /sw/build/pwlib-1.5.2-12/pwlib/include/ptlib/ unix/ptlib/contain.h:57, from /sw/build/pwlib-1.5.2-12/pwlib/include/ ptlib.h:139,
                 from ../../ptclib/asner.cxx:290:
/sw/build/pwlib-1.5.2-12/pwlib/include/ptlib/unix/ptlib/pmachdep.h: 448: conflicting
   types for `typedef int socklen_t'
/usr/include/sys/socket.h:99: previous declaration as `typedef
   __darwin_socklen_t socklen_t'
make[1]: *** [/sw/build/pwlib-1.5.2-12/pwlib/lib/obj_Darwin_ppc_r/ asner.o] Error 1
make: *** [opt] Error 2
### execution of make failed, exit code 2


If I add this patch to /sw/fink/dists/unstable/main/finkinfo/libs/ pwlib.patch,
in addition to the one already there, the compile gets further:

--- pwlib/include/ptlib/unix/ptlib/pmachdep.h.old       2005-06-22 
09:49:50.000000000 -0400
+++ pwlib/include/ptlib/unix/ptlib/pmachdep.h   2005-06-22 09:50:33.000000000 
-0400
@@ -445,8 +445,6 @@
 #include <netinet/tcp.h>
 #include <sys/ioctl.h>
  
-typedef int socklen_t;
- 
 #define HAS_IFREQ
  
 #define PSETPGRP()  setpgrp(0, 0)

That compile then dies with this error:

g++3 -DP_MACOSX=810 -DNO_LONG_DOUBLE -D_REENTRANT -Wall - DPHAS_TEMPLATES -I/sw/build/pwlib-1.5.2-12/pwlib/include/ptlib/ unix -I/usr/include/pwlib -I/sw/build/pwlib-1.5.2-12/pwlib/include -O2 -DNDEBUG -I/sw/include -fno-common -dynamic -fno-common - dynamic -DPTRACING=1 -x c++ -c udll.cxx -o /sw/build/ pwlib-1.5.2-12/pwlib/lib/obj_Darwin_ppc_r/udll.o
udll.cxx: In function `void* dlopen(const char*, int)':
udll.cxx:199: cannot convert `long unsigned int*' to `void**' for argument `2'
   to `int _dyld_func_lookup(const char*, void**)'
udll.cxx:201: warning: invalid conversion from `void*' to `__NSModule*'
udll.cxx: In function `void* dlsymIntern(void*, const char*)':
udll.cxx:236: cannot convert `__NSSymbol*' to `__NSSymbol**' in assignment udll.cxx:253: cannot convert `__NSSymbol*' to `__NSSymbol**' in assignment udll.cxx:259: warning: invalid conversion from `void*' to `__NSModule*' udll.cxx:259: cannot convert `__NSSymbol*' to `__NSSymbol**' in assignment udll.cxx:267: cannot convert `__NSSymbol**' to `__NSSymbol*' for argument `1'
   to `void* NSAddressOfSymbol(__NSSymbol*)'
udll.cxx: In function `int dlclose(void*)':
udll.cxx:283: warning: invalid conversion from `void*' to `__NSModule*' udll.cxx:285: warning: invalid conversion from `void*' to `__NSModule*'
udll.cxx: In function `void* dlsym(void*, const char*)':
udll.cxx:307: warning: invalid conversion from `void*' to `char*'
/sw/lib/gcc3.1/include/g++-v3/streambuf: At top level:
udll.cxx:271: warning: `const char* dlerror()' defined but not used
make[1]: *** [/sw/build/pwlib-1.5.2-12/pwlib/lib/obj_Darwin_ppc_r/ udll.o] Error 1
make: *** [opt] Error 2
### execution of make failed, exit code 2


This appears to be where pwlib tries to build its own dlopen/ dlclose/dlsym functions, instead of using the ones built in to OS 10.4. If I add this patch
as well, it gets past that error:

--- pwlib/src/ptlib/unix/udll.cxx.old   2005-06-22 10:35:45.000000000 -0400
+++ pwlib/src/ptlib/unix/udll.cxx       2005-06-22 10:35:11.000000000 -0400
@@ -80,7 +80,11 @@
 
 #include <ptlib.h>
 
-#ifdef P_MACOSX
+#if 1
+# include <dlfcn.h>
+#endif
+
+#if 0
 
 /*
 Copyright (c) 2002 Peter O'Gorman <[EMAIL PROTECTED]>

Almost fixed now, but I still get errors which I don't know how to fix:

g++3 -o obj_Darwin_ppc_r/asnparser -I/sw/include -fno-common - dynamic -fno-common -dynamic -L/sw/lib -lresolv -L../../lib ./ obj_Darwin_ppc_r/asn_grammar.o ./obj_Darwin_ppc_r/asn_lex.o ./ obj_Darwin_ppc_r/main.o -lpt_Darwin_ppc_r -lpthread -llber -lldap - lldap_r -lssl -lcrypto -lexpat -lSDL -framework AudioToolbox - framework CoreAudio
ld: warning multiple definitions of symbol _regcomp
../../lib/libpt_Darwin_ppc_r.dylib(regcomp.o) definition of _regcomp
/usr/lib/libpthread.dylib(regcomp.So) definition of _regcomp
ld: warning multiple definitions of symbol _regexec
../../lib/libpt_Darwin_ppc_r.dylib(regexec.o) definition of _regexec
/usr/lib/libpthread.dylib(regexec.So) definition of _regexec
ld: warning multiple definitions of symbol _regfree
../../lib/libpt_Darwin_ppc_r.dylib(regfree.o) definition of _regfree
/usr/lib/libpthread.dylib(regfree.So) definition of _regfree
ld: Undefined symbols:
__ZTv0_n12_NSiD0Ev
__ZTv0_n12_NSiD1Ev
__ZTv0_n12_NSoD0Ev
__ZTv0_n12_NSoD1Ev
make[1]: *** [obj_Darwin_ppc_r/asnparser] Error 1
make: *** [opt] Error 2
### execution of make failed, exit code 2


Firstly, does pwlib need to compile its own regex libraries? Could this be patched to use the system-distributed ones in the same way I patch it to use the system-distributed dlopen/dlsym/dlerror? [2 hours later, after another ten minutes of hacking] Here is a patch which does that, and it appears to
work properly:

--- src/ptlib/unix/Makefile.old 2005-06-22 23:58:34.000000000 -0400
+++ src/ptlib/unix/Makefile     2005-06-22 23:58:57.000000000 -0400
@@ -601,11 +601,13 @@
        $(COMMON_SRC_DIR)/contain.cxx \
        $(COMMON_SRC_DIR)/object.cxx   # must be last module
 
+ifneq ($(OSTYPE),Darwin)
 ifneq ($(OSTYPE),Carbon)
 ifneq ($(OSTYPE),linux)
 OBJS   = $(OBJDIR)/regcomp.o $(OBJDIR)/regexec.o $(OBJDIR)/regerror.o 
$(OBJDIR)/regfree.o
 endif
 endif
+endif
 
 CLEAN_FILES = $(GETDATE_SOURCE)
 

Secondly, there are those undefined symbols. Do you know what those symbols are? I've been able to demangle the symbols with c++filt, and here's what I
get:

virtual thunk to std::basic_istream<char, std::char_traits<char> >::~basic_istream()


I can't quite track down this problem. It appears that it might be related to
shared libraries and C++ templates, but it's hard to identify.

I'm still stuck on this problem, and I'm totally clue

Cheers,
Kyle Moffett

--
I lost interest in "blade servers" when I found they didn't throw knives at people who weren't supposed to be in your machine room.
  -- Anthony de Boer

Reply via email to