【问题标题】:Issues cross compiling unixODBC交叉编译 unixODBC 的问题
【发布时间】: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 allexe目录中运行时,特别是在运行以下命令时

/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


    【解决方案1】:

    也许值得一试

    libtoolize --copy --ltdl

    在 unixODBC 构建树的根目录下复制到本地版本的 libtool

    【讨论】:

    • 感谢您的帮助。但这没有用。我在运行脚本之前运行了它,但是当make all 启动时,我收到此错误:libtool: Version mismatch error. This is libtool 2.4.2, but the definition of this LT_INIT comes from libtool 2.2.6b. You should recreate aclocal.m4 with macros from libtool 2.4.2 and run autoconf again. 还有其他建议吗?再次感谢!
    • 当我必须使用自动工具在 Mac 上构建东西时,我通常只安装最新的稳定版 GNU 自动工具。通常,随特定 OS X 版本安装的自动工具太古老,无法在该版本的 OS X 上实际使用,尤其是 GNU libtool,它似乎经常被破坏。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-07-10
    • 2021-07-26
    • 2020-12-05
    • 1970-01-01
    相关资源
    最近更新 更多