471,336 Members | 1,273 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,336 software developers and data experts.

Help Compiling 64bit Python

I'm having a bit of hassle, trying to compile Python in 64bit mode on
Solaris8, using GCC 3.1/3.3 (tried both). I've set the relevant
settings ( export CC="gcc -mcpu=v9 -m64 -D_LARGEFILE64_SOURCE=1" -
hopefully) before ./configure, which seems to work OK. The problem
happens halfway through the make. It produces the following output:

c++ -o python \
Modules/python.o \
libpython2.3.a -lresolv -lsocket -lnsl -lrt -ldl
-lpthread -lm
ld: fatal: file Modules/python.o: wrong ELF class: ELFCLASS64
ld: fatal: File processing errors. No output written to python
collect2: ld returned 1 exit status
make: *** [python] Error 1

I'd be very grateful for any pointers.

Regards

John
Jul 18 '05 #1
4 1960
John Abel <jo*******@pa.press.net> writes:
c++ -o python \
Modules/python.o \
libpython2.3.a -lresolv -lsocket -lnsl -lrt -ldl
-lpthread -lm
ld: fatal: file Modules/python.o: wrong ELF class: ELFCLASS64
ld: fatal: File processing errors. No output written to python
collect2: ld returned 1 exit status
make: *** [python] Error 1

I'd be very grateful for any pointers.


You need to arrange to use the -m options in the linker line as well.

Looking at the generated Makefile will tell you where to best insert
these options.

Regards,
Martin
Jul 18 '05 #2
Martin v. Lwis wrote:
John Abel <jo*******@pa.press.net> writes:
c++ -o python \
Modules/python.o \
libpython2.3.a -lresolv -lsocket -lnsl -lrt -ldl
-lpthread -lm
ld: fatal: file Modules/python.o: wrong ELF class: ELFCLASS64
ld: fatal: File processing errors. No output written to python
collect2: ld returned 1 exit status
make: *** [python] Error 1

I'd be very grateful for any pointers.


You need to arrange to use the -m options in the linker line as well.

Looking at the generated Makefile will tell you where to best insert
these options.

Regards,
Martin

I seem to be missing something really obvious here. I've modified the
Makefile so it looks like this:

CONFIG_ARGS= 'CC=gcc -mcpu=v9 -m64 -D_LARGEFILE64_SOURCE=1'
'LDFLAGS=-mcpu=v9 -m64'

ran the make, and it still comes up with the same error. I've even
tried running it with LDFLAGS=-64, with the same result.

Regards

John
Jul 18 '05 #3
John Abel <jo*******@pa.press.net> writes:
c++ -o python \
Modules/python.o \
libpython2.3.a -lresolv -lsocket -lnsl -lrt -ldl
-lpthread -lm
[...] I seem to be missing something really obvious here. I've modified the
Makefile so it looks like this:

CONFIG_ARGS= 'CC=gcc -mcpu=v9 -m64 -D_LARGEFILE64_SOURCE=1'
'LDFLAGS=-mcpu=v9 -m64'

ran the make, and it still comes up with the same error. I've even
tried running it with LDFLAGS=-64, with the same result.


The really obvious thing you are missing is that "c++" is used to link
python, so setting "CC" has no effect.

I really encourage you to read the Makefile.

Regards,
Martin
Jul 18 '05 #4
Martin v. Lwis wrote:
John Abel <jo*******@pa.press.net> writes:
c++ -o python \
Modules/python.o \
libpython2.3.a -lresolv -lsocket -lnsl -lrt -ldl
-lpthread -lm

[...]

I seem to be missing something really obvious here. I've modified the
Makefile so it looks like this:

CONFIG_ARGS= 'CC=gcc -mcpu=v9 -m64 -D_LARGEFILE64_SOURCE=1'
'LDFLAGS=-mcpu=v9 -m64'

ran the make, and it still comes up with the same error. I've even
tried running it with LDFLAGS=-64, with the same result.


The really obvious thing you are missing is that "c++" is used to link
python, so setting "CC" has no effect.

I really encourage you to read the Makefile.

Regards,
Martin

Sorted. I ended up setting the following:

export CC="gcc -mcpu=v9 -m64 -D_LARGEFILE64_SOURCE=1"
export LDFLAGS='-mcpu=v9 -m64'
export LDDFLAGS='-mcpu=v9 -m64 -G'

Thanks to Martin for the pointers.

Regards

John

Jul 18 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

10 posts views Thread by svenn.are | last post: by
1 post views Thread by Rahul | last post: by
reply views Thread by seb.haase | last post: by
8 posts views Thread by dwelch91 | last post: by
3 posts views Thread by Konrad Hinsen | last post: by
5 posts views Thread by Albert-jan Roskam | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.