LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1997|回复: 3

mysq交叉编译时,configure的时候就报错了。。。(到底有没有人成功交叉编译通过的?)

[复制链接]
发表于 2007-3-3 22:48:55 | 显示全部楼层 |阅读模式
本人需要用mysql的修复工具myisamchk,所以要交叉编译mysql...
之前在PC上编译一切正常,但arm编译,在configure时候就报错了,换了不同的arm-gcc版本,但问题一样..
因为前段时间交叉编译freetds时,也出现了configure错的问题,后来是在官方的maillist提问,项目负责人给我发来新的acinclude.m4脚本后解决的...
google的时候,也发现有人问同样的问题,估计是个通病...
想问问,有没有成功交叉编译过myslq的?是什么版本的??

PC环境: redhat9

[root@liang mysql-4.0.24]# ./configure --host=armv4l-unknown-linux \
> --prefix=/home/lpos/temp/mysql-arm --enable-shared=no -enable-static=yes --without-debug \
> --with-embedded-server --without-innodb --with-charset=gb2312 --with-pthread
configure: WARNING: If you wanted to set the --build type, don't use --host.
If a cross compiler is detected then cross compile mode will be used.
checking build system type... i686-pc-linux-gnu
checking host system type... armv4l-unknown-linux-gnu
checking target system type... armv4l-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for armv4l-unknown-linux-strip... armv4l-unknown-linux-strip
checking whether to enable maintainer-specific portions of Makefiles... no
checking whether build environment is sane... yes
checking whether make sets $(MAKE)... (cached) yes
checking for gawk... (cached) gawk
checking for armv4l-unknown-linux-gcc... armv4l-unknown-linux-gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... yes
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether armv4l-unknown-linux-gcc accepts -g... yes
checking for armv4l-unknown-linux-gcc option to accept ANSI C... none needed
checking for style of include used by make... GNU
checking dependency style of armv4l-unknown-linux-gcc... gcc
checking for armv4l-unknown-linux-g++... armv4l-unknown-linux-g++
checking whether we are using the GNU C++ compiler... yes
checking whether armv4l-unknown-linux-g++ accepts -g... yes
checking dependency style of armv4l-unknown-linux-g++... gcc
checking how to run the C preprocessor... armv4l-unknown-linux-gcc -E
checking "C Compiler version"... "armv4l-unknown-linux-gcc 2.95.2"
checking "C++ compiler version"... "armv4l-unknown-linux-g++ 2.95.2"
checking for armv4l-unknown-linux-ranlib... armv4l-unknown-linux-ranlib
checking for a sed that does not truncate output... /bin/sed
checking for egrep... grep -E
checking for ld used by armv4l-unknown-linux-gcc... /opt/host/armv4l/armv4l-unknown-linux/bin/ld
checking if the linker (/opt/host/armv4l/armv4l-unknown-linux/bin/ld) is GNU ld... yes
checking for /opt/host/armv4l/armv4l-unknown-linux/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /opt/host/armv4l/bin/armv4l-unknown-linux-nm -B
checking whether ln -s works... yes
checking how to recognise dependent libraries... pass_all
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking how to run the C++ preprocessor... armv4l-unknown-linux-g++ -E
checking for armv4l-unknown-linux-g77... no
checking for armv4l-unknown-linux-f77... no
checking for armv4l-unknown-linux-xlf... no
checking for armv4l-unknown-linux-frt... no
checking for armv4l-unknown-linux-pgf77... no
checking for armv4l-unknown-linux-fort77... no
checking for armv4l-unknown-linux-fl32... no
checking for armv4l-unknown-linux-af77... no
checking for armv4l-unknown-linux-f90... no
checking for armv4l-unknown-linux-xlf90... no
checking for armv4l-unknown-linux-pgf90... no
checking for armv4l-unknown-linux-epcf90... no
checking for armv4l-unknown-linux-f95... no
checking for armv4l-unknown-linux-fort... no
checking for armv4l-unknown-linux-xlf95... no
checking for armv4l-unknown-linux-ifc... no
checking for armv4l-unknown-linux-efc... no
checking for armv4l-unknown-linux-pgf95... no
checking for armv4l-unknown-linux-lf95... no
checking for armv4l-unknown-linux-gfortran... no
checking for g77... g77
checking whether we are using the GNU Fortran 77 compiler... yes
checking whether g77 accepts -g... yes
checking the maximum length of command line arguments... 32768
checking command to parse /opt/host/armv4l/bin/armv4l-unknown-linux-nm -B output from armv4l-unknown-linux-gcc
object... ok
checking for objdir... .libs
checking for armv4l-unknown-linux-ar... armv4l-unknown-linux-ar
checking for armv4l-unknown-linux-ranlib... (cached) armv4l-unknown-linux-ranlib
checking for armv4l-unknown-linux-strip... (cached) armv4l-unknown-linux-strip
checking if armv4l-unknown-linux-gcc static flag works... yes
checking if armv4l-unknown-linux-gcc supports -fno-rtti -fno-exceptions... yes
checking for armv4l-unknown-linux-gcc option to produce PIC... -fPIC
checking if armv4l-unknown-linux-gcc PIC flag -fPIC works... yes
checking if armv4l-unknown-linux-gcc supports -c -o file.o... yes
checking whether the armv4l-unknown-linux-gcc linker (/opt/host/armv4l/armv4l-unknown-linux/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... no
checking whether to build static libraries... yes
configure: creating libtool
appending configuration tag "CXX" to libtool
checking for ld used by armv4l-unknown-linux-g++... /opt/host/armv4l/armv4l-unknown-linux/bin/ld
checking if the linker (/opt/host/armv4l/armv4l-unknown-linux/bin/ld) is GNU ld... yes
checking whether the armv4l-unknown-linux-g++ linker (/opt/host/armv4l/armv4l-unknown-linux/bin/ld) supports shared libraries... yes
checking for armv4l-unknown-linux-g++ option to produce PIC... -fPIC
checking if armv4l-unknown-linux-g++ PIC flag -fPIC works... yes
checking if armv4l-unknown-linux-g++ supports -c -o file.o... yes
checking whether the armv4l-unknown-linux-g++ linker (/opt/host/armv4l/armv4l-unknown-linux/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
appending configuration tag "F77" to libtool
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... no
checking whether to build static libraries... yes
checking for g77 option to produce PIC... -fPIC
checking if g77 PIC flag -fPIC works... yes
checking if g77 supports -c -o file.o... yes
checking whether the g77 linker (/opt/host/armv4l/armv4l-unknown-linux/bin/ld) supports shared libraries... yeschecking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking for a BSD-compatible install... /usr/bin/install -c
checking for bison... bison -y
checking for pdftex... no
checking for tex... no
checking "return type of sprintf"... configure: error: cannot run test program while cross compiling
See `config.log' for more details.
[root@liang mysql-4.0.24]# ./configure --build=i686-linux --host=armv4l-unknown-linux --target=arm-linux --prefix=/home/lpos/temp/mysql-arm --enable-shared=no -enable-static=yes --without-debug --with-embedded-server --without-innodb --with-charset=gb2312 --with-pthread
checking build system type... i686-pc-linux-gnu
checking host system type... armv4l-unknown-linux-gnu
checking target system type... arm-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for armv4l-unknown-linux-strip... armv4l-unknown-linux-strip
checking whether to enable maintainer-specific portions of Makefiles... no
checking whether build environment is sane... yes
checking whether make sets $(MAKE)... (cached) yes
checking for gawk... (cached) gawk
checking for armv4l-unknown-linux-gcc... armv4l-unknown-linux-gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... yes
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether armv4l-unknown-linux-gcc accepts -g... yes
checking for armv4l-unknown-linux-gcc option to accept ANSI C... none needed
checking for style of include used by make... GNU
checking dependency style of armv4l-unknown-linux-gcc... gcc
checking for armv4l-unknown-linux-g++... armv4l-unknown-linux-g++
checking whether we are using the GNU C++ compiler... yes
checking whether armv4l-unknown-linux-g++ accepts -g... yes
checking dependency style of armv4l-unknown-linux-g++... gcc
checking how to run the C preprocessor... armv4l-unknown-linux-gcc -E
checking "C Compiler version"... "armv4l-unknown-linux-gcc 2.95.2"
checking "C++ compiler version"... "armv4l-unknown-linux-g++ 2.95.2"
checking for armv4l-unknown-linux-ranlib... armv4l-unknown-linux-ranlib
checking for a sed that does not truncate output... /bin/sed
checking for egrep... grep -E
checking for ld used by armv4l-unknown-linux-gcc... /opt/host/armv4l/armv4l-unknown-linux/bin/ld
checking if the linker (/opt/host/armv4l/armv4l-unknown-linux/bin/ld) is GNU ld... yes
checking for /opt/host/armv4l/armv4l-unknown-linux/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /opt/host/armv4l/bin/armv4l-unknown-linux-nm -B
checking whether ln -s works... yes
checking how to recognise dependent libraries... pass_all
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking how to run the C++ preprocessor... armv4l-unknown-linux-g++ -E
checking for armv4l-unknown-linux-g77... no
checking for armv4l-unknown-linux-f77... no
checking for armv4l-unknown-linux-xlf... no
checking for armv4l-unknown-linux-frt... no
checking for armv4l-unknown-linux-pgf77... no
checking for armv4l-unknown-linux-fort77... no
checking for armv4l-unknown-linux-fl32... no
checking for armv4l-unknown-linux-af77... no
checking for armv4l-unknown-linux-f90... no
checking for armv4l-unknown-linux-xlf90... no
checking for armv4l-unknown-linux-pgf90... no
checking for armv4l-unknown-linux-epcf90... no
checking for armv4l-unknown-linux-f95... no
checking for armv4l-unknown-linux-fort... no
checking for armv4l-unknown-linux-xlf95... no
checking for armv4l-unknown-linux-ifc... no
checking for armv4l-unknown-linux-efc... no
checking for armv4l-unknown-linux-pgf95... no
checking for armv4l-unknown-linux-lf95... no
checking for armv4l-unknown-linux-gfortran... no
checking for g77... g77
checking whether we are using the GNU Fortran 77 compiler... yes
checking whether g77 accepts -g... yes
checking the maximum length of command line arguments... 32768
checking command to parse /opt/host/armv4l/bin/armv4l-unknown-linux-nm -B output from armv4l-unknown-linux-gcc
object... ok
checking for objdir... .libs
checking for armv4l-unknown-linux-ar... armv4l-unknown-linux-ar
checking for armv4l-unknown-linux-ranlib... (cached) armv4l-unknown-linux-ranlib
checking for armv4l-unknown-linux-strip... (cached) armv4l-unknown-linux-strip
checking if armv4l-unknown-linux-gcc static flag works... yes
checking if armv4l-unknown-linux-gcc supports -fno-rtti -fno-exceptions... yes
checking for armv4l-unknown-linux-gcc option to produce PIC... -fPIC
checking if armv4l-unknown-linux-gcc PIC flag -fPIC works... yes
checking if armv4l-unknown-linux-gcc supports -c -o file.o... yes
checking whether the armv4l-unknown-linux-gcc linker (/opt/host/armv4l/armv4l-unknown-linux/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... no
checking whether to build static libraries... yes
configure: creating libtool
appending configuration tag "CXX" to libtool
checking for ld used by armv4l-unknown-linux-g++... /opt/host/armv4l/armv4l-unknown-linux/bin/ld
checking if the linker (/opt/host/armv4l/armv4l-unknown-linux/bin/ld) is GNU ld... yes
checking whether the armv4l-unknown-linux-g++ linker (/opt/host/armv4l/armv4l-unknown-linux/bin/ld) supports shared libraries... yes
checking for armv4l-unknown-linux-g++ option to produce PIC... -fPIC
checking if armv4l-unknown-linux-g++ PIC flag -fPIC works... yes
checking if armv4l-unknown-linux-g++ supports -c -o file.o... yes
checking whether the armv4l-unknown-linux-g++ linker (/opt/host/armv4l/armv4l-unknown-linux/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
appending configuration tag "F77" to libtool
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... no
checking whether to build static libraries... yes
checking for g77 option to produce PIC... -fPIC
checking if g77 PIC flag -fPIC works... yes
checking if g77 supports -c -o file.o... yes
checking whether the g77 linker (/opt/host/armv4l/armv4l-unknown-linux/bin/ld) supports shared libraries... yeschecking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking for a BSD-compatible install... /usr/bin/install -c
checking for bison... bison -y
checking for pdftex... no
checking for tex... no
checking "return type of sprintf"... configure: error: cannot run test program while cross compiling
See `config.log' for more details.
 楼主| 发表于 2007-3-3 23:00:38 | 显示全部楼层
google的时候,找到外国的maillist一大堆,问关于交叉编译mysql,在configure出错的问题,可惜未找到解决方法。。。。

个人觉得肯定是configue的自动检测脚步问题(曾经看到官方网上说低版本的交叉configure是有bug的,但没查到那个版本改善了。。。)

能不能像网上交叉编译sqllite那样,修改脚步不自动检测而configure通过呢??
有那位朋友成功交叉编译通过mysql了嘛?那个版本的?具体操作如何??
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-3-3 23:49:25 | 显示全部楼层
下面贴一下在网上找的,关于mysql交叉编译的问题。。。
个人觉得交叉编译的自动检测脚步真的很难嘛,为什么mysql官方居然知道有问题都不处理的?难度没有需要在其他cpu上跑mysql??
还是新的版本已经改善了?有谁能说一下。。。


problems with cross-compilation
Posted by: Andrey Kochin (IP Logged)
Date: October 09, 2006 07:18AM


Hi.

There are some problems with cross-compilation.
First is configure script intractability.
It breaks at 4 points (in my case):

1. Checking return type of sprintf (SPRINTF_RETURNS_INT). Forcing this test by command line option seems the easiest way to avoid this break.

2. Checking of atom operations (HAVE_ATOMIC_*). AFAIK, it may be tested by compiler result code or by output file existance. If source has been compiled, atomic operations supported.

3. Checking for int8 (HAVE_INT_8_16_32). Same as 2.

4. Checking for restartable system calls (HAVE_RESTARTABLE_SYSCALLS). Do not know, how to solve this. May be, by command line option too.

It would be perfect to create special target testing utility and devide configuration process to 2 steps.



[11 Feb 2004 11:21] Dmitrii Tisnek
Description:
mysql build system is not ready for cross-compilation.

1) there are several places where configure barfes with "configure: error:
cannot run test program while cross compiling"
1.1) when checking the return type of sprintf
1.2) when checking for compress in zlib
1.3) two occurances when checking for atomic operations
1.4) when checking for restartable system calls
1.5) when checking if conversion of long long to float works
1.6) when checking for int8

there are a couple more places where similar error might occur but since it
didn't for me, I can't claim it happens at all.

2) there are several places in Makefiles where $(CC) is used instead of
$(HOST_CC)
2.1) libmysql_r/Makefile when making conf_to_crc
2.2) libmysql/Makefile when making conf_to_crc
2.3) strings/Makefile when making conf_to_crc
2.4) sql/Makefile when making gen_lex_hash

How to repeat:
set up a cross-compilation toolchain (in my case i386-uclibc-linux), try to
configure and compile mysql for that target.

Suggested fix:
whoever wrote configure.* and Makefile.* gets to fix it[27 Apr 2004 15:36] Sergei Golubchik
Tim, if you are fixing it, note that it's WL#1151 (assign it to yourself, etc)[4 May 2004 2:54] Tim Smith
This requested feature (to make MySQL capable of being cross-compiled) is on our
project TODO list.  We hope to have this added in version 4.1.

Thank you for your report.[7 Dec 2005 22:40] Hien Nguyen
is there any update on this bug yet?[17 Dec 2005 18:33] Massimiliano Pirani
Are there any news about that ? I'm currently trying with source version 5.0.16
and it seems as nothing's changed. I think it is a very important feature for
such a good release.
回复 支持 反对

使用道具 举报

发表于 2007-3-17 04:23:45 | 显示全部楼层
把数据库文件复制到x86下面来修不就行了。除了mysql,没听说哪个数据库经常坏还要修的。看来这就是mysql速度快的代价啊。
最好的办法就是不用mysql.
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表