os_atomic_increment undeclared error compiling 5.1.43 with gcc on Solaris 10

Bug #526772 reported by gsyoungblood on 2010-02-24
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona patches
Fix Released

Bug Description

It appears there's a problem with the patch when applied to 5.1.43 and compiled under Solaris 10 using gcc.

Initially I was trying to get it to compile using Sun Studio but that didn't go too well, so I switched to gcc. I am getting closer, but still do not have a build under Solaris 10 that works.

What I'm finding is that os_atomic_increment is not defined when HAVE_IB_SOLARIS_ATOMICS is set. It appears to be more likely an oversight in os0sync.h starting around line 315. It is defined in the previous block using the GCC builtins, but not Solaris and Windows.

If I were to hazard a guess, I'd think the generic os_atomic_increment was not supposed to be used in the main code, just os_atomic_increment_lint or os_atomic_increment_ulint, which are defined in the Solaris and Windows blocks.

Actual Error:
/usr/sfw/bin/gcc -DHAVE_CONFIG_H -I. -I../../include -I../../include -I../../include -I../../regex -I../../storage/innobase/include -I../../sql -I. -m32 -I/opt/zz/include -I /usr/sfw/include -I/usr/sfw/include/openssl -fno-implicit-templates -fno-exceptions -fno-rtti -DHAVE_RWLOCK_T -MT libinnobase_a-i_s.o -MD -MP -MF .deps/libinnobase_a-i_s.Tpo -c -o libinnobase_a-i_s.o `test -f 'handler/i_s.cc' || echo './'`handler/i_s.cc
In file included from ../../storage/innobase/include/sync0rw.h:565,
                 from ../../storage/innobase/include/fil0fil.h:13,
                 from ../../storage/innobase/include/buf0buf.h:27,
                 from handler/i_s.cc:39:
../../storage/innobase/include/sync0rw.ic: In function `lint rw_lock_lock_word_incr(rw_lock_t*, ulint)':
../../storage/innobase/include/sync0rw.ic:242: error: `os_atomic_increment' undeclared (first use this function)
../../storage/innobase/include/sync0rw.ic:242: error: (Each undeclared identifier is reported only once for each function it appears in.)
gmake[2]: *** [libinnobase_a-i_s.o] Error 1
gmake[2]: Leaving directory `/home/gyoungbl/mysql-percona/mysql-5.1.43-percona/storage/innobase'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory `/home/gyoungbl/mysql-percona/mysql-5.1.43-percona/storage'
gmake: *** [all-recursive] Error 1

gsyoungblood (greg-tcscs) wrote :

My guess on the error was slightly incorrect.

The real problem appears to be in storage/innobase/include/sync0rw.ic at line 242.

        return(os_atomic_increment(&(lock->lock_word), amount));
       return(os_atomic_increment_lint(&(lock->lock_word), amount));
appears to resolve the issue. At least I am able to compile past that point.

Thank you.
You are right.

Changed in percona-patches:
status: New → Fix Committed
Stewart Smith (stewart) wrote :

This seems to have made it into a (now old) release. Development has moved to Percona Server where we do support Solaris. If bug is still valid against current Percona Server, please reopen against percona-server project.

Stewart Smith
Director of Server Development

Changed in percona-patches:
status: Fix Committed → In Progress
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers