日期:2014-05-16  浏览次数:20691 次

交叉编译mysql5.1.63,make时的错误
pc平台: red hat linux 9
交叉编译器:arm-linux-gcc4.3.2
mysql版本:mysql-5.1.63.tar.gz
目的:把MySQL移植到了FL2440的开发板上
====================================================

mysql貌似没有很好支持交叉编译,修改了一下configure文件以后,./configure成功
#./configure --host=arm-linux -with-named-curses-libs=/usr/lib/libncurses.so.5 --prefix=/usr/local/mysql
-----------------------------------------------------

在mysql5.1.63文件夹中,make时的错误:

stacktrace.c: In function `safe_print_str':
stacktrace.c:85: `SYS_gettid' undeclared (first use in this function)
stacktrace.c:85: (Each undeclared identifier is reported only once
stacktrace.c:85: for each function it appears in.)
make[1]: *** [stacktrace.o] Error 1
make[1]: Leaving directory `/usr/local/src/mysql-5.1.63/mysys'
make: *** [all-recursive] Error 1
-----------------------------------------------------

makefile中部分内容:

AWK = gawk
CC = arm-linux-gcc
CCAS = arm-linux-gcc
CCASDEPMODE = depmode=gcc
CCASFLAGS = -g -O2  
CCDEPMODE = depmode=gcc
CC_VERSION = 2.95.3
CFLAGS = -g -O2 -DUNIV_LINUX -DUNIV_LINUX
CHECK_PID = /bin/kill -0 $$PID > /dev/null 2> /dev/null
CHMOD = /bin/chmod
CLIENT_EXTRA_LDFLAGS = 
CLIENT_LIBS = -lcrypt -lnsl -lm $(top_builddir)/zlib/libzlt.la 
CLIENT_THREAD_LIBS = -lpthread
CMP = /usr/bin/cmp
COMPILATION_COMMENT = Source distribution
CONF_COMMAND = ./configure '--host=arm-linux' '-with-named-curses-libs=/usr/lib/libncurses.so.5' '--prefix=/usr/local/mysql' 'host_alias=arm-linux'
CP = /bin/cp
CPP = arm-linux-gcc -E
CPPFLAGS = 
CXX = arm-linux-g++
CXXCPP = arm-linux-g++ -E
CXXDEPMODE = depmode=gcc
CXXFLAGS = -O3 -fno-implicit-templates -fno-exceptions -fno-rtti -DUSE_PRAGMA_IMPLEMENTATION
CXXLDFLAGS = 
CXX_VERSION = 2.95.3
CYGPATH_W = echo
DEFS = -DHAVE_CONFIG_H
DEPDIR = .deps
DIFF = /usr/bin/diff
DOT_FRM_VERSION = 6
DOXYGEN = /usr/bin/doxygen
DSYMUTIL = 
DUMPBIN = 
DVIS = manual.dvi
ECHO_C = 
ECHO_N = -n
ECHO_T = 
EGREP = /bin/grep -E
EXEEXT = 
FGREP = /bin/grep -F
FIND_PROC = /bin/ps wwwp $$PID | grep -v " grep" | grep -v mysqld_safe | grep -- "$$MYSQLD" > /dev/null
GETCONF = getconf
GREP = /bin/grep
GXX = yes
HOSTNAME = /bin/hostname
INNODB_DYNAMIC_CFLAGS = -DMYSQL_DYNAMIC_PLUGIN
INSTALL = /usr/bin/install -c
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_PROGRAM = ${INSTALL}
INSTALL_SCRIPT = ${INSTALL}
INSTALL_STRIP_PROGRAM = $(install_sh) -c -s
KILL = /bin/kill
LD = /usr/local/arm/2.95.3/arm-linux/bin/ld
LDFLAGS = -rdynamic 
LD_VERSION_SCRIPT = -Wl,--version-script=$(top_builddir)/libmysql/libmysql.ver
LIBDL = -ldl 
LIBEDIT_LOBJECTS = unvis.o vis.o strlcpy.o strlcat.o fgetln.o
LIBOBJS = 
LIBS = -lpthread -lcrypt -lnsl -lm -lpthread 
LIBTOOL = $(SHELL) $(top_builddir)/libtool --preserve-dup-deps
LIB_EXTRA_CCFLAGS = 
LIPO = 
LM_CFLAGS = 
LN = /bin/ln
LN_CP_F = /bin/ln -s
LN_S = ln -s
LTLIBOBJS = 
MACHINE_TYPE = arm
MAKEINDEX = /usr/bin/makeindex
MAKEINFO = ${SHELL} /usr/local/src/mysql-5.1.63/missing --run makeinfo
MAKE_BINARY_DISTRIBUTION_OPTIONS = 
MAKE_SHELL = /bin/sh
MKDIR_P = /bin/mkdir -p
MV = /bin/mv
MYSQLD_DEFAULT_SWITCHES = --skip-external-locking
MYSQLD_EXTRA_LDFLAGS = 
MYSQLD_EXTRA_LIBS = 
MYSQLD_USER = mysql
MYSQL_BASE_VERSION = 5.1
MYSQL_COPYRIGHT_YEAR = 2012
MYSQL_NO_DASH_VERSION = 5.1.63
MYSQL_PREVIOUS_BASE_VERSION = 5.0
MYSQL_SERVER_SUFFIX = 
MYSQL_TCP_PORT = 3306
MYSQL_TCP_PORT