Help Compiling 64bit Python

J

John Abel

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
 
M

Martin v. =?iso-8859-15?q?L=F6wis?=

John Abel said:
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
 
J

John Abel

Martin said:
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
 
M

Martin v. =?iso-8859-15?q?L=F6wis?=

John Abel said:
[...]
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
 
J

John Abel

Martin said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,981
Messages
2,570,188
Members
46,731
Latest member
MarcyGipso

Latest Threads

Top