gcc在sparc上生成32位代码

发布于 2024-08-23 13:25:41 字数 426 浏览 5 评论 0原文

我有一台 Solaris sparc 机器,当我构建程序时,它生成应该是 64 位的 32 位代码。如何检查原因?

$uname -a
SunOS sol 5.10 Generic_118833-33 sun4u sparc SUNW、Sun-Fire-V240
$/usr/sfw/bin/gcc --version
gcc (GCC) 3.4.3 (csl-sol210-3_4-branch+sol_rpath)
版权所有 (C) 2004 自由软件基金会, Inc.
这是免费软件;请参阅复制条件的来源。没有
保修单;甚至不是为了适销性或特定用途的适用性。

$/usr/sfw/bin/gcc test.c
$文件a.out
a.out:ELF 32 位 MSB 可执行 SPARC 版本 1,动态链接,未剥离,无可用调试信息 $

I have a Solaris sparc machine and when i build my programs, it generates 32bit code which should be 64bit. How to check the cause?

$uname -a
SunOS sol 5.10 Generic_118833-33 sun4u sparc SUNW,Sun-Fire-V240
$/usr/sfw/bin/gcc --version
gcc (GCC) 3.4.3 (csl-sol210-3_4-branch+sol_rpath)
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$/usr/sfw/bin/gcc test.c
$file a.out
a.out: ELF 32-bit MSB executable SPARC Version 1, dynamically linked, not stripped, no debugging information available
$

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

多彩岁月 2024-08-30 13:25:41

OSNews - 使用 GCC 进行 SPARC 优化

创建 64 位代码需要使用 -m64 标志(默认情况下隐含 32 位代码的 -m32)。

(是的,这与 x86_64 的 GCC 不同,后者默认为 -m64,除非用 -m32 覆盖。)

OSNews - SPARC Optimizations With GCC

The creation of 64-bit code requires using the -m64 flag (-m32 for 32-bit code is implied by default).

(Yes, this is different than GCC for x86_64, which defaults to -m64 unless overridden with -m32.)

伴我心暖 2024-08-30 13:25:41

您应该能够使用 -m64 选项强制进行 64 位构建。

如果失败,您可以从 SunFreeware 下载并安装支持 Solaris 10 的 64 位 SPARC 的预构建 GCC 软件包.com(下载,gunzip,使用 pkgadd -d gcc-...-sparc-local 安装),将从 /usr/ 运行本地/bin/gcc

You should be able to force a 64-bit build using the -m64 option.

If that fails, you can download and install a prebuilt GCC package with 64-bit SPARC support for Solaris 10 from SunFreeware.com (download, gunzip, install with pkgadd -d gcc-...-sparc-local) which will run from /usr/local/bin/gcc.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文