2

我想编译生成 64 位可执行文件的 GCC 和 binutils。从GNU 文档中我发现它必须看起来像 ia64-*-hpux*。

对于 ia64-hp-hpux11*,默认输出类型为 32 位:

 % file ./a.out
 ./a.out:        ELF-32 executable object file - IA64

这就是我所拥有的:

 % uname -s -r -v -m
 HP-UX B.11.31 U ia64

那么 ia64-hpux 的 64 位目标三元组是什么?

4

1 回答 1

7

从 GCC 手册:

-milp32
-mlp64
    Generate code for a 32-bit or 64-bit environment. The 32-bit environment
sets int, long and pointer to 32 bits. The 64-bit environment sets int to 32
bits and long and pointer to 64 bits. These are HP-UX specific flags.

因此,您需要将“-mlp64”传递给 GCC。我不确定是否有一个单独的三元组会自动打开它,但你总是可以在编译时添加自己的 CFLAGS。

于 2009-05-22T13:47:56.260 回答