在 solaris 10 sparc 上将 perl 编译为 64 位
compiling perl as 64 bit on solaris 10 sparc
我正在尝试在 Solaris
、sparc 上将 perl 5.22.2
编译为 64 位(os 是 64 位)。
它作为 32 位二进制文件编译和链接良好,现在我已将 -m64
标志添加到 CFLAGS
和 LDFLAGS
,并且出现以下错误:
...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
对于我的设置,我还需要更多的库,所以这是一个相当简化的版本。但是它解决了 post.
中描述的问题
我正在尝试在 Solaris
、sparc 上将 perl 5.22.2
编译为 64 位(os 是 64 位)。
它作为 32 位二进制文件编译和链接良好,现在我已将 -m64
标志添加到 CFLAGS
和 LDFLAGS
,并且出现以下错误:
...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
对于我的设置,我还需要更多的库,所以这是一个相当简化的版本。但是它解决了 post.
中描述的问题