This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: HP-UX11i: illegal combination of compilation and link flags
Type: crash Stage: test needed
Components: Build, Installation Versions: Python 2.6
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: anthonybaxter, georg.brandl, rwgk
Priority: normal Keywords:

Created on 2006-04-06 16:53 by rwgk, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (7)
msg60899 - (view) Author: Ralf W. Grosse-Kunstleve (rwgk) Date: 2006-04-06 16:53
According to Boris Gubenko from the HP-UX compiler
development team, it is illegal to link with -lpthread
if the sources are not compiled with -mt. However, this
is exactly what happens during Python installation, e.g.:

        cc -Ae -c  -DNDEBUG -O  -I. -I./Include  
-DPy_BUILD_CORE -o Python/compile.o Python/compile.c
...
         aCC  -Wl,-E -Wl,+s -o python \
                        Modules/python.o \
                        libpython2.5.a -lnsl -lrt -ldld
-ldl  -lpthread   -lm  

This illegal combination of compilation and link flags
eventually results in obscure runtime failures
(segfault, abort) while running Boost.Python C++
extensions. These failures go away if Python is
installed with, e.g.:

env CXX="aCC -mt" BASECFLAGS="-mt" ./configure
--without-gcc

I suggest changing the configure/make files to always
include "-mt" if threading is enabled.

BTW: The same issue already exists for Python 2.4.

Cheers,
        Ralf
msg60900 - (view) Author: Anthony Baxter (anthonybaxter) (Python triager) Date: 2006-04-09 15:30
Logged In: YES 
user_id=29957

Hm. We need to detect if we're on HP/UX, of course. Is this
option for all versions? And I assume it's only for the HP
compiler, not gcc?
msg60901 - (view) Author: Ralf W. Grosse-Kunstleve (rwgk) Date: 2006-04-10 19:44
Logged In: YES 
user_id=71407

> Hm. We need to detect if we're on HP/UX, of course. Is
> this option for all versions?

I guess so since it seems very fundamental, but I am not
sure. I alerted Boris Gubenko to this problem report. I hope
he will help out.

> And I assume it's only for the HP compiler, not gcc?

I don't know. I imagine gcc has similar issues since it does
link with the same -lpthread eventually.

Note that the machine I used is publically accessible:

http://www.testdrive.hp.com/

After you register on the web:

telnet td176.testdrive.hp.com

gcc 3.4.3 is installed.
msg60902 - (view) Author: Ralf W. Grosse-Kunstleve (rwgk) Date: 2006-04-10 23:58
Logged In: YES 
user_id=71407

Boris Gubenko from HP provides this information:


Hi Ralf,

the -mt option sets -lpthread link option and defines
various macros
related to multithreading, including _REENTRANT macro. It
must be
specified when compiling/linking a multithreaded application.

The -mt option is supported in latest aCC compilers,
including the
aCC V6 compiler (available on IA64 only). I'm not sure if -mt is
supported in old aCC V3 compiler available on PA-RISC only,
but since
Python cannot be compiled with this compiler, this question is,
probably, moot. If configuration script wants to be
selective about
the aCC compiler version, it can check __HP_aCC macro
predefined by
the compiler and apply '-mt' if __HP_aCC >= 60000.

As for the gnu compiler, I think, that the equivalent of
'-mt' would
be '-pthreads' (for cxx on Tru64, it would be '-pthread').

I don't know how to reply to the post on Python forum you've
referred
me to. I guess, I'd need to register for an account. I can
do it if
you want me to. Or you can just post it on my behalf.

Thanks,
  Boris

----- Original Message ----- 
From: "Ralf W. Grosse-Kunstleve" <rwgk@yahoo.com>
To: <Boris.Gubenko@hp.com>
Cc: <rwgk@yahoo.com>
Sent: Sunday, April 09, 2006 2:11 PM
Subject: HP-UX Python configure


Hi Boris,

Could you please help out here?

https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1465838&group_id=5470

Especially with this question: "Is this option for all
versions?"

Thank you in advance!

Cheers,
        Ralf
msg114589 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2010-08-21 22:51
Is this still relevant?
msg114593 - (view) Author: Ralf W. Grosse-Kunstleve (rwgk) Date: 2010-08-21 22:58
I've no access to HP machines anymore.
It's probably not worth anybody's time.
Ralf
msg114597 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2010-08-21 23:05
OK, closing.
History
Date User Action Args
2022-04-11 14:56:16adminsetgithub: 43174
2010-08-21 23:05:59georg.brandlsetstatus: open -> closed
resolution: out of date
messages: + msg114597
2010-08-21 22:58:34rwgksetmessages: + msg114593
2010-08-21 22:51:30georg.brandlsetnosy: + georg.brandl
messages: + msg114589
2009-03-21 02:03:33ajaksu2setstage: test needed
type: crash
components: + Build
versions: + Python 2.6, - Python 2.5
2006-04-06 16:53:36rwgkcreate