Bug #33830 cast from ‘char*’ to ‘intptr’ loses precision
Submitted: 12 Jan 2008 12:09 Modified: 14 Feb 2008 6:22
Reporter: Tony Arnold Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Compiling Severity:S1 (Critical)
Version:5.1.22rc OS:MacOS (10.5.1)
Assigned to: CPU Architecture:Any

[12 Jan 2008 12:09] Tony Arnold
Description:
Compiling MySQL 5.1.22rc under Mac OS X 10.5.1/GCC4.0.1 as a four-way universal binary (as is required by bundled packages such as ruby) causes the source to not compile at all. The same configure arguments work fine under 5.0.x releases.

How to repeat:
Here is my configure:

MACOSX_DEPLOYMENT_TARGET=10.5 CFLAGS='-Os -fno-omit-frame-pointer -arch i386 -arch x86_64 -arch ppc7400 -arch ppc64' LDFLAGS='-arch i386 -arch x86_64 -arch ppc7400 -arch ppc64' CXXFLAGS='-Os -arch i386 -arch x86_64 -arch ppc7400 -arch ppc64 -fno-omit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti' ./configure --prefix=/usr/local --disable-dependency-tracking --enable-thread-safe-client --enable-local-infile --with-mysqld-user=_mysql --with-openssl --with-zlib-dir=/usr --with-archive-storage-engine --with-csv-storage-engine --with-federated-storage-engine

Here is the outcome:

rm -f my_user.c
/bin/ln -s ../sql-common/my_user.c my_user.c
make  all-recursive
Making all in share
make[3]: Nothing to be done for `all'.
g++ -DMYSQL_SERVER -DDEFAULT_MYSQL_HOME="\"/usr/local/mysql\"" -DDATADIR="\"/usr/local/mysql/var\"" -DSHAREDIR="\"/usr/local/mysql/share/mysql\"" -DLIBDIR="\"/usr/local/mysql/lib/mysql\"" -DHAVE_CONFIG_H -I. -I. -I../include -I/usr/include -I../include -I../include -I../regex -I.     -Os -arch i386 -arch x86_64 -arch ppc7400 -arch ppc64 -fno-omit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti   -fno-implicit-templates -fno-exceptions -fno-rtti -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DIGNORE_SIGHUP_SIGQUIT  -DDONT_DECLARE_CXA_PURE_VIRTUAL -c -o sql_plugin.o sql_plugin.cc
sql_plugin.cc: In function ‘void plugin_opt_set_limits(my_option*, const st_mysql_sys_var*)’:
sql_plugin.cc:2723: error: cast from ‘char*’ to ‘intptr’ loses precision
sql_plugin.cc:2765: error: cast from ‘char*’ to ‘intptr’ loses precision
sql_plugin.cc: In function ‘void plugin_opt_set_limits(my_option*, const st_mysql_sys_var*)’:
sql_plugin.cc:2723: error: cast from ‘char*’ to ‘intptr’ loses precision
sql_plugin.cc:2765: error: cast from ‘char*’ to ‘intptr’ loses precision
lipo: can't figure out the architecture type of: /var/folders/Wr/WrsfA5dqGIq8-hcQZFxjwk+++TI/-Tmp-//ccZ85Hsd.out
make[3]: *** [sql_plugin.o] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all] Error 2
make: *** [all-recursive] Error 1
[14 Feb 2008 5:39] Valeriy Kravchuk
Thank you for a problem report. Please, try to repeat with a newer version, 5.1.23-rc, nad inform about the results.
[14 Feb 2008 6:22] Tony Arnold
I can verify this now works after compiling using the new release candidate.