Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Installing Python problems (_socket.so)

2 views
Skip to first unread message

Sam Carleton

unread,
Jan 12, 2003, 1:30:07 PM1/12/03
to
I am trying to get Python 2.2.2 installed on a Solaris 8 (SPARC)
machine. I have OpenSSL 0.9.7 installed successfully on the machine
in questions. When compiling, this is a snip of the output:

X509_PUBKEY_get 0x7d8
/usr/local/ssl/lib/libcrypto.a(x_pubkey.o)
X509_PUBKEY_get 0x3a8
/usr/local/ssl/lib/libcrypto.a(x509_req.o)
ld: fatal: relocations remain against allocatable but non-writable
sections
collect2: ld returned 1 exit status
skipping /export/home/sam/src/Python-2.2.2/Modules/socketmodule.c
(build/temp.solaris-2.8-sun4u-2.2/socketmodule.o up-to-date)
gcc -shared build/temp.solaris-2.8-sun4u-2.2/socketmodule.o
-L/usr/local/ssl/lib -L/usr/local/lib -Wl,-R/usr/local/ssl/lib -lssl
-lc
rypto -o build/lib.solaris-2.8-sun4u-2.2/_socket.so
WARNING: building of extension "_socket" failed: command 'gcc' failed
with exit status 1
skipping 'dbm' extension (up-to-date)

There does not seem to be much info here. Is there any way I can get
more info as to solve the problem?

Sam

"Martin v. Löwis"

unread,
Jan 12, 2003, 4:24:00 PM1/12/03
to
Sam Carleton wrote:
> ld: fatal: relocations remain against allocatable but non-writable
> sections
[...]

> There does not seem to be much info here. Is there any way I can get
> more info as to solve the problem?

That is the problem: You are linking a shared library, but some of your
code (the OpenSSL code) is position-dependent, when it should be
position-independent (PIC).

You have the following options:
1. Accept the failure; your Python installation won't support sockets.
2. Build the socket module without SSL support. To do so, edit
Modules/Setup.
3. Rebuilt OpenSSL for position-independent code. To do so, either
a) build openssl with --enable-shared, and link the socket module
with the shared library, or
b) manually add -fPIC/-KPIC when building OpenSSL. This will still
give a static library, but it will be PIC.
4. Work around the failure, by telling the linker that it is ok to
incorporate PIC code to a shared library. To do so, either
a) Use the system compiler (SunPRO/Forte/SunONE)) instead of
gcc, or
b) Use gnu binutils instead of the system linker, or
c) Manually add -mimpure-text to the C compiler flags for linking.

If you want to know why a certain alternative solves this problem, just
ask. There are a few options that also appear to solve the problem but
don't, namely

4 d) Use the system linker instead of gcc for linking
e) Use -G instead of -shared for linking

HTH,
Martin


Andrew McGregor

unread,
Jan 13, 2003, 12:02:07 AM1/13/03
to
You're trying to link a mixed shared-static library setup and your linker
is messing up. It is possible that the OpenSSL build didn't work right.
The real problem is a few lines earlier in the output; can you send it from
the previous ld or gcc command?

Andrew

--On Sunday, January 12, 2003 10:30:07 -0800 Sam Carleton
<nos...@miltonstreet.com> wrote:

> --
> http://mail.python.org/mailman/listinfo/python-list
>
>

0 new messages