Bug #55061 Build failing on sol 8 x86 - assembler code vs compiler problem
Submitted: 7 Jul 2010 18:20 Modified: 20 Nov 2010 18:11
Reporter: Karen Langford Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Compiling Severity:S2 (Serious)
Version:5.1.49 OS:Solaris (sol 8 x86)
Assigned to: Alexey Kopytov
Tags: assembler code, gnu, Solaris 8 x86, Sun C
Triage: Triaged: D1 (Critical)

[7 Jul 2010 18:20] Karen Langford
Description:
Seeing the following build error on Solaris 8 x86 only:

/opt/studio11/SUNWspro/bin/CC -DMYSQL_SERVER -DDEFAULT_MYSQL_HOME="\"/opt/mysql/mysql\"" -DMYSQL_DATADIR="\"/opt/mysql/mysql/data\"" -DSHAREDIR="\"/opt/mysql/mysql/share\"" -DPLUGINDIR="\"/opt/mysql/mysql/lib/plugin\"" -DHAVE_EVENT_SCHEDULER -DHAVE_CONFIG_H -I. -I../include -I../zlib -I../include -I../include -I../regex -I.     -xO3 -mt -fsimple=1 -ftrap=%none -nofstore -xbuiltin=%all -features=no%except -xlibmil -xlibmopt -xtarget=generic   -D_FILE_OFFSET_BITS=64 -DHAVE_CURSES_H -I/export/home/my/tmp-201007051623-5.1.49-15578/solaris8-x86-pkgadd/mysql-5.1.49/include -DHAVE_RWLOCK_T -c -o mysqld.o mysqld.cc
"mysqld.cc", line 236: Error: "(" expected instead of "volatile".
"mysqld.cc", line 236: Error: No string in Asm statement.
"mysqld.cc", line 236: Error: No direct declarator preceding "(".
"mysqld.cc", line 238: Error: "(" expected instead of "volatile".
"mysqld.cc", line 238: Error: No string in Asm statement.
"mysqld.cc", line 238: Error: No direct declarator preceding "(".
6 Error(s) detected.
make-3.78.1[3]: *** [mysqld.o] Error 6

How to repeat:
Build 5.1.49 on Sol 8 x86

Suggested fix:
Joerg looked into this and basically, there is some assembler code defined as the body of two macros _FPU_GETCW and _FPU_SETW in mysqld.cc, and that assembler code is for x86 only.
The previous version had it only for GNU C, and the current one has it also for Sun C. Joerg suspects this is a case of "Sun C will not accept this assembler code".
FYI The latest change to this file is revision 3433, done by Alexey Kopytov.
[7 Jul 2010 18:35] Joerg Bruehe
No chance to build 5.1.49 on Solaris/x86 until this is fixed
(or the change that caused it is reverted).
[12 Jul 2010 15:01] 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/113368

3477 Alexey Kopytov	2010-07-12
      Bug#55061: Build failing on sol 8 x86 - assembler code vs 
                 compiler problem
      
      GCC-style inline assembly is not supported by the Sun Studio
      compilers prior to version 12.
      
      Added a check for the Sun Studio version to avoid using 
      _FPU_GETCW() / _FPU_SETCW() when inline assembly is
       unsupported. This can lead to some differences in floating
      point calculations on Solaris 8/x86 which, however, is not worth
      bothering with Sun-style assembly .il templates.
[20 Jul 2010 19:20] Joerg Bruehe
The patch was used in the build of 5.1.49, and building succeeded.

I checked all test failures of Solaris 8 (x86) and found none that looked libe being caused by this patch.

The patch is approved.
[23 Jul 2010 11:02] MC Brown
A note has been added to the 5.1.50 and 5.5.6 changelogs: 

 Building MySQL on Solaris 8 x86 would fail when using Sun Studio due to gcc inline assembler code.
[4 Aug 2010 7:53] Bugs System
Pushed into mysql-trunk 5.5.6-m3 (revid:alik@sun.com-20100731131027-1n61gseejyxsqk5d) (version source revid:alik@sun.com-20100731074942-o840woifuqioxxe4) (merge vers: 5.5.6-m3) (pib:18)
[4 Aug 2010 8:08] Bugs System
Pushed into mysql-trunk 5.6.1-m4 (revid:alik@ibmvm-20100804080001-bny5271e65xo34ig) (version source revid:alik@sun.com-20100731075120-qz9z8c25zum2wgmm) (merge vers: 5.6.99-m4) (pib:18)
[4 Aug 2010 8:24] Bugs System
Pushed into mysql-trunk 5.6.1-m4 (revid:alik@ibmvm-20100804081533-c1d3rbipo9e8rt1s) (version source revid:alik@sun.com-20100731075120-qz9z8c25zum2wgmm) (merge vers: 5.6.99-m4) (pib:18)
[4 Aug 2010 9:04] Bugs System
Pushed into mysql-next-mr (revid:alik@ibmvm-20100804081630-ntapn8bf9pko9vj3) (version source revid:alik@sun.com-20100731075120-qz9z8c25zum2wgmm) (pib:20)
[4 Aug 2010 16:47] Paul Dubois
Not present in any released 5.6.x version.
[19 Aug 2010 15:42] Bugs System
Pushed into mysql-5.1 5.1.51 (revid:build@mysql.com-20100819151858-muaaor6jojb5ouzj) (version source revid:build@mysql.com-20100819151858-muaaor6jojb5ouzj) (merge vers: 5.1.51) (pib:20)
[7 Oct 2010 20:01] Bugs System
Pushed into mysql-5.1 5.1.53 (revid:sunanda.menon@sun.com-20101007194409-vrqmi1f7iched4zr) (version source revid:sunanda.menon@sun.com-20101007194409-vrqmi1f7iched4zr) (merge vers: 5.1.53) (pib:21)
[7 Oct 2010 22:45] Paul Dubois
Noted in 5.1.49sp1 changelog.
[14 Oct 2010 8:35] Bugs System
Pushed into mysql-5.1-telco-7.0 5.1.51-ndb-7.0.20 (revid:martin.skold@mysql.com-20101014082627-jrmy9xbfbtrebw3c) (version source revid:martin.skold@mysql.com-20101014082627-jrmy9xbfbtrebw3c) (merge vers: 5.1.51-ndb-7.0.20) (pib:21)
[14 Oct 2010 8:50] Bugs System
Pushed into mysql-5.1-telco-6.3 5.1.51-ndb-6.3.39 (revid:martin.skold@mysql.com-20101014083757-5qo48b86d69zjvzj) (version source revid:martin.skold@mysql.com-20101014083757-5qo48b86d69zjvzj) (merge vers: 5.1.51-ndb-6.3.39) (pib:21)
[14 Oct 2010 9:06] Bugs System
Pushed into mysql-5.1-telco-6.2 5.1.51-ndb-6.2.19 (revid:martin.skold@mysql.com-20101014084420-y54ecj85j5we27oa) (version source revid:martin.skold@mysql.com-20101014084420-y54ecj85j5we27oa) (merge vers: 5.1.51-ndb-6.2.19) (pib:21)
[15 Oct 2010 13:42] Jon Stephens
Already documented in the 5.1.50 changelog. Reverting to Closed state.
[13 Nov 2010 16:14] Bugs System
Pushed into mysql-trunk 5.6.99-m5 (revid:alexander.nozdrin@oracle.com-20101113155825-czmva9kg4n31anmu) (version source revid:alexander.nozdrin@oracle.com-20101113152450-2zzcm50e7i4j35v7) (merge vers: 5.6.1-m4) (pib:21)
[13 Nov 2010 16:38] Bugs System
Pushed into mysql-next-mr (revid:alexander.nozdrin@oracle.com-20101113160336-atmtmfb3mzm4pz4i) (version source revid:alexander.nozdrin@oracle.com-20101113152540-gxro4g0v29l27f5x) (pib:21)
[16 Dec 2010 22:32] Bugs System
Pushed into mysql-5.5 5.5.9 (revid:jonathan.perkin@oracle.com-20101216101358-fyzr1epq95a3yett) (version source revid:jonathan.perkin@oracle.com-20101216101358-fyzr1epq95a3yett) (merge vers: 5.5.9) (pib:24)