gpt4 book ai didi

在 solaris 10 sparc 上将 perl 编译为 64 位

转载 作者:太空宇宙 更新时间:2023-11-04 02:26:47 27 4
gpt4 key购买 nike

我正在尝试在 Solaris、sparc 上将 perl 5.22.2 编译为 64 位(操作系统是 64 位)。它作为 32 位二进制文​​件编译和链接良好,现在我已经将 -m64 标志添加到 CFLAGSLDFLAGS,我得到了以下错误:

...skipping...
perlio.c:3400: error: structure has no member named `_ptr'
perlio.c:3408: error: structure has no member named `_ptr'
perlio.c: In function `PerlIOStdio_get_base':
perlio.c:3531: error: structure has no member named `_base'
perlio.c: In function `PerlIOStdio_get_bufsiz':
perlio.c:3538: error: structure has no member named `_cnt'
perlio.c:3538: error: structure has no member named `_ptr'
perlio.c:3538: error: structure has no member named `_base'
perlio.c: In function `PerlIOStdio_get_ptr':
perlio.c:3547: error: structure has no member named `_ptr'
perlio.c: In function `PerlIOStdio_get_cnt':
perlio.c:3554: error: structure has no member named `_cnt'
perlio.c: In function `PerlIOStdio_set_ptrcnt':
perlio.c:3575: error: structure has no member named `_ptr'
perlio.c:3594: error: structure has no member named `_cnt'
make: *** [perlio.o] Error 1

作为引用,我从 perlio.c 中提取了提到的行:

3400:   STDCHAR *eptr = (STDCHAR*)PerlSIO_get_ptr(s);
3408: if ((STDCHAR*)PerlSIO_get_ptr(s) != --eptr || ((*eptr & 0xFF) != ch)) {
3531: return (STDCHAR*)PerlSIO_get_base(stdio);
3538: return PerlSIO_get_bufsiz(stdio);
3547: return (STDCHAR*)PerlSIO_get_ptr(stdio);
3554: return PerlSIO_get_cnt(stdio);
3575: PerlSIO_set_ptr(stdio, ptr); /* LHS STDCHAR* cast non-portable */
3594: PerlSIO_set_cnt(stdio, cnt);

看起来它对源代码做了一些奇怪的事情,请注意 _ptr 是如何被视为一个单独的实体,而该函数被称为 PerlSIO_get_ptr。看起来它被切断了。

有人知道这里发生了什么吗?仅供引用,使用 perlbrew 之类的东西不是一种选择,我需要自己编译 :(。

最佳答案

事实证明,我需要将 -Duse64bitall 标志添加到 Configure 脚本中。所以最后我能够构建

export CFLAGS=-m64 # not sure if really nessessary - just what I did
./Configure -Duse64bitall -Dcc=gcc -d
make

对于我的设置,我还需要更多的库,所以这是一个相当简化的版本。但是它解决了这篇文章中描述的问题。

关于在 solaris 10 sparc 上将 perl 编译为 64 位,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50024266/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com