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

Douglas C. Schmidt schmidt at dre.vanderbilt.edu
Thu Sep 13 08:29:23 CDT 2007


Hi Dan,

   Thanks for using the PRF.

>    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

There are some glitches with ./configure, I recommend you avoid using
./configure and instead use the "classic" method of
configuring/compiling ACE.  Please see

ACE_ROOT/ACE-INSTALL.html#unix_traditional

Naturally, if you or someone else would like to fix the problems with
./configure that would be great!

Thanks,

        Doug

>			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:
>


-- 
Dr. Douglas C. Schmidt                       Professor and Associate Chair
Electrical Engineering and Computer Science  TEL: (615) 343-8197
Vanderbilt University                        WEB: www.dre.vanderbilt.edu/~schmidt
Nashville, TN 37203                          NET: d.schmidt at vanderbilt.edu



More information about the Ace-users mailing list