Discussion:
[omniORB] autoconf build problem on HP-UX - wrong alloca used
Eric McMillan
2006-07-17 22:56:29 UTC
Permalink
I've been working on porting omniORB to HP-UX/Itanium, and ran into a
problem when using configure to generate the build files. It manifested as
an error preprocessing ir.idl with omnicpp. After much debugging, I found
that it was the build of omnicpp that was the issue. In the traditional
build process, the config.h file includes the config-hpux.h file, which
defines HAVE_ALLOCA and includes HP's <alloca.h>. Configure doesn't set
HAVE_ALLOCA or include <alloca.h>, so the omniORB supplied alloca.c is used.
This doesn't work correctly on HP-UX/Itanium with aCC compiler 6.0 and
beyond. It looks like the routine to determine stack direction changes when
compiled with optimization vs. no optimization. The simple fix is to add
HAVE_ALLOCA and the #include <alloca.h> to the acconfig.h file. More
generically, configure should test for alloca support and use the vendor
supplied version, if available. Minor changes will need to be made to both
cccp.c and cexp.c to include <alloca.h> when configure determines it is
available.



This will probably also effect AIX, VMS and Linux, since they all provide an
alloca().





-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20060717/ae6318c1/attachment.htm
Duncan Grisby
2006-07-27 15:56:35 UTC
Permalink
Post by Eric McMillan
I've been working on porting omniORB to HP-UX/Itanium, and ran into a
problem when using configure to generate the build files. It manifested as
an error preprocessing ir.idl with omnicpp. After much debugging, I found
that it was the build of omnicpp that was the issue. In the traditional
build process, the config.h file includes the config-hpux.h file, which
defines HAVE_ALLOCA and includes HP's <alloca.h>. Configure doesn't set
HAVE_ALLOCA or include <alloca.h>, so the omniORB supplied alloca.c is used.
This doesn't work correctly on HP-UX/Itanium with aCC compiler 6.0 and
beyond. It looks like the routine to determine stack direction changes when
compiled with optimization vs. no optimization. The simple fix is to add
HAVE_ALLOCA and the #include <alloca.h> to the acconfig.h file. More
generically, configure should test for alloca support and use the vendor
supplied version, if available. Minor changes will need to be made to both
cccp.c and cexp.c to include <alloca.h> when configure determines it is
available.
Can you provide a patch that makes it work for you? The place to put
the #include <alloca.h> will be in config.h, not in the files that use
it.

Cheers,

Duncan.
--
-- Duncan Grisby --
-- ***@grisby.org --
-- http://www.grisby.org --
Loading...