Bug #25061 Build failure on HP/UX similar to BUG#20507
Submitted: 14 Dec 2006 10:21 Modified: 3 Aug 2007 2:14
Reporter: Daniel Fischer Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Compiling Severity:S1 (Critical)
Version:5.0.32, 5.1.15 OS:HP/UX (HP/UX)
Assigned to: Damien Katz CPU Architecture:Any
Tags: cyassl

[14 Dec 2006 10:21] Daniel Fischer
Description:
Building fails on HP/UX with similar characteristics as mentioned in BUG#20507:

...
cc -g -DDBUG_ON -DSAFE_MUTEX +O2 -g +DAportable -DHPUX11 -DSNPRINTF_RETURN_TRUNC -DHAVE_BROKEN_PREAD -DDONT_USE_FINITE -DHAVE_BROKEN_GETPASS -DNO_FCNTL_NONBLOCK -DDO_NOT_REMOVE_THREAD_WRAPPERS -DHAVE_BROKEN_PTHREAD_COND_TIMEDWAIT -DHAVE_BROKEN_INLINE -o mysqlcheck mysqlcheck.o  ../libmysql/.libs/libmysqlclient.a -lpthread -lpthread -lpthread -lpthread -lpthread -lpthread -lpthread -lpthread /users/dfischer/20509/mysql-5.0.32-pb904/zlib/.libs/libz.a ../zlib/.libs/libz.a -lnsl -lm
/usr/ccs/bin/ld: Unsatisfied symbols:
   [Vtable]key:__dt__21__versioned_type_infoFv (first referenced in ../libmysql/.libs/libmysqlclient.a(ssl.o)) (data)
   __PureVirtualCalled (first referenced in ../libmysql/.libs/libmysqlclient.a(ssl.o)) (code)
   __nw__FUl (first referenced in ../libmysql/.libs/libmysqlclient.a(cert_wrapper.o)) (code)
   __dl__FPv (first referenced in ../libmysql/.libs/libmysqlclient.a(ssl.o)) (code)
*** Error exit code 1

Stop.

How to repeat:
Build the server on HP/UX with yassl.

Configure command used:
./configure --prefix=/usr/local/mysql --localstatedir=/usr/local/mysql/data --libexecdir=/usr/local/mysql/bin "--with-comment=MySQL Pushbuild Edition, build 904" --with-extra-charsets=complex --enable-thread-safe-client --enable-local-infile --with-zlib-dir=bundled --with-big-tables --with-readline --with-archive-storage-engine --with-debug --with-big-tables --with-innodb --with-berkeley-db --with-example-storage-engine --with-blackhole-storage-engine --with-ndbcluster --with-federated-storage-engine --with-csv-storage-engine --with-yassl --disable-shared
[28 Jun 2007 11:06] Magnus Blåudd
Proper fix is to link with -lCsup for our clients. This is easily done by changing to  --with-client-ldflags="-static -lCsup" on the affected hosts.

This shows mysqlcheck first linked with cc and -lCsup, the second when linked with aCC.

mysqldev@hp3750:/home/mysqldev/magnus/mysql-5.0.46-pb568/client> ldd mysqlcheck
        /usr/lib/libc.2 =>      /usr/lib/libc.2
        /usr/lib/libdld.2 =>    /usr/lib/libdld.2
        /usr/lib/libc.2 =>      /usr/lib/libc.2
        /usr/lib/libCsup.2 =>   /usr/lib/libCsup.2
        /usr/lib/libm.2 =>      /usr/lib/libm.2
        /usr/lib/libnsl.1 =>    /usr/lib/libnsl.1
        /usr/lib/libxti.2 =>    /usr/lib/libxti.2
        /usr/lib/libpthread.1 =>        /usr/lib/libpthread.1

mysqldev@hp3750:/home/mysqldev/magnus/mysql-5.0.46-pb568/client> aCC -g -DDBUG_ON -DSAFE_MUTEX +DAportable -DHPUX11 -DSNPRINTF_RETURN_TRUNC -DHAVE_BROKEN_PREAD -DDONT_USE_FINITE -DHAVE_BROKEN_GETPASS -DNO_FCNTL_NONBLOCK -DDO_NOT_REMOVE_THREAD_WRAPPERS -DHAVE_BROKEN_PTHREAD_COND_TIMEDWAIT -DHAVE_BROKEN_INLINE -o mysqlcheck mysqlcheck.o  ../libmysql/.libs/libmysqlclient.a -lpthread -lpthread -lpthread -lpthread -lpthread -lpthread -lpthread -lpthread ../zlib/.libs/libzlt.a -lnsl -lm -lCsup
mysqldev@hp3750:/home/mysqldev/magnus/mysql-5.0.46-pb568/client> ldd mysqlcheck
        /usr/lib/libdld.2 =>    /usr/lib/libdld.2
        /usr/lib/libc.2 =>      /usr/lib/libc.2
        /usr/lib/libdld.2 =>    /usr/lib/libdld.2
        /usr/lib/libc.2 =>      /usr/lib/libc.2
        /usr/lib/libcl.2 =>     /usr/lib/libcl.2
        /usr/lib/libisamstub.1 =>       /usr/lib/libisamstub.1
        /usr/lib/libdld.2 =>    /usr/lib/libdld.2
        /usr/lib/libstream.2 => /usr/lib/libstream.2
        /usr/lib/libstd.2 =>    /usr/lib/libstd.2
        /usr/lib/libCsup.2 =>   /usr/lib/libCsup.2
        /usr/lib/libm.2 =>      /usr/lib/libm.2
        /usr/lib/libnsl.1 =>    /usr/lib/libnsl.1
        /usr/lib/libxti.2 =>    /usr/lib/libxti.2
        /usr/lib/libpthread.1 =>        /usr/lib/libpthread.1
[28 Jun 2007 13:29] Magnus Blåudd
The functions __nw__FUl  and __dl__FPv are operator new and operator delete and can thus be implemented like this.

===== yassl_int.cpp 1.24 vs edited =====
40a41,54
>     void* operator new(size_t sz)
>     {
>     void* ptr = malloc(sz ? sz : 1);
>     if (!ptr) abort();
> 
>     return ptr;
>     }
> 
>     void operator delete(void* ptr)
>     {
>     if (ptr) free(ptr);
>     }
> 
>
[28 Jun 2007 13:40] Magnus Blåudd
_PureVirtualCalled should be straigtforward to implement in extra/yassl/include/runtime.hpp

#ifdef __hpux

#include <assert.h>

extern "C" {

void __PureVirtualCalled(void)
{
   assert("Pure virtual method called." == "Aborted");
}

} // extern "C"

#endif
[26 Jul 2007 0:52] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/31586

ChangeSet@1.2481, 2007-07-25 20:52:09-04:00, dkatz@damien-katzs-computer.local +1 -0
  Bug #25061 Build failure on HP/UX similar to BUG#20507
  
  Added libCsup as a mysql library dependency on hpux11.
[26 Jul 2007 1:51] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/31589

ChangeSet@1.2481, 2007-07-25 21:50:39-04:00, dkatz@damien-katzs-computer.local +1 -0
  Bug #25061 Build failure on HP/UX similar to BUG#20507
  
  Added libCsup as a mysql library dependency on hpux11.
  
  This means any projects statically linking to our libraries using the HPUX11 compiler will need to add the -lCSup option to their build link options. If they use the mysql_config tool this will happen automatically.
  
  Projects that dynamically link to libmysqlclient will continue to work without any modifications.
  
  Library libCsup is a C++ runtime library needed for yassl support when built with the hpux11 C/C++ compiler. The first attempts to fix this bug were to remove the yassl dependencies on libCsup. We tried removing all pure virtual functions and other hacks, but the dependency remained. The only other options left involve extensive restructuring of the yassl library.
[27 Jul 2007 3:40] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/31670

ChangeSet@1.2481, 2007-07-26 23:39:53-04:00, dkatz@damien-katzs-computer.local +1 -0
  Bug #25061 Build failure on HP/UX similar to BUG#20507
  
  Added libCsup as a mysql library dependency on hpux11.
  
  This means any projects statically linking to our libraries using the HPUX11 compiler will need to add the -lCSup option to their build link options. If they use the mysql_config tool this will happen automatically.
  
  Projects that dynamically link to libmysqlclient will continue to work without any modifications.
  
  Library libCsup is a C++ runtime library needed for yassl support when built with the hpux11 C/C++ compiler. The first attempts to fix this bug were to remove the yassl dependencies on libCsup. We tried removing all pure virtual functions and other hacks, but the dependency remained. The only other options left involve extensive restructuring of the yassl library.
[2 Aug 2007 19:13] Bugs System
Pushed into 5.1.21-beta
[3 Aug 2007 2:14] Paul DuBois
No changelog entry needed.