Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[tao-bugs] Autotools build system: -D*_AS_STATIC_LIBS not used for static objects

90 views
Skip to first unread message

Vladimir Panov

unread,
Jan 1, 2006, 8:17:03 AM1/1/06
to
TAO VERSION: 1.4.8
ACE VERSION: 5.4.8

HOST MACHINE and OPERATING SYSTEM:

Any.

TARGET MACHINE and OPERATING SYSTEM, if different from HOST:

Not different.

COMPILER NAME AND VERSION (AND PATCHLEVEL):

Any.

THE $ACE_ROOT/ace/config.h FILE [if you use a link to a platform-
specific file, simply state which one]:

Not used.

THE $ACE_ROOT/include/makeinclude/platform_macros.GNU FILE [if you
use a link to a platform-specific file, simply state which one
(unless this isn't used in this case, e.g., with Microsoft Visual
C++)]:

Not used.

CONTENTS OF $ACE_ROOT/bin/MakeProjectCreator/config/default.features
(used by MPC when you generate your own makefiles):

// $Id$
// This is an automatically generated file.

ssl=0
qos=1
cidl=0
rwho=0
sctp=0


AREA/CLASS/EXAMPLE AFFECTED:

Building ACE+TAO produces undesired effects.

DOES THE PROBLEM AFFECT:
COMPILATION?
Yes

LINKING?
Yes.

EXECUTION?
Yes.

OTHER (please specify)?
Building ACE+TAO is affected.

SYNOPSIS:
When using the autotools build system on any OS/compiler, static objects are compiled without ACE_AS_STATIC_LIBS (and TAO_AS_STATIC_LIBS when
compiling TAO) defined.

DESCRIPTION:
This produces the following error messages when starting a statically linked program which uses TAO:

ACE_DLL::open failed for TAO_PI: Error: check log for details.
Unable to find service: ORBInitializer_Registry
ACE_DLL::open failed for TAO_Codeset: Error: check log for details.
Unable to find service: TAO_Codeset

These are result of the code been compiled with dlopen() invocations (as if it is in a shared library). See
ACE_wrappers/TAO/tao/ORBInitializer_Registry.cpp#PortableInterceptor::register_orb_initializer(...) for the source of these error messages.

Even worse: under Linux when TAO's shared libraries are in the library search path (i.e. when dlopen() succeeds) then no error messages are printed
but the program dies with a segmentation fault.

REPEAT BY:

cd ACE_wrappers
mkdir objdir
cd objdir
../configure --enable-static
make
Now create a very simple CORBA program which which uses TAO and links with -static. Then run it.

SAMPLE FIX/WORKAROUND:

I don't have a fix. I think that you should introduce separate CPPFLAGS for static and shared objects throughout the Makefile.am's somehow.

J.T. Conklin

unread,
Jan 1, 2006, 6:30:44 PM1/1/06
to
Hi,

Vladimir Panov <g...@voidland.org> writes:
> SYNOPSIS:
> When using the autotools build system on any OS/compiler, static
> objects are compiled without ACE_AS_STATIC_LIBS (and
> TAO_AS_STATIC_LIBS when compiling TAO) defined.

This is a known, but not documented limitation of the autoconf build,
which is why the AC_DISABLE_STATIC autoconf macro is used to disable
static libraries.

The problem stems from the fact that different compiler options have
to be passed for shared and static objects, but autoconf and libtool
don't seem to have taken this use case into account. I made a half-
hearted attempt on one of the autotools mailing lists to try to find
a solution a couple of months ago, but didn't have much luck.

I agree that being able to build both static and shared libraries in
the same configuration is valuable. Since autoconf development and
maintenance is not sponsored, Any assistance you can offer to help us
make this happen is most welcome. At the very least, please consider
submitting this to the DOC group bugzilla server --- as that will
ensure this won't get lost.

--jtc

--
J.T. Conklin

Vladimir Panov

unread,
Feb 11, 2006, 6:18:55 AM2/11/06
to
J.T. Conklin wrote:

>Hi,
>
>Vladimir Panov <g...@voidland.org> writes:
>
>
>>SYNOPSIS:
>>When using the autotools build system on any OS/compiler, static
>>objects are compiled without ACE_AS_STATIC_LIBS (and
>>TAO_AS_STATIC_LIBS when compiling TAO) defined.
>>
>>
>
>This is a known, but not documented limitation of the autoconf build,
>which is why the AC_DISABLE_STATIC autoconf macro is used to disable
>static libraries.
>
>The problem stems from the fact that different compiler options have
>to be passed for shared and static objects, but autoconf and libtool
>don't seem to have taken this use case into account. I made a half-
>hearted attempt on one of the autotools mailing lists to try to find
>a solution a couple of months ago, but didn't have much luck.
>
>
>

Hi, J.T.

I can propose you the following workaround:

1. Make it impossible for the user to select both --enable-static and


--enable-shared for a single run of configure.
2. If --enable-static is used, then add -DACE_AS_STATIC_LIBS and
-DTAO_AS_STATIC_LIBS to $CPPFLAGS.

Vlado

0 new messages