Bug #38891 falcon is not supported on sparc
Submitted: 19 Aug 2008 12:04 Modified: 1 Oct 2008 12:49
Reporter: Daniel Fischer Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Falcon storage engine Severity:S1 (Critical)
Version:6.0 OS:Solaris (10 sparc)
Assigned to: Olav Sandstå CPU Architecture:Any
Tags: Sun Studio

[19 Aug 2008 12:04] Daniel Fischer
Description:
On Solaris 10 sparc, in an attempted sparc64 build of 6.0 with Sun Studio 12:

checking if Falcon Storage Engine is supported on sparc... no

How to repeat:
export CFLAGS="-g -O2 -Xa -xstrconst -mt -D_FORTEC_ -m64"
export CXXFLAGS="-g -O2 -mt -D_FORTEC_ -m64"
export ASFLAGS="-g -m64"
export LDFLAGS="-g -m64"
./configure --enable-thread-safe-client --enable-local-infile --with-pic --with-client-ldflags=-static --with-mysqld-ldflags=-static --with-zlib-dir=bundled --without-ndb-debug --with-big-tables --with-ssl --with-readline --with-embedded-server --with-archive-storage-engine --with-blackhole-storage-engine --with-csv-storage-engine --with-example-storage-engine --with-federated-storage-engine --with-partition --with-extra-charsets=all --with-innodb --with-ndbcluster --with-libevent --with-falcon
[19 Aug 2008 12:40] Olav Sandstå
The reason for configure to not include Falcon here is due to a bug in the Sun Studio compiler, see bug id CR 6725490. The bug only occurs when compiling with optimization.

Short term solution/workaround to get Falcon to compile is to remove -O2 from the compile options.

Long term solution: fix the check done by configure to no longer use gcc style assembly code when running with Sun Studio compiler.
[19 Aug 2008 12:41] Olav Sandstå
Verified as described.
[20 Aug 2008 11:53] Daniel Fischer
Also reproduced (involuntarily...) with gcc 4.0.4:

+ uname -a
SunOS techra22 5.10 Generic_118833-17 sun4u sparc SUNW,Sun-Fire-V210
+ CFLAGS=-g
+ CXXFLAGS=-g
+ ASFLAGS=-g
+ LDFLAGS=-g
+ export CFLAGS
+ export CXXFLAGS
+ export ASFLAGS
+ export LDFLAGS
+ ./configure --enable-thread-safe-client --enable-local-infile --with-pic --with-client-ldflags=-static --with-mysqld-ldflags=-static --with-zlib-dir=bundled --with-big-tables --with-ssl --with-readline --with-extra-charsets=all --with-debug --with-plugins=falcon,maria,innobase,partition --with-libevent

...

checking if Falcon Storage Engine is supported on sparc... no
[20 Aug 2008 12:20] Olav Sandstå
I have not had any problems with getting configure to add support for Falcon using gcc on Solaris on SPARC. But I normally use the gcc version that is part of Open Solaris's SFW (Sun Freeware). This is currently gcc 3.4.3.

Anyway, this is likely a different problem than the one you had using Sun Studio compiler since that was caused by an internal error in the Sun Studio compiler.

I will try to reproduce it using the configure command you are using to see if that changes anything.
[20 Aug 2008 12:24] Philip Stoev
Olav, we have decided to use gcc 4.x for Falcon because previous versions cause phantom bugs, crashes and deadlocks.

The GCC on techra22, for which Danny is reporting those bugs , is version 4.0.2
[20 Aug 2008 12:30] Daniel Fischer
Olav, I'm sorry, the problem is visible with gcc because it wants to use /usr/ccs/bin/as. This as fails the falcon test due to the v8plus instructions used in it. GCC has several ways of passing arguments on to the assembler; I am currently trying to find one where it doesn't *also* pass them on to the linker, so I can pass -xarch=v8plus.
[20 Aug 2008 12:34] Olav Sandstå
Daniel, thanks for the update. I have no idea if this can be of any help but these are to the configure commands that I use when configuring for gcc 3.4.3 on 32 bit and 64 bit SPARC:

32-bit:

./configure CFLAGS="-m32 -mv8plus -mcpu=v9" CXXFLAGS="-m32 -mv8plus -mcpu=v9" --with-plugins=myisam,falcon,innobase --with-debug --enable-dtrace

64-bit:

./configure CFLAGS="-m64" CXXFLAGS="-m64" --with-plugins=myisam,falcon,innobase --with-debug --enable-dtrace

These are probably not correct or sufficient but I am able to compile and run mysql using these.
[20 Aug 2008 12:38] Daniel Fischer
-Wa,-xarch=v8plus appears to work too.
[20 Aug 2008 13:27] 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/52051

2791 Olav Sandstaa	2008-08-20
      Fix for Bug #38891 Falcon is not supported when using Sun Studio and compiling with optizer on SPARC
      
      When using the Sun Studio compiler on SPARC, configure will check for the support of 
      the atomic_* operations on Solaris instead of trying to compile the gcc style assembly code
      in order to determine if Falcon is supported or not.
[28 Aug 2008 4:31] Bugs System
Pushed into 6.0.7-alpha  (revid:olav@sun.com-20080820132729-a7c92oqheuqerrjv) (version source revid:vvaintroub@mysql.com-20080827094944-sh582y3m7duhzrpj) (pib:3)
[13 Sep 2008 22:58] Bugs System
Pushed into 6.0.7-alpha  (revid:olav@sun.com-20080820132729-a7c92oqheuqerrjv) (version source revid:davi.arnaut@sun.com-20080812141852-8e6knbqclpfd8irn) (pib:3)
[1 Oct 2008 12:49] Jon Stephens
Documented in the 6.0.7 changelog as follows:

        It was not possible to build the server with Falcon support on SPARC
        when using the Sun Studio compiler.