【问题标题】:generating 64 bit code on 32bit debian system在 32 位 debian 系统上生成 64 位代码
【发布时间】:2013-05-02 11:27:46
【问题描述】:

您能否描述一下您是如何在 32 位 debian 机器上安装 gcc-multilibg++-multilib 以生成 64 位代码的?

我在我的 32 位 debian 系统上安装了 gcc-4.7.2(还安装了 binutils-2.23)。当我尝试用 -m64 标志编译一个简单的 hello world 程序时

# gcc -m64 hello.c

我收到以下错误消息:

"hello.c:1:0: sorry, unimplemented: 64-bit mode not compiled in" .

请告诉我在 32 位 debian 系统上生成 64 位代码的步骤。

【问题讨论】:

    标签: linux gcc cross-platform cross-compiling gcc4.7


    【解决方案1】:

    您需要在configure 中使用此选项重新安装 gcc。

    【讨论】:

    • 我用 configure --enable-multilib 和 --enable-targets=i686-pc-linux-gnu,x86_64-pc-linux-gnu 安装了 gcc-4.7.2 并且在这个 gcc 配置之前我用 --enable-targets=i686-pc-linux-gnu,x86_64-pc-linux-gnu 安装了 binutils。一切都很好。我成功安装了 gcc-4.7.2,但我也无法在我的 32 位 debian 机器上使用 -m64 标志生成 64 位代码。
    • # gcc -m64 hello.c 我收到以下错误消息:“hello.c:1:0: sorry, unimplemented: 64-bit mode not compiled in”。
    • @NIlesh 你能用gcc -v的输出更新问题吗?
    • # gcc -v 使用内置规范。 COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/var/opt/crossgcc/bin/../libexec/gcc/i686-pc-linux-gnu/4.7.2/lto-wrapper 目标:i686-pc-linux-gnu 配置:.. /gcc-4.7.2/configure --enable-multilib --enable-targets=i686-pc-linux-gnu,x86_64-pc-linux-gnu --prefix=/opt/crossgcc --with-gmp=/opt /crossgcc --with-mpfr=/opt/crossgcc --with-mpc=/opt/crossgcc --with-system-zlib 线程模型:posix gcc 4.7.2版(GCC)
    • 系统是i686(cmd :uname -a), 32位debian机(/proc/cpuinfo中"flags:"中没有lm标志)
    猜你喜欢
    • 2020-08-16
    • 2012-04-06
    • 2012-03-16
    • 1970-01-01
    • 2012-06-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-06-30
    相关资源
    最近更新 更多