[Python-bugs-list] [ python-Bugs-694431 ] Python 2.3a2 Build fails on HP-UX11i

SourceForge.net noreply@sourceforge.net
Sat, 29 Mar 2003 13:55:24 -0800


Bugs item #694431, was opened at 2003-02-27 10:44
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=694431&group_id=5470

Category: Build
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Richard Townsend (rptownsend)
Assigned to: Neal Norwitz (nnorwitz)
Summary: Python 2.3a2 Build fails on HP-UX11i

Initial Comment:
While building Python 2.3a2 on HP-UX11i I got the 
following error:

ld -b build/temp.hp-ux-B.11.11-9000/785-
2.3/_iconv_codec.o -L/opt/python/lib -
L/usr/local/lib -o build/lib.hp-ux-B.11.11-
9000/785-2.3/_iconv_codec.sl
/usr/lib/dld.sl: Unresolved symbol: libiconv_open 
(code)  from build/lib.hp-ux-B.11.11-9000/785-
2.3/_iconv_codec.sl
sh[3]: 25624 Abort(coredump)
*** Error exit code 134


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

>Comment By: Neal Norwitz (nnorwitz)
Date: 2003-03-29 16:55

Message:
Logged In: YES 
user_id=33168

This means the iconv_open() call is failing.  Unless you
know you need this module, you probably don't.  And if you
do need this module, you probably know more than I do. :-) 
So if you are just trying to get this working, I don't think
it's a big deal.  It seems to work on some HPUX machines.  I
suspect the reason the iconv_open() is failing is because of
a configuration on your machine.  This call is for
translating character sets.

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

Comment By: Richard Townsend (rptownsend)
Date: 2003-03-26 11:26

Message:
Logged In: YES 
user_id=200117

Hi Neal,

I edited Modules/Setup line 483 like this:

_iconv_codec _iconv_codec.c -I/usr/include

I can now build Python! 

However test_iconv_codecs fails:

capulet:dist/src 
> ./python ./Lib/test/test_iconv_codecs.py
Traceback (most recent call last):
  File "./Lib/test/test_iconv_codecs.py", line 3, in ?
    import codecs, _iconv_codec
RuntimeError: can't initialize the _iconv_codec module: 
iconv_open() failed


I tried adding '-l:libdld.sl' to line 483 (as suggested by 
the man page) but
the test still fails.



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

Comment By: Richard Townsend (rptownsend)
Date: 2003-03-26 09:43

Message:
Logged In: YES 
user_id=200117

Hi Neal,

I have now discovered that there is a different version of 
iconv.h on my workstation in /usr/local/include.

It appears to be part of the zlib package and it contains 
the pre-processor macros which are converting the 
iconv statements to libiconv.

It is being used instead of the one in /usr/include, 
because the compile command contains 
-I/usr/local/include 

Is there any easy to prevent this path from being added 
to the compile commands? 



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

Comment By: Richard Townsend (rptownsend)
Date: 2003-03-25 12:51

Message:
Logged In: YES 
user_id=200117

Neal,

The original error referred to unresolved 
symbol 'libiconv_open'.

The source module _iconv_codec.c contains calls to 
iconv_open(), not libiconv_open().

However, if I recompile it with the -E flag there is a pre-
processor substitution happening which is converting 
all instances of 'iconv' to 'libiconv'

Here I grepped the pre-processor output for 'iconv'...

extern int _libiconv_version;
typedef void* libiconv_t ;
extern libiconv_t  libiconv_open  (const char* tocode, 
const char* fromcode);
extern size_t libiconv  (libiconv_t  cd,  char* * inbuf, 
size_t *inbytesleft, char* * outbuf, size_t *outbytesleft);
extern int libiconv_close  (libiconv_t  cd);
extern int libiconvctl  (libiconv_t  cd, int request, void* 
argument);
    libiconv_t   enchdl, dechdl;
        if (libiconv (self->enchdl, (char**)&inp, &inplen, 
&out, &outlen)
        size_t res = libiconv (self->dechdl, (char**)&inp, 
&inplen, &out, &outlen);
    new->enchdl = new->dechdl = (libiconv_t )(-1);
    new->dechdl = libiconv_open ("ucs-2-internal" , 
new->encoding);
    if (new->dechdl == (libiconv_t )(-1)) {
    new->enchdl = libiconv_open (new->encoding, "ucs-
2-internal" );
    if (new->enchdl == (libiconv_t )(-1)) {
        libiconv_close (new->dechdl);
        new->dechdl = (libiconv_t )(-1);
    if (self->enchdl != (libiconv_t )-1)
        libiconv_close (self->enchdl);
    if (self->dechdl != (libiconv_t )-1)
        libiconv_close (self->dechdl);
    libiconv_t  hdl = libiconv_open ("ucs-2-
internal" , "ISO-8859-1");
    if (hdl == (libiconv_t )-1) {
    res = libiconv (hdl, &inptr, &insize, &outptr, &outsize);
        libiconv_close (hdl);
    libiconv_close (hdl);

Is this supposed to be happening??

If not, what could be causing it??



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

Comment By: Neal Norwitz (nnorwitz)
Date: 2003-03-23 10:52

Message:
Logged In: YES 
user_id=33168

Looking further into the python configure, I see that the
option is --with-dl-dld, however, this option is not
supported.  Can try to play with the build options to find
the magic that works on your version of HPUX?

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

Comment By: Neal Norwitz (nnorwitz)
Date: 2003-03-23 10:48

Message:
Logged In: YES 
user_id=33168

Richard, in the manpage it says that iconv has a dependancy
on libdld.sl.  Perhaps you need to configure python
--with-dld.  Can you try that?

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

Comment By: Richard Townsend (rptownsend)
Date: 2003-03-04 12:09

Message:
Logged In: YES 
user_id=200117

Neal, I will try to help, but internet access is difficult at 
work so responses may not be prompt.

I had a look at the man page but it was not clear to me 
which library contains iconv_open. I will attach text 
copy of the man page for you.

I also include some nm output from libc.sl which refers 
to iconv_open, but I'm not sure if it means that it 
contains the code for the function.

Let me know if I can try anything else.


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

Comment By: Neal Norwitz (nnorwitz)
Date: 2003-03-03 17:15

Message:
Logged In: YES 
user_id=33168

Richard, can you help diagnose further since I can't
reproduce on HP-UX 11.00?  My initial guess is that
iconv_open is in a different location, therefore the linking
is faililng.  Does man iconv_open reveal what library
iconv_open is in?  To add directories, etc. to the
build/link of iconv, you will need to edit setup.py (or test
on the command line).   Check around line 620 in setup.py.

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

Comment By: Richard Townsend (rptownsend)
Date: 2003-03-03 04:14

Message:
Logged In: YES 
user_id=200117

Sorry for the delay but I had to download from CVS at 
home yesterday (Sunday 2nd) and build on HP-UX at 
work today.

Unfortunately I'm still getting the same linker error.

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

Comment By: Neal Norwitz (nnorwitz)
Date: 2003-02-28 12:37

Message:
Logged In: YES 
user_id=33168

This iconv_codec problem may be fixed.  Please test with
current CVS to verify.
See SF bug #690012.

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

Comment By: Neal Norwitz (nnorwitz)
Date: 2003-02-27 22:45

Message:
Logged In: YES 
user_id=33168

Richard, can you try the latest version from CVS.  I don't
have this problem on hp-ux-B.11.00-9000/829

I do have a problem with readline, but I think that's
specific to the machine I'm building on.

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

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