automake
[Top][All Lists]
Advanced

[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: Thu, 11 Sep 2003 16:24:47 -0500

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.
http://www.gnu.org/software/libtool/contribute.html

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




reply via email to

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