Bug #47058 failure to compile innodb_plugin on solaris 10u7 + spro cc/CC 5.10
Submitted: 2 Sep 12:51 Modified: 22 Nov 1:34
Reporter: Friedrich Haubensak
Status: Closed
Category:Server: InnoDB Plugin Severity:S1 (Critical)
Version:5.1.38, 5.1 bzr, mysql-next-mr OS:Sun Solaris (solaris 10u7 + spro cc/CC 5.10)
Assigned to: Satya B Target Version:5.1+
Tags: Contribution
Triage: Triaged: D3 (Medium)

[2 Sep 12: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 9: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 23:16] Sveta Smirnova
See also bug #47263
[14 Sep 21:53] Sveta Smirnova
Bug #47263 was marked as duplicate of this one.
[15 Sep 17: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 17: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 20:39] Valeriy Kravchuk
Bug #47950 was marked as a duplicate of this one.
[9 Oct 20: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 10: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 7: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 8: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 1:34] Paul DuBois
Noted in 5.1.41, 5.5.0, 6.0.14 changelogs.

InnoDB Plugin did not compile on some Solaris systems.