[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Compiling 32-bit code on 64-bit HP-UX

From: Boehne, Robert
Subject: RE: Compiling 32-bit code on 64-bit HP-UX
Date: Mon, 15 Sep 2003 11:45:29 -0500


Ok, it sounds like the problem is that Libtool/config.guess/? is using
a C compiler to test certain things.  Because that is the case, you
may also need to set CC, CFLAGS & CPPFLAGS as appropriate.  The reason
I suggest setting +DA in CXXCPPFLAGS is that "+DA2.0w" will cause __LP64__
to be defined.  IIRC, we had a suggestion to change this very thing in the
past, we did, and it caused other problems so we reverted it.



-----Original Message-----
From: Martin Frydl [mailto:address@hidden
Sent: Monday, September 15, 2003 11:11 AM
To: Boehne, Robert
Cc: address@hidden; address@hidden
Subject: Re: Compiling 32-bit code on 64-bit HP-UX

Boehne, Robert wrote:
> Martin,
> Even on a 64-bit capable machine, aCC defaults to 32-bit libraries.
> Having config.guess return hppa2.0w does not change the output that
> is produced, aCC will produce whatever you tell it to (32-bit by default).
> When you're running a configure script you want to set both (for C)
> CPPFLAGS and CFLAGS, for C++ CXXCPPFLAGS and CXXFLAGS when you need to
> pass an option that changes the preprocessing like +DA.  This is generally
> a better option than setting CXX="aCC -DA2.0".  Try this and read
> the Libtool web site regarding contributing if you want to send another patch.

   Unfortunatelly, this solution does not work. libtool determines its 
operation (whether compiling 32 or 64-bit code) according to host type 
set by config.guess. This seems ok. config.guess makes test to check 
whether the compiler generates 32 or 64-bit code. However, the problem 
is that it uses just CC and ignores all flags (including your 
suggested). The only solution is to pass them via CC (I've seen this 
trick some time ago in libtool mailing list). When this trick is used, 
host type is hppa64 and libtool works correctly. The problem is that it 
does not recognize the compiler now - that's fixed by the patch.

   I think this patch also fixes problem discussed some time ago on 
mailing list - about Intel icc compiler. It was solved by adding extra 
"*" to branches in "case $cc_basename". Now it should work without them. 
See (I 
haven't tried this, it's just my assumption).

   BTW, +DA2.0 is not preprocessor option, but the compiler one. It 
determines architecture where the generated code will run - note the 
plus "+" before D instead of minus "-".


> HTH,
> Robert
> -----Original Message-----
> From: Martin Frydl [mailto:address@hidden
> Sent: Thursday, September 11, 2003 3:14 PM
> To: address@hidden; address@hidden
> Subject: Compiling 32-bit code on 64-bit HP-UX
> Hello,
>    I'm trying to create 32-bit shared libraries on 64-bit PA-RISC 2.0 
> (HP-UX 11) with aCC compiler. I have several libraries and executables 
> in my project. When I run them from build directory, everything works 
> fine. However, when I run make install and delete build directory, the 
> executables and libraries stop working. I've looked into them via chatr 
> utility and it shows that they reference build directory as search path, 
> not install one.
>    I've investigated the problem and it looks like it lies in 
> config.guess. config.guess checks host type according to uname and 
> getconf utility which results in "hppa2.0w" (64-bit PA-RISC 2.0). Then 
> there is a check for __LP64__ define, which fails. Here the failure is 
> caused by wrong use of compiler options - it runs:
>    $CC_FOR_BUILD -E -
>    which is not understood by aCC. It should be rewritten to use 
> temporary file instead of "-" (stdin). Moreover, the check does not use 
> compiler flags so the result is not affected by switches determining the 
> "bitness" of resulting code - +DA2.0W (64-bit), +DA2.0N (32-bit), +DA1.1 
> (32-bit PA-RISC 1.1). However, this can be workarounded by putting these 
> directly into CC when running configure.
>    The host type set after the check is not clear enough since it does 
> not correspond to aCC options. When __LP64__ is defined, host type is 
> hppa64, which seems correct if it stands for 64-bit. When the check 
> fails, host type is set to hppa2.0w. However, I think this host type 
> should mean 64-bit since option +DA2.0W to aCC generates 64-bit code.
>    Unfortunatelly, libtool determines 32/64-bit hppa in a way "hppa64 is 
> 64-bit and anything else is 32-bit". There is also problem in libtool.m4 
> regarding options supplied via CC variable. When they are supplied, 
> libtool checks for compiler do not work since cc_basename contains also 
> those options. I've attached simple patch which removes all characters 
> after the first space.
>    Also I don't understand the way config.guess should be copied to 
> project. Currently it is copied by libtoolize from share/libtool, but 
> this one is outdated and current one is in share/automake-1.7. Should I 
> copy it manually from automake?
>    Now here are my conclusions:
> - config.guess does not use CFLAGS when making compilation checks but 
> this can be "fixed" by providing necessary flags directly in CC variable
> - config.guess should be fixed so __LP64__ check works corretly (patch 
> attached)
> - config.guess "generates" host types which do not correspond to aCC (HP 
> native) namings but this cannot be changed
> - there are two config.guess versions when both libtool and automake are 
> installed. libtoolize takes one from libtool, not automake
> - libtool needs to be patched to support options supplied in CC or CXX 
> variables
>    Martin
> _______________________________________________
> Libtool mailing list
> address@hidden

reply via email to

[Prev in Thread] Current Thread [Next in Thread]