Bug #52327 MySQL Proxy FTBFS on Sparc Debian Linux (my_rdtsc.c:217, 221)
Submitted: 24 Mar 2010 10:39 Modified: 7 Dec 2010 11:07
Reporter: James Bromberger Email Updates:
Status: QA testing Impact on me:
Category:MySQL Proxy Severity:S1 (Critical)
Version:0.8.0 OS:Linux (Sparc)
Assigned to: Assigned Account CPU Architecture:Any

[24 Mar 2010 10:39] James Bromberger
Fails to build from source (FTBFS) (https://buildd.debian.org/fetch.cgi?&pkg=mysql-proxy&ver=0.8.0-1&arch=sparc&stamp=12652775...):

make[4]: Entering directory `/build/buildd-mysql-proxy_0.8.0-1-sparc-pONOHY/mysql-proxy-0.8.0/src'
/bin/bash ../libtool --tag=CC   --mode=compile sparc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I..  -I/usr/include/mysql -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include   -I/usr/include/lua5.1   -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include      -g -O2 -MT libmysql_chassis_timing_la-chassis-timings.lo -MD -MP -MF .deps/libmysql_chassis_timing_la-chassis-timings.Tpo -c -o libmysql_chassis_timing_la-chassis-timings.lo `test -f 'chassis-timings.c' || echo './'`chassis-timings.c
libtool: compile:  sparc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I.. -I/usr/include/mysql -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/lua5.1 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -g -O2 -MT libmysql_chassis_timing_la-chassis-timings.lo -MD -MP -MF .deps/libmysql_chassis_timing_la-chassis-timings.Tpo -c chassis-timings.c  -fPIC -DPIC -o .libs/libmysql_chassis_timing_la-chassis-timings.o
mv -f .deps/libmysql_chassis_timing_la-chassis-timings.Tpo .deps/libmysql_chassis_timing_la-chassis-timings.Plo
/bin/bash ../libtool --tag=CC   --mode=compile sparc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I..  -I/usr/include/mysql -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include   -I/usr/include/lua5.1   -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include      -g -O2 -MT libmysql_chassis_timing_la-my_rdtsc.lo -MD -MP -MF .deps/libmysql_chassis_timing_la-my_rdtsc.Tpo -c -o libmysql_chassis_timing_la-my_rdtsc.lo `test -f 'my_rdtsc.c' || echo './'`my_rdtsc.c
libtool: compile:  sparc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I.. -I/usr/include/mysql -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/lua5.1 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -g -O2 -MT libmysql_chassis_timing_la-my_rdtsc.lo -MD -MP -MF .deps/libmysql_chassis_timing_la-my_rdtsc.Tpo -c my_rdtsc.c  -fPIC -DPIC -o .libs/libmysql_chassis_timing_la-my_rdtsc.o
my_rdtsc.c: In function 'my_timer_cycles':
my_rdtsc.c:217: error: expected specifier-qualifier-list before 'ulong'
my_rdtsc.c:221: error: 'struct <anonymous>' has no member named 'high'
my_rdtsc.c:221: error: 'struct <anonymous>' has no member named 'low'
my_rdtsc.c:221: error: invalid lvalue in asm output 0
my_rdtsc.c:221: error: invalid lvalue in asm output 1
make[4]: *** [libmysql_chassis_timing_la-my_rdtsc.lo] Error 1
make[4]: Leaving directory `/build/buildd-mysql-proxy_0.8.0-1-sparc-pONOHY/mysql-proxy-0.8.0/src'
make[3]: *** [all] Error 2

See also: http://release.debian.org/migration/testing.pl?package=mysql-proxy

How to repeat:
Compile from source, as shown in the build log.
[24 Mar 2010 11:04] Sveta Smirnova
Thank you for the report.

Could you please try sources available from our repository at  http://bazaar.launchpad.net/~mysql-proxy-developers/mysql-proxy/trunk/? Please also send us step-by-step instructions how you compile MySQL Proxy: I want to check if there is any difference with how we do it.
[24 Mar 2010 11:53] Kay Roepke
It appears that src/my_rdtsc.h is missing the typedef for ulong. That type is only used with GCC for SPARC, so we've never hit this bug before (we use SunStudio for compiling on Solaris, not sure we even have a build machine with Linux/SPARC).

Please try this patch:

=== modified file 'src/my_rdtsc.h'
--- src/my_rdtsc.h	2009-06-24 15:37:10 +0000
+++ src/my_rdtsc.h	2010-03-24 11:52:43 +0000
@@ -30,7 +30,7 @@
 typedef guint64 ulonglong;
+typedef guint32 ulong;
   This structure contains the characteristics of all the supported timers.
[24 Mar 2010 13:56] James Bromberger
Hi - I haven't had time to test this, but have cross linked to a Debian bug - 575246 - and asked the package team to try this. Thanks for the very fast response.

[21 Aug 2010 9:22] Paul Wise
bzr trunk also fails to build.

The proposed patch doesn't help either. It enables src/my_rdtsc.c to be built but the definition causes a conflict later in the build.

I was able to get it to build on smetana.d.o (sparc porterbox) by adding #include <sys/types.h> to src/my_rdtsc.h. mysql-proxy upstream would probably want to add a check for that header to configure.ac and use the header when it is available.