【发布时间】:2013-02-06 23:39:04
【问题描述】:
我在 Mac 上,尝试为 arm7 编译 unixODBC(供我在 iOS 中使用)时遇到 libtool 链接问题。我下载了unixODBC from their website,然后使用下面的脚本来配置和制作。
#!/bin/sh
# unset some shell variables
unset CC
unset CFLAGS
unset CPP
# make arm target
export CC=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2
export CFLAGS="-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk"
export CPP=/usr/bin/cpp
./configure --build=x86_64-apple-darwin12 --host=arm-apple-darwin10 --target=armv7 --enable-static --disable-shared
make all
./configure 运行得很好,但在 make all 期间它会中断。我收到以下错误:
Undefined symbols for architecture armv7:
"_lt_libltdlc_LTX_preloaded_symbols", referenced from:
_lt_dlinit in libodbc.a(libltdlc_la-ltdl.o)
ld: symbol(s) not found for architecture armv7
我将错误范围缩小到make all在exe目录中运行时,特别是在运行以下命令时
/bin/sh ../libtool --tag=CC --mode=link /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk -pthread -o isql isql.o ../DriverManager/libodbc.la ../extras/libodbcextraslc.la
我不太确定它为什么会失败。我检查了lt_dlinit 函数确实存在,据我所知,一切都正确完成。但是,我没有使用 libtool 的经验,而且我解决链接器问题的经验也不丰富。
感谢任何帮助,如有必要,我可以提供任何其他信息。提前谢谢!
【问题讨论】:
标签: compiler-construction arm cross-compiling libtool unixodbc