Bug #47058 failure to compile innodb_plugin on solaris 10u7 + spro cc/CC 5.10
Submitted: 2 Sep 2009 10:51 Modified: 20 Jun 2010 17:42
Reporter: Friedrich Haubensak Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: InnoDB Plugin storage engine Severity:S1 (Critical)
Version:5.1.38, 5.1 bzr, mysql-next-mr OS:Solaris (solaris 10u7 + spro cc/CC 5.10)
Assigned to: Satya B CPU Architecture:Any
Tags: Contribution

[2 Sep 2009 10:51] Friedrich Haubensak
Description:
( mysql-5.1.38 not yet visible on http://dev.mysql.com/downloads/mysql/5.1.html, but on the download mirror sites, so here we go... )

innodb_plugin fails for me to compile on solaris 10u7 using spro cc/CC 5.10

error message:
"include/page0page.ic", line 921: only identifiers with external linkage may have linker scoping: page_mem_alloc_free

the problem seems to be that page_mem_alloc_free is declared UNIV_INLINE in include/page0page.h, but UNIV_INTERN in include/page0page.ic

How to repeat:
uname -srvmp
  SunOS 5.10 Generic_141414-08 sun4u sparc
cc -V
  cc: Sun C 5.10 SunOS_sparc 2009/06/03
CC -V
  CC: Sun C++ 5.10 SunOS_sparc 2009/06/03

./configure \
  --enable-thread-safe-client \
  --enable-assembler \
  --enable-local-infile \
  --with-collation=latin1_german2_ci \
  --with-extra-charsets=complex \
  --with-unix-socket-path=/tmp/.mysql.sock \
  --with-mysqld-user=mysqld \
    CC=cc \
    CFLAGS="-xtarget=ultra2 -xarch=sparcvis -xO4 -xstrconst -mt" \
    LDFLAGS=-s \
    CXX=CC \
    CXXFLAGS="-xtarget=ultra2 -xarch=sparcvis -xO4 -noex -mt"

Suggested fix:
i'm unsure about this, but to me the following seems to be the solution:

--- storage/innodb_plugin/include/page0page.ic__dist  Fri Aug 21 14:12:39 2009
+++ storage/innodb_plugin/include/page0page.ic        Tue Sep  1 18:04:56 2009
@@ -907,7 +907,7 @@
 
 /************************************************************//**
 Allocates a block of memory from the free list of an index page. */
-UNIV_INTERN
+UNIV_INLINE
 void
 page_mem_alloc_free(
 /*================*/
[3 Sep 2009 7:47] Sveta Smirnova
Thank you for the report.

Verified using latest 5.1 bzr sources with error in page0zip.c:

...
        DEPDIR=.deps depmode=none /bin/bash ../../depcomp \
        /bin/bash ../../libtool --preserve-dup-deps --tag=CC --mode=compile cc -DHAVE_CONFIG_H -I. -I. -I../../include -I../../include -I../../include -I../../regex -I./include -I../../sql -I.     -DMYSQL_DYNAMIC_PLUGIN -O1    -DHAVE_RWLOCK_T -DUNIV_SOLARIS -DUNIV_SOLARIS -c -o ha_innodb_plugin_la-page0zip.lo `test -f 'page/page0zip.c' || echo './'`page/page0zip.c
 cc -DHAVE_CONFIG_H -I. -I. -I../../include -I../../include -I../../include -I../../regex -I./include -I../../sql -I. -DMYSQL_DYNAMIC_PLUGIN -O1 -DHAVE_RWLOCK_T -DUNIV_SOLARIS -DUNIV_SOLARIS -c page/page0zip.c  -KPIC -DPIC -o .libs/ha_innodb_plugin_la-page0zip.o
"page/page0zip.c", line 146: warning: implicit function declaration: compressBound
"page/page0zip.c", line 2889: undefined symbol: Z_BLOCK
"page/page0zip.c", line 2896: undefined symbol: Z_BLOCK
cc: acomp failed for page/page0zip.c
make[2]: *** [ha_innodb_plugin_la-page0zip.lo] Error 1
make[2]: Leaving directory `/users/ssmirnova/src/mysql-5.1/storage/innodb_plugin'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/users/ssmirnova/src/mysql-5.1/storage'
make: *** [all-recursive] Error 1

Problem is repeatable if compile without special options (just ./configure)
[12 Sep 2009 21:16] Sveta Smirnova
See also bug #47263
[14 Sep 2009 19:53] Sveta Smirnova
Bug #47263 was marked as duplicate of this one.
[15 Sep 2009 15:45] Liz Drachnik
In order for us to continue the process of reviewing your contribution to MySQL - We need
you to review and sign the Sun|MySQL contributor agreement (the "SCA")

The process is explained here: 
http://forge.mysql.com/wiki/Sun_Contributor_Agreement

Getting a signed/approved SCA on file will help us facilitate your contribution-- this
one, and others in the future.

Thank you !
[9 Oct 2009 15:18] Liz Drachnik
I am retracting the request for an SCA for the following reasons

 - The code in question actually belongs to Oracle (it's in the InnoDB
   sources)
 - It is a simple one-liner. Please fix and ask Oracle to apply it on
   their side as well. There is no IP involved and nothing
   to copyright

thank you
[9 Oct 2009 18:39] Valeriy Kravchuk
Bug #47950 was marked as a duplicate of this one.
[9 Oct 2009 18:55] Vladislav Vaintroub
The hardware/software is not hard to get to reproduce this bug. I have it on
latest OpenSolaris with latest Sun Studio Express virtualized (in Virtual Box). I'm wondering if there is a  need to reproduce, the function is in header file, so it was clearly meant to be inlined (static inline) rather than decorated with _hidden linker scope.
[4 Nov 2009 9:25] Bugs System
Pushed into 5.1.41 (revid:joro@sun.com-20091104092152-qz96bzlf2o1japwc) (version source revid:kristofer.pettersson@sun.com-20091103162305-08l4gkeuif2ozsoj) (merge vers: 5.1.41) (pib:13)
[11 Nov 2009 6:52] Bugs System
Pushed into 6.0.14-alpha (revid:alik@sun.com-20091110093407-rw5g8dys2baqkt67) (version source revid:alik@sun.com-20091109080109-7dxapd5y5pxlu08w) (merge vers: 6.0.14-alpha) (pib:13)
[11 Nov 2009 7:00] Bugs System
Pushed into 5.5.0-beta (revid:alik@sun.com-20091109115615-nuohp02h8mdrz8m2) (version source revid:svoj@sun.com-20091105122958-jyqjx9xus8v4e0yd) (merge vers: 5.5.0-beta) (pib:13)
[22 Nov 2009 0:34] Paul DuBois
Noted in 5.1.41, 5.5.0, 6.0.14 changelogs.

InnoDB Plugin did not compile on some Solaris systems.
[18 Dec 2009 10:39] Bugs System
Pushed into 5.1.41-ndb-7.1.0 (revid:jonas@mysql.com-20091218102229-64tk47xonu3dv6r6) (version source revid:jonas@mysql.com-20091218095730-26gwjidfsdw45dto) (merge vers: 5.1.41-ndb-7.1.0) (pib:15)
[18 Dec 2009 10:55] Bugs System
Pushed into 5.1.41-ndb-6.2.19 (revid:jonas@mysql.com-20091218100224-vtzr0fahhsuhjsmt) (version source revid:jonas@mysql.com-20091217101452-qwzyaig50w74xmye) (merge vers: 5.1.41-ndb-6.2.19) (pib:15)
[18 Dec 2009 11:10] Bugs System
Pushed into 5.1.41-ndb-6.3.31 (revid:jonas@mysql.com-20091218100616-75d9tek96o6ob6k0) (version source revid:jonas@mysql.com-20091217154335-290no45qdins5bwo) (merge vers: 5.1.41-ndb-6.3.31) (pib:15)
[18 Dec 2009 11:24] Bugs System
Pushed into 5.1.41-ndb-7.0.11 (revid:jonas@mysql.com-20091218101303-ga32mrnr15jsa606) (version source revid:jonas@mysql.com-20091218064304-ezreonykd9f4kelk) (merge vers: 5.1.41-ndb-7.0.11) (pib:15)
[5 May 2010 15:24] Bugs System
Pushed into 5.1.47 (revid:joro@sun.com-20100505145753-ivlt4hclbrjy8eye) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (merge vers: 5.1.46) (pib:16)
[6 May 2010 17:39] Paul DuBois
Push resulted from incorporation of InnoDB tree. No changes pertinent to this bug.
Re-closing.
[28 May 2010 6:14] Bugs System
Pushed into mysql-next-mr (revid:alik@sun.com-20100524190136-egaq7e8zgkwb9aqi) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (pib:16)
[28 May 2010 6:42] Bugs System
Pushed into 6.0.14-alpha (revid:alik@sun.com-20100524190941-nuudpx60if25wsvx) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (merge vers: 5.1.46) (pib:16)
[28 May 2010 7:10] Bugs System
Pushed into 5.5.5-m3 (revid:alik@sun.com-20100524185725-c8k5q7v60i5nix3t) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (merge vers: 5.1.46) (pib:16)
[30 May 2010 0:09] Paul DuBois
Push resulted from incorporation of InnoDB tree. No changes pertinent to this bug.
Re-closing.
[15 Jun 2010 8:22] Bugs System
Pushed into 5.5.5-m3 (revid:alik@sun.com-20100615080459-smuswd9ooeywcxuc) (version source revid:mmakela@bk-internal.mysql.com-20100415070122-1nxji8ym4mao13ao) (merge vers: 5.1.47) (pib:16)
[15 Jun 2010 8:39] Bugs System
Pushed into mysql-next-mr (revid:alik@sun.com-20100615080558-cw01bzdqr1bdmmec) (version source revid:mmakela@bk-internal.mysql.com-20100415070122-1nxji8ym4mao13ao) (pib:16)
[17 Jun 2010 12:21] Bugs System
Pushed into 5.1.47-ndb-7.0.16 (revid:martin.skold@mysql.com-20100617114014-bva0dy24yyd67697) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (merge vers: 5.1.46) (pib:16)
[17 Jun 2010 13:08] Bugs System
Pushed into 5.1.47-ndb-6.2.19 (revid:martin.skold@mysql.com-20100617115448-idrbic6gbki37h1c) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (merge vers: 5.1.46) (pib:16)
[17 Jun 2010 13:49] Bugs System
Pushed into 5.1.47-ndb-6.3.35 (revid:martin.skold@mysql.com-20100617114611-61aqbb52j752y116) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (merge vers: 5.1.46) (pib:16)