Bug #47263 innodb plugin 1.0.4 does not compile with SunStudio Compiler
Submitted: 10 Sep 2009 23:03 Modified: 14 Sep 2009 19:52
Reporter: Kelly Long Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: InnoDB Plugin storage engine Severity:S2 (Serious)
Version:mysql-trunk aka 5.4.3 OS:Solaris
Assigned to: CPU Architecture:Any
Tags: Contribution, InnoDB plugin, SunStudio

[10 Sep 2009 23:03] Kelly Long
Description:
Xeon (Tucani) snv_106 X86 with SunStudio compiler: Sun Ceres C++ 5.10 SunOS_i386 2009/03/06

cc -DHAVE_CONFIG_H -I. -I../../include -I../../include -I../../include -I../../regex -I./include -I../../sql -I. -I../../zlib    -xstrconst  -m64 -mt -fsimple=1 -ftrap=%none -xbuiltin=%all -xlibmil -xlibmopt -xtarget=generic -nofstore -xO2   -DHAVE_RWLOCK_T -DUNIV_SOLARIS -c -o libinnobase_a-btr0sea.o `test -f 'btr/btr0sea.c' || echo './'`btr/btr0sea.c
"include/page0page.ic", line 921: only identifiers with external linkage may have linker scoping: page_mem_alloc_free
"include/page0page.ic", line 921: only identifiers with external linkage may have linker scoping: page_mem_alloc_free
"include/page0page.ic", line 921: only identifiers with external linkage may have linker scoping: page_mem_alloc_free
"include/page0page.ic", line 921: only identifiers with external linkage may have linker scoping: page_mem_alloc_free
cc: acomp failed for btr/btr0pcur.c
gmake[2]: *** [libinnobase_a-btr0pcur.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
cc: acomp failed for btr/btr0sea.c
gmake[2]: *** [libinnobase_a-btr0sea.o] Error 1
cc: acomp failed for btr/btr0btr.c
gmake[2]: *** [libinnobase_a-btr0btr.o] Error 1
cc: acomp failed for btr/btr0cur.c
gmake[2]: *** [libinnobase_a-btr0cur.o] Error 1
gmake[2]: Leaving directory `/home1/vcarbone/srv-purge-thread-builds/mysql-5.4.3-beta-Bld69c/storage/innobase'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory `/home1/vcarbone/srv-purge-thread-builds/mysql-5.4.3-beta-Bld69c/storage'
gmake: *** [all-recursive] Error 1 

How to repeat:
compile using Sun compiler

Suggested fix:
=== modified file 'storage/innobase/include/page0page.ic'
--- storage/innobase/include/page0page.ic	2009-05-27 09:45:59 +0000
+++ storage/innobase/include/page0page.ic	2009-09-10 21:19:40 +0000
@@ -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(
 /*================*/
[11 Sep 2009 5:33] Sveta Smirnova
Thank you for the feedback.

This looks like bug #46538 although error is different. Please provide configure options, so we can compare.
[11 Sep 2009 14:20] Kelly Long
The configure options should not matter but here is what I used:

./configure --prefix=/tmp/mysql-beta --libexecdir=/tmp/mysql-beta/bin --with-zlib-dir=bundled --localstatedir=/tmp/mysql-beta/data --enable-local-infile --enable-thread-safe-client --with-big-tables --with-extra-charsets=complex --with-ssl --with-pic --with-csv-storage-engine --with-archive-storage-engine --with-blackhole-storage-engine --without-example-storage-engine --with-federated-storage-engine --with-partition --with-innodb --with-comment=MySQL Pro GPL version built from source --with-readline --with-mysqld-ldflags=-static --with-client-ldflags=-static --with-mysqld-libs=-lmtmalloc --with-named-curses=-lcurses 

FYI: I don't think this looks similar to the bug you referenced for 3 reasons:
1) the bug you referenced uses the gnu tools.  This bug ONLY occurs with sun studio compiler tools.
2) the bug you referenced is realted to __divdi3.  This bug deals with how UNIV_INTERN affects function scoping for the sun studio compiler.
3) the bug you referenced occurs during the link stage.  This bug occurs during the compile stage.
[12 Sep 2009 21:15] Sveta Smirnova
Thank you for the feedback.

There is similar bug #47058, but you report error in storage/innobase which is "regular" InnoDB while bug #47058 is really about InnoDB Plugin.

I can not repeat problem with "regular" InnoDB with  Sun C 5.9 (Sun Studio 12). Please send us link where you downloaded Sun C 5.10
[14 Sep 2009 13:55] Kelly Long
Yes this is a duplicate of bug #47058.  Sorry I didn't find it in my search before reporting the bug.

The path/filename appears to be the old innodb as I'm using a bzr tree where the innodb plugin has replaced the older innodb.

In case you still want the Sun Studio which I used:

http://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_SMI-Site/en_US/-/USD/VerifyItem-S...
[14 Sep 2009 19:52] Sveta Smirnova
Thank you for the feedback and link.

Bug is closed as duplicate of bug #47058.