Bug #51878 Build break in HPUX involving mysql_prlock on a client
Submitted: 9 Mar 2010 17:16 Modified: 10 Mar 2010 18:46
Reporter: Marc ALFF Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Compiling Severity:S1 (Critical)
Version:mysql-next-mr-bugfixing OS:HP/UX
Assigned to: Marc ALFF CPU Architecture:Any

[9 Mar 2010 17:16] Marc ALFF
Description:
In mysql-next-mr-bugfixing, there are build failures on HPUX,
related to mysql_prlock_*

This is most likely related to DISABLE_MYSQL_THREAD_H,
which is work around for broken compilers like HP.
DISABLE_MYSQL_THREAD_H is used in libmysql, but not in libmysql_r

/bin/sh ../libtool --preserve-dup-deps --tag=CC   --mode=link cc  -g  -DSAFE_MUTEX -g +O0 +DD64 +DSitanium2 -mt -AC99   -DHPUX11  -DSNPRINTF_RETURN_TRUNC -DHAVE_BROKEN_PREAD -DHAVE_BROKEN_GETPASS -DNO_FCNTL_NONBLOCK -DDO_NOT_REMOVE_THREAD_WRAPPERS -DHAVE_BROKEN_PTHREAD_COND_TIMEDWAIT -DHAVE_BROKEN_INLINE -DUNIV_MUST_NOT_INLINE -DUNIV_HPUX  -g +DD64  -o bug25714 bug25714.o -static ../libmysql_r/libmysqlclient_r.la -lm   ../zlib/libzlt.la 
libtool: link: cc -g -DSAFE_MUTEX -g +O0 +DD64 +DSitanium2 -mt -AC99 -DHPUX11 -DSNPRINTF_RETURN_TRUNC -DHAVE_BROKEN_PREAD -DHAVE_BROKEN_GETPASS -DNO_FCNTL_NONBLOCK -DDO_NOT_REMOVE_THREAD_WRAPPERS -DHAVE_BROKEN_PTHREAD_COND_TIMEDWAIT -DHAVE_BROKEN_INLINE -DUNIV_MUST_NOT_INLINE -DUNIV_HPUX -g +DD64 -o bug25714 bug25714.o  ../libmysql_r/.libs/libmysqlclient_r.a -lpthread -lpthread -lpthread -lpthread -lpthread -lpthread -lpthread -lpthread ../zlib/.libs/libzlt.a -lm -mt
gmake[1]: *** [insert_test] Error 1
gmake[1]: *** Waiting for unfinished jobs....
gmake[1]: *** [select_test] Error 1
ld: Unsatisfied symbol "my_rw_destroy" in file ../libmysql_r/.libs/libmysqlclient_r.a[libmysql.o]
ld: Unsatisfied symbol "my_rw_tryrdlock" in file ../libmysql_r/.libs/libmysqlclient_r.a[libmysql.o]
ld: Unsatisfied symbol "my_rw_wrlock" in file ../libmysql_r/.libs/libmysqlclient_r.a[libmysql.o]
ld: Unsatisfied symbol "my_rw_unlock" in file ../libmysql_r/.libs/libmysqlclient_r.a[libmysql.o]
ld: Unsatisfied symbol "my_rw_trywrlock" in file ../libmysql_r/.libs/libmysqlclient_r.a[libmysql.o]
ld: Unsatisfied symbol "my_rw_rdlock" in file ../libmysql_r/.libs/libmysqlclient_r.a[libmysql.o]
ld: Unsatisfied symbol "rw_pr_init" in file ../libmysql_r/.libs/libmysqlclient_r.a[libmysql.o]
7 errors.
gmake[1]: *** [bug25714] Error 1
gmake[1]: Leaving directory `/export/tmp/pb2/build/sb_0-1524908-1267987253.99/mysql-5.6.99-m4/tests'
gmake: *** [all-recursive] Error 1
+ echo '[SOURCEBUILDER] FAIL see log'
[SOURCEBUILDER] FAIL see log

How to repeat:
See PB2

Suggested fix:
Add -DDISABLE_MYSQL_THREAD_H in the Makefiles in libmysql_r
[9 Mar 2010 18:06] 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/102770

3121 Marc Alff	2010-03-09
      Bug#51878 Build break in HPUX involving mysql_prlock on a client
      
      This is a fix specific for HPUX,
      for which the compiler does not resolve properly dependencies
      involving unused inline functions.
      (See existing comments in mysql_thread.h)
      
      In include/mysql/psi/mysql_thread.h,
      the instrumentation helpers for mysql_prlock_*
      uses the pr lock apis.
      
      These apis are implemented in mysys/thr_rwlock.c,
      which is not linked to client code.
      
      As a result, the code does not link in libmysql_r, on HPUX.
      
      The fix is to cut dependencies explicitely,
      by introducing -DDISABLE_MYSQL_RWLOCK_H,
      when building client code.
[9 Mar 2010 18:20] Marc ALFF
Pushed into mysql-next-mr-bugfixing.

Merge to mysql-6.0-codebase-bugfixing pending HPUX build results
[9 Mar 2010 22:09] Marc ALFF
Merged into mysql-6.0-codebase-bugfixing
[10 Mar 2010 13:38] Bugs System
Pushed into 6.0.14-alpha (revid:alik@sun.com-20100310133305-0jdlngbtrkoqzckh) (version source revid:alik@sun.com-20100310132404-uqarl0o0vlra2kjx) (merge vers: 6.0.14-alpha) (pib:16)
[10 Mar 2010 13:38] Bugs System
Pushed into 5.5.3-m3 (revid:alik@sun.com-20100310132634-zpyjzn346sgrm59u) (version source revid:alik@sun.com-20100310132634-zpyjzn346sgrm59u) (merge vers: 5.5.3-m3) (pib:16)
[10 Mar 2010 13:39] Bugs System
Pushed into mysql-next-mr (revid:alik@sun.com-20100310132718-l0tegumhbg8umgjd) (version source revid:alik@sun.com-20100310132252-kpi29r22kjtl493x) (pib:16)
[10 Mar 2010 15:07] Marc ALFF
Doc team:
- fix merged in 5.5.3 and 6.0
- first P_S release, nothing to document
[10 Mar 2010 18:46] Paul DuBois
Not in any release version. No changelog entry needed.