[Python-bugs-list] [ python-Bugs-529713 ] Linking under AIX failing

noreply@sourceforge.net noreply@sourceforge.net
Fri, 15 Mar 2002 01:11:30 -0800


Bugs item #529713, was opened at 2002-03-14 03:08
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=529713&group_id=5470

Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Bob Plankers (plankers)
Assigned to: Nobody/Anonymous (nobody)
Summary: Linking under AIX failing

Initial Comment:
I am encountering a situation where Python fails to 
link after compiling under AIX, using the VisualAge 
C/C++ 5.0 compilers. After configuring the source with:

env CC=cc CXX=xlC ./configure --prefix=/usr/local --
host=rs6000-ibm-aix4.3.3.0

I issue a 'make' which runs properly until it attempts 
to link:

        ar cr libpython2.2.a Modules/config.o  
Modules/getpath.o  Modules/main.o  Modules/gcmodule.o 
        ar cr libpython2.2.a Modules/threadmodule.o  
Modules/signalmodule.o  Modules/posixmodule.o  
Modules/_sre.o  Modules/newmodule.o  
Modules/symtablemodule.o  Modules/xxsubtype.o
        ranlib libpython2.2.a
        ./Modules/makexp_aix Modules/python.exp "" 
libpython2.2.a;   -Wl,-bE:Modules/python.exp -lld -o 
python  Modules/python.o  libpython2.2.a -ldl    -lm  
/bin/sh: -Wl,-bE:Modules/python.exp:  not found
make: The error code from the last command is 127.


Stop.


...at this point, I can manually issue that last  
command, inserting a "cc_r" before the -Wl,-
bE:Modules/python.exp in the command.

In looking at the Makefile generated, it appears that 
the command to link Python is being issued without the 
proper $(CC) in it. The relative section in the 
Makefile is under "# Build the interpreter". I am not 
familiar with the platform specific build options or 
autoconf, but if you have questions or would like more 
information let me know (bob@plankers.com).

Thank you!

----------------------------------------------------------------------

>Comment By: Martin v. L÷wis (loewis)
Date: 2002-03-15 10:11

Message:
Logged In: YES 
user_id=21627

The chunk on changing LDSHARED to BLDSHARED is definitely right.

On the chunk using $(CC) - I cannot really see why this is
necessary. Right above the AIX assignment of LINKCC, there
is a test with three alternatives ($CXX is empty, it is
needed to link a C++ program, it is not needed). In either
case, LINKCC is set. So it is surprising why LINKCC is then
not set in the right-hand side of the AIX assignment.

Can you please investigate? Perhaps putting echo statements
would be sufficient, or 'set -x' right above that entire
chain of if statements.

Notice that I hesitate to accept your patch because we also
have bug reports where user complain that LINKCC should use
the C++ compiler if available. The test is designed to
enable that feature; your patch would break it.

----------------------------------------------------------------------

Comment By: Bob Plankers (plankers)
Date: 2002-03-15 07:34

Message:
Logged In: YES 
user_id=485432

I am attaching a patch for the linking problem, as well as 
a problem where under AIX the modules were not building at 
all. On a machine where Python is not installed it was 
looking for ld_so_aix in /usr/local/lib/...wherever instead 
of in Modules/ld_so_aix.

The linking problem simply changes a $(LINKCC) to \.

Let me know if this sucks. :-) It seems to work fine 
building under Linux (RHL 7.2) with the patches, but that 
certainly is not a comprehensive test.

----------------------------------------------------------------------

Comment By: Bob Plankers (plankers)
Date: 2002-03-14 17:34

Message:
Logged In: YES 
user_id=485432

Okay, I'll take a look. I should be able to find the 
appropriate spots in configure.in/Makefile.pre.in for the 
$(CC). The problem didn't look so straightforward yesterday 
when I was prowling around in there. :-) Thanks.

----------------------------------------------------------------------

Comment By: Martin v. L÷wis (loewis)
Date: 2002-03-14 08:21

Message:
Logged In: YES 
user_id=21627

Nobody of us has acccess to an AIX system, so if you cannot
figure out what to change, nobody can.

If you suspect that $(CC) needs to be added to some of the
commands, locate the command in the Makefile, and try
whether it works. Then please attach both the original and
the modified Makefile to this report. In turn, we can try to
produce a patch to configure.in which should make it add the
$(CC) automatically. You will then need to verify that the
patch works correctly, at which time we can apply it to the
Python source code in CVS.

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=529713&group_id=5470