Bug #4916 Conflict with OpenServer UP3/MP3 and semaphores.h
Submitted: 5 Aug 2004 19:47 Modified: 8 Oct 2004 13:17
Reporter: Boyd GERBER Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Compiling Severity:S1 (Critical)
Version:All MySQL-4.x.x and 5.x.x OS:OpenServer 5.0.7
Assigned to: Lenz Grimmer CPU Architecture:Any

[5 Aug 2004 19:47] Boyd GERBER
Description:
There has always been a semaphore.h file but it was ignored till the latest patches to the OS.  Now it needs the exact same fix as sched.h.

*** configure.in.org Fri May 14 00:53:30 2004
--- configure.in Sun Jul 25 05:10:42 2004
***************
*** 1271,1276 ****
        with_named_thread="-lgthreads -lsocket -lgthreads"
        # sched.h conflicts with fsu-threads
        touch ./include/sched.h

        # We must have gcc
        if expr "$CC" : ".*gcc.*"
--- 1271,1277 ----
        with_named_thread="-lgthreads -lsocket -lgthreads"
        # sched.h conflicts with fsu-threads
        touch ./include/sched.h
+       touch ./include/semaphore.h

        # We must have gcc
        if expr "$CC" : ".*gcc.*"

How to repeat:
Update OS to latest patches or updates.  Then try to configure, make and build mysql.  It For example on mysql-5.0.1-alpha it always fails with....

gcc -DDEFAULT_BASEDIR=\"/usr/local/mysql\" -DDATADIR="\"/usr/local/mysql/data\"" -DDEFAULT_CHARSET_HOME="\"/usr/local/mysql\"" -DSHAREDIR="\"/usr/local/mysql/share/mysql\"" -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I.    -O3 -DDBUG_OFF -O1   -belf -DSCO -belf -c `test -f 'my_semaphore.c' || echo './'`my_semaphore.c
In file included from ../include/my_semaphore.h:38,
                 from my_semaphore.c:23:
/usr/include/semaphore.h:42: syntax error before `*'
/usr/include/semaphore.h:43: syntax error before `*'
/usr/include/semaphore.h:44: syntax error before `*'
/usr/include/semaphore.h:44: warning: data definition has no type or storage class
/usr/include/semaphore.h:45: syntax error before `*'
/usr/include/semaphore.h:47: syntax error before `*'
/usr/include/semaphore.h:48: syntax error before `*'
/usr/include/semaphore.h:49: syntax error before `*'
/usr/include/semaphore.h:50: syntax error before `*'
gmake[2]: *** [my_semaphore.o] Error 1
gmake[2]: Leaving directory `/usr/zenez/build/osr507/mysql-5.0.1-alpha/mysys'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory `/usr/zenez/build/osr507/mysql-5.0.1-alpha'
gmake: *** [all] Error 2

Suggested fix:

*** configure.in.org Fri May 14 00:53:30 2004
--- configure.in Sun Jul 25 05:10:42 2004
***************
*** 1271,1276 ****
        with_named_thread="-lgthreads -lsocket -lgthreads"
        # sched.h conflicts with fsu-threads
        touch ./include/sched.h

        # We must have gcc
        if expr "$CC" : ".*gcc.*"
--- 1271,1277 ----
        with_named_thread="-lgthreads -lsocket -lgthreads"
        # sched.h conflicts with fsu-threads
        touch ./include/sched.h
+       touch ./include/semaphore.h

        # We must have gcc
        if expr "$CC" : ".*gcc.*"
[5 Aug 2004 20:32] Boyd GERBER
This is because the FSU-threads has a semaphore.h file that directly conflicts with the file /usr/include/sys/semaphore.h.
[8 Oct 2004 13:13] Kent Boortz
The suggested fix above is now in the 5.0 sourses
[8 Oct 2004 13:17] Kent Boortz
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html