Reputation: 840
I am trying to compile perl 5.22.2
on Solaris
, sparc, as 64 bit (os is 64 bit).
It compiled and linked fine as a 32 bit binary, now I have added the -m64
flag to CFLAGS
and LDFLAGS
, and I am getting the following error:
...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
For reference, i have extracted the mentioned lines from 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);
It looks like its doing something strange with the source, notice how _ptr
is treated as a seperate entity, whereas the function is called PerlSIO_get_ptr
. Looks like its being cut off.
Anyone any idea what is going on here? FYI using something like perlbrew is not an option, I need to compile this myself :(.
Upvotes: 1
Views: 239
Reputation: 840
It turns out I needed to add the -Duse64bitall
flag to the Configure
script. So finally I was able to build with
export CFLAGS=-m64 # not sure if really nessessary - just what I did
./Configure -Duse64bitall -Dcc=gcc -d
make
For my setup I also need some more libraries, so this is a rather simplified version. However it solved the problem described in this post.
Upvotes: 2