Bug #7145 Fails to build on arm
Submitted: 9 Dec 2004 20:23 Modified: 24 Jan 2005 16:15
Reporter: Christian Hammers (Silver Quality Contributor) (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Compiling Severity:S2 (Serious)
Version:4.1.7 OS:Linux (Debian GNU/Linux on arm)
Assigned to: Kent Boortz CPU Architecture:ARM

[9 Dec 2004 20:23] Christian Hammers
Description:
Hello

I'm unable to compile MySQL on arm. It works fine on i386, hppa, s390 etc...
The complete build log is available at:
http://buildd.debian.org/fetch.php?&pkg=mysql-dfsg-4.1&ver=4.1.7-4&arch=arm&stamp=11024189...

bye,

-christian-

 gcc -DDEFAULT_CHARSET_HOME=\"/usr\" -DDATADIR=\"/var/lib/mysql\" -DSHAREDIR=\"/usr/share/mysql\" -DDONT_USE_RAID -DMYSQL_CLIENT -I. -I. -I.. -I../include -O3 -DDBUG_OFF -DBIG_JOINS=1 -MT libmysql.lo -MD -MP -MF .deps/libmysql.Tpo -c libmysql.c  -fPIC -DPIC -o .libs/libmysql.o
libmysql.c: In function `fetch_result_double':
libmysql.c:3783: warning: dereferencing `void *' pointer
libmysql.c:3783: error: invalid use of void expression
make[3]: *** [libmysql.lo] Error 1

How to repeat:
-

Suggested fix:
-
[8 Jan 2005 3:14] [ name withheld ]
I attached a patch
[8 Jan 2005 3:17] [ name withheld ]
Ok, I guess I can't attach files (why not?). So, here's a copy-paste of the patch,

--- include/my_global.h 2005-01-07 20:39:46.000000000 -0600
+++ include/my_global.h 2005-01-07 20:40:22.000000000 -0600
@@ -1072,7 +1072,7 @@
 #define float4store(V,M) memcpy_fixed((byte*) V,(byte*) (&M),sizeof(float))
 
 #if defined(__FLOAT_WORD_ORDER) && (__FLOAT_WORD_ORDER == __BIG_ENDIAN)
-#define doublestore(T,V) do { *(T)= ((byte *) &V)[4];\
+#define doublestore(T,V) do { *(((char*)T)+0)=(char) ((byte *) &V)[4];\
                               *(((char*)T)+1)=(char) ((byte *) &V)[5];\
                               *(((char*)T)+2)=(char) ((byte *) &V)[6];\
                               *(((char*)T)+3)=(char) ((byte *) &V)[7];\

You can also see,

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=285071

for the patch file proper.

PS. I would keep the +0 in the patch since it adds continuity to the macro.
[24 Jan 2005 16:15] 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