[Ace-users] Unable to create a fully statically linked libACE.a

djh danjhiggi at gmail.com
Wed Sep 12 11:32:42 CDT 2007


Subject: [area]: Unable to create a fully statically linked libACE.a

    ACE VERSION: 5.6

    HOST MACHINE and OPERATING SYSTEM:
			x86_64 GNU/Linux Fedora core 6

    TARGET MACHINE and OPERATING SYSTEM, if different from HOST: same
    COMPILER NAME AND VERSION (AND PATCHLEVEL): gcc version 4.1.2

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

     I used ../configure --enable-static CPPFLAGS=-m32 CXXFLAGS=-m32

    THE $ACE_ROOT/include/makeinclude/platform_macros.GNU FILE:

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

    AREA/CLASS/EXAMPLE AFFECTED:
			Runtime failures when trying to build statically

    DOES THE PROBLEM AFFECT:
      EXECUTION

    SYNOPSIS:
			Runtime dependencies after compiling statically

    DESCRIPTION:
			I'm trying to build a statically linked 32bit executable on my
x86_64 linux box.

			I ran configure using the following lines
      $ cd $ACE_ROOT
      $ mkdir build
      $ cd build
      $ ../configure --enable-static CPPFLAGS=-m32 CXXFLAGS=-m32

			The -m32 worked fine. The subsequent compile generated a libACE.a.

      When I try to compile my code, I use the -static linker option
to ensure there are no runtime dependencies.

			Linker output:

				g++ -static -m32 -Wall -g -D_REENTRANT -DACE_HAS_AIO_CALLS
				-DACE_HAS_EXCEPTIONS -D__ACE_INLINE__ -D_GNU_SOURCE
ClientAcceptor.o
				ClientService.o TestClientAcceptor.o -Wl,-E -L/opt/ace/ace -L./
				-L. -L../../../lib -L/opt/gcc/lib -L/tmp/lib -lstdc++ -o reactor -
lACE
				-ldl -lpthread -lrt

				/tmp/lib/libACE.a(libACE_la-DLL_Manager.o): In function
				`ACE_DLL_Handle::open(char const*, int, void*)':
				DLL_Manager.cpp:(.text+0x1c42): warning: Using 'dlopen' in
statically
				linked applications requires at runtime the shared libraries from
the
				glibc version used for linking

	Doesn't this mean that the object files in libACE.a still have
runtime dependencies(to libc)?
      How do I modify my ./configure options to force ACE to
statically link in glibc?


    REPEAT BY:

    SAMPLE FIX/WORKAROUND:



More information about the Ace-users mailing list