[Dbbalancer-users] Re: Building static binary
Status: Alpha
Brought to you by:
xperience
From: Daniel V. S. <dv...@ar...> - 2001-11-03 19:40:27
|
That's curious. The missing symbols are from librt. My dynamic binary links to it, as libACE does. But my static builds doesn't seem to need it, even being those symbols undefined in my libACE.a. I suppose that the ACE functionality that needs librt isn't being used, but your compiler complains anyway. I suppose that a good solution is to add -lrt to the static build line. It doesn't hurt my build, anyway. I've added it to next version. Regards On Sat 03 Nov 2001 10:27, you wrote: > Flush with my success of getting a new 0.4.0-2 Debian package out for > dbbalancer I thought I would have a go at building a static binary so > that I can put it on one of our servers and see how it flies in the real > world... > > Alas, no luck: > > c++ -g -O2 -D_REENTRANT -pthread -static -o dbbalancerd.static > DBBalancer.o DBBalancerDaemon.o config/DBBalancerTxtConfig.o > postgres/DBPostgresPooledConnection.o > postgres/DBPostgresWriterConnection.o postgres/DBPostgresBackend.o > postgres/DBPostgresFrontend.o conn_pool/DBPool.o > conn_pool/DBPoolContainer.o conn_pool/DBPooledConnection.o > thread_pool/DBThreadPool.o thread_pool/DBThreadCtlMO.o > method_objects/DBDoConnectionMO.o method_objects/DBManagementMO.o -lACE > -ldl > /usr/lib/libACE.a(OS.o): In function `ACE_OS::thr_create(void *(*)(void > *), void *, long, unsigned long *, unsigned long *, long, void *, > unsigned int, ACE_Thread_Adapter *)': > OS.o(.text+0xe91): the use of `pthread_attr_setstackaddr' is deprecated, > use `pthread_attr_setstack' > /usr/lib/libACE.a(POSIX_Proactor.o): In function > `ACE_POSIX_AIOCB_Proactor::handle_events(unsigned long)': > POSIX_Proactor.o(.text+0x17b5): undefined reference to `aio_suspend' > /usr/lib/libACE.a(POSIX_Proactor.o): In function > `ACE_POSIX_AIOCB_Proactor::find_completed_aio(int &, int &)': > POSIX_Proactor.o(.text+0x197f): undefined reference to `aio_error' > POSIX_Proactor.o(.text+0x1ad3): undefined reference to `aio_return' > /usr/lib/libACE.a(POSIX_Proactor.o): In function > `ACE_POSIX_SIG_Proactor::handle_events(unsigned long)': > POSIX_Proactor.o(.text+0x3317): undefined reference to `aio_error' > POSIX_Proactor.o(.text+0x3455): undefined reference to `aio_return' > /usr/lib/libACE.a(POSIX_Proactor.o): In function > `ACE_POSIX_AIOCB_Proactor::start_aio(ACE_POSIX_Asynch_Result *, int)': > POSIX_Proactor.o(.text+0x3ce2): undefined reference to `aio_read' > POSIX_Proactor.o(.text+0x3cf4): undefined reference to `aio_write' > /usr/lib/libACE.a(POSIX_Asynch_IO.o): In function > `ACE_POSIX_Asynch_Operation::cancel(void)': > POSIX_Asynch_IO.o(.text+0x161): undefined reference to `aio_cancel' > /usr/lib/libACE.a(POSIX_Asynch_IO.o): In function > `ACE_POSIX_SIG_Asynch_Read_File::read(ACE_Message_Block &, unsigned > long, unsigned long, unsigned long, void const *, int, int)': > POSIX_Asynch_IO.o(.text+0x161a): undefined reference to `aio_read' > /usr/lib/libACE.a(POSIX_Asynch_IO.o): In function > `ACE_POSIX_SIG_Asynch_Write_File::write(ACE_Message_Block &, unsigned > long, unsigned long, unsigned long, void const *, int, int)': > POSIX_Asynch_IO.o(.text+0x1e4a): undefined reference to `aio_write' > /usr/lib/libACE.a(POSIX_Asynch_IO.o): In function > `ACE_POSIX_SIG_Asynch_Read_Stream::shared_read(ACE_POSIX_Asynch_Read_Stream >_Result *)': POSIX_Asynch_IO.o(.text+0x6909): undefined reference to > `aio_read' /usr/lib/libACE.a(POSIX_Asynch_IO.o): In function > `ACE_POSIX_SIG_Asynch_Write_Stream::shared_write(ACE_POSIX_Asynch_Write_Str >eam_Result *)': POSIX_Asynch_IO.o(.text+0x6cc9): undefined reference to > `aio_write' collect2: ld returned 1 exit status > make: *** [static] Error 1 > > This strikes me as odd - that I can build a dynamically linked binary, > but that I can't build a static! > > Regards, > Andrew. -- ---------------------------------- Regards from Spain. Daniel Varela ---------------------------------- If you think education is expensive, try ignorance. -Derek Bok (Former Harvard President) |