Bacula-users

Re: [Bacula-users] failing to build a statically linked bacula-fd (3.0.1)

2009-06-15 09:14:11
Subject: Re: [Bacula-users] failing to build a statically linked bacula-fd (3.0.1)
From: Thomas <thomas AT ic3s DOT de>
To: bacula-users AT lists.sourceforge DOT net
Date: Mon, 15 Jun 2009 14:52:40 +0200
hi,

my first try was:

./configure --enable-static-fd --enable-client-only

configure-output
  Statically Linked FD:    yes

make
.....
Linking bacula-fd ...
/home/thomas/bacula-3.0.1/libtool --silent --tag=CXX --mode=link 
/usr/lib/ccache/g++   -L../lib
-L../findlib
......

and the result was a dynamically linked bacula-fd.


in the configure script i found:

 --enable-libtool        enable building using GNU libtool [default=yes]


and ~23.000 lines deeper:


if test "${enable_static_fd+set}" = set; then
  enableval=$enable_static_fd;
       if test x$enableval = xyes; then
          if test x$use_libtool = xyes; then
             echo "Libtool is enabled, not compatible with static tools, please 
rerun configure with
--disable-libtool"
             exit 1


so i tried to compile with

./configure --enable-static-fd --enable-client-only --enable-libtool=no

now the gcc tries to build a static binary, but it fails:

Linking bacula-fd ...
/usr/lib/ccache/g++   -L../lib -L../findlib -o bacula-fd filed.o authenticate.o 
acl.o backup.o
estimate.o fd_plugins.o accurate.o filed_conf.o heartbeat.o job.o pythonfd.o 
restore.o status.o
verify.o verify_vol.o xattr.o \
           -lacl -lz               -lbacfind -lbacpy -lbaccfg -lbac -lm  
-lpthread -ldl  \
             -lssl -lcrypto

/usr/lib/ccache/g++   -static -L../lib -L../findlib -o static-bacula-fd filed.o 
authenticate.o
acl.o backup.o estimate.o fd_plugins.o accurate.o filed_conf.o heartbeat.o 
job.o pythonfd.o
restore.o status.o verify.o verify_vol.o xattr.o \
            -lacl -lz              -lbacfind -lbacpy -lbaccfg -lbac -lm  
-lpthread -ldl  \
              -lssl -lcrypto
/usr/bin/ld: cannot find -lz
collect2: ld gab 1 als Ende-Status zurück
make[1]: *** [static-bacula-fd] Fehler 1
make[1]: Leaving directory `/home/thomas/bacula-3.0.1/src/filed'



so, i think this is a bug in the configure-script.



Gerald Leier schrieb:
> hello,
> 
> i just tried with some extended options (disabled openssl, set "global"
> static flag)
> 
> ./configure --prefix=/usr/bacula \
>             --sbindir=/usr/bacula/bin \
>             --sysconfdir=/usr/bacula/bin \
>             --with-scriptdir=/usr/bacula/bin \
>             --enable-smartalloc \
>             --enable-client-only \
>             --enable-static-fd \
>             --enable-static \
>             --with-openssl=no
> 
> but still no static binary:
> 
> sles10-i386:/usr/src/bacula-3.0.1 # ldd /usr/bacula/bin/bacula-fd
>         linux-gate.so.1 =>  (0xffffe000)
>         libz.so.1 => /lib/libz.so.1 (0xb7f9b000)
>         libbacfind.so.1 => /usr/bacula/lib/libbacfind.so.1 (0xb7f8f000)
>         libbacpy.so.1 => /usr/bacula/lib/libbacpy.so.1 (0xb7f8d000)
>         libbaccfg.so.1 => /usr/bacula/lib/libbaccfg.so.1 (0xb7f86000)
>         libbac.so.1 => /usr/bacula/lib/libbac.so.1 (0xb7f43000)
>         libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb7e5f000)
>         libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb7e54000)
>         libpthread.so.0 => /lib/libpthread.so.0 (0xb7e3f000)
>         libdl.so.2 => /lib/libdl.so.2 (0xb7e3b000)
>         libm.so.6 => /lib/libm.so.6 (0xb7e16000)
>         libc.so.6 => /lib/libc.so.6 (0xb7cf3000)
>         /lib/ld-linux.so.2 (0xb7fbd000)
> 
> sles10-i386:/usr/src/bacula-3.0.1 # ldd /usr/bacula/bin/static-bacula-fd
>         linux-gate.so.1 =>  (0xffffe000)
>         libz.so.1 => /lib/libz.so.1 (0xb7f1a000)
>         libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb7e36000)
>         libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb7e2b000)
>         libpthread.so.0 => /lib/libpthread.so.0 (0xb7e16000)
>         libdl.so.2 => /lib/libdl.so.2 (0xb7e11000)
>         libm.so.6 => /lib/libm.so.6 (0xb7dec000)
>         libc.so.6 => /lib/libc.so.6 (0xb7cca000)
>         /lib/ld-linux.so.2 (0xb7f3c000)
> 
> Configuration on Mon Jun 15 07:30:23 EDT 2009:
> 
>    Host:                    i686-pc-linux-gnu -- suse 10
>    Bacula version:          Bacula 3.0.1 (30 April 2009)
>    Source code location:    .                           
>    Install binaries:        /usr/bacula/bin             
>    Install libraries:       /usr/bacula/lib             
>    Install config files:    /usr/bacula/bin             
>    Scripts directory:       /usr/bacula/bin             
>    Archive directory:                                   
>    Working directory:       /usr/bacula/var/bacula/working
>    PID directory:           /var/run                      
>    Subsys directory:        /var/lock/subsys              
>    Man directory:           ${datarootdir}/man            
>    Data directory:          /usr/bacula/share             
>    Plugin directory:        /usr/bacula/lib               
>    C Compiler:              gcc 4.1.2                     
>    C++ Compiler:            /usr/bin/g++ 4.1.2            
>    Compiler flags:           -g -O2 -Wall -fno-strict-aliasing
> -fno-exceptions -fno-rtti
>    Linker
> flags:                                                                        
>    Libraries:               -lpthread
> -ldl                                              
>    Statically Linked Tools:
> no                                                          
>    Statically Linked FD:
> yes                                                         
>    Statically Linked SD:
> no                                                          
>    Statically Linked DIR:
> no                                                          
>    Statically Linked CONS:
> no                                                          
>    Database type:
> None                                                        
>    Database
> port:                                                                       
>    Database
> lib:                                                                        
>    Database name:
> bacula                                                      
>    Database user:
> bacula                                                      
> 
>    Job Output Email:        root@localhost
>    Traceback Email:         root@localhost
>    SMTP Host Address:       localhost     
> 
>    Director Port:           9101
>    File daemon Port:        9102
>    Storage daemon Port:     9103
> 
>    Director User:           
>    Director Group:          
>    Storage Daemon User:     
>    Storage DaemonGroup:     
>    File Daemon User:        
>    File Daemon Group:       
> 
>    SQL binaries Directory   
> 
>    Large file support:      yes
>    Bacula conio support:    yes -lncurses
>    readline support:        no           
>    TCP Wrappers support:    no           
>    TLS support:             no           
>    Encryption support:      no           
>    ZLIB support:            yes          
>    enable-smartalloc:       yes          
>    enable-lockmgr:          no           
>    bat support:             no           
>    enable-gnome:            no           
>    enable-bwx-console:      no           
>    enable-tray-monitor:     no           
>    client-only:             yes          
>    build-dird:              yes          
>    build-stored:            yes          
>    ACL support:             no           
>    XATTR support:           yes          
>    Python support:          no           
>    Batch insert enabled:    no
> 
> 
> 
> 
> On Mon, 2009-06-15 at 13:02 +0200, Gerald Leier wrote:
>> Hello,
>>
>> I am having problems compiling a statically linked bacula-fd
>> suitable for putting on a rescue/recovery installation.
>>
>> cd bacula-3.0.1
>>
>> make clean
>> ./configure     --prefix=/usr/bacula \
>>                 --sbindir=/usr/bacula/bin \
>>                 --sysconfdir=/usr/bacula/bin \
>>                 --with-scriptdir=/usr/bacula/bin \
>>                 --enable-smartalloc \
>>                 --enable-client-only \
>>                 --enable-static-fd
>>
>> make ; make install
>>
>> ldd /usr/bacula/bin/bacula-fd
>>         linux-gate.so.1 =>  (0xffffe000)
>>         libz.so.1 => /lib/libz.so.1 (0xb7fb2000)
>>         libbacfind.so.1 => /usr/bacula/lib/libbacfind.so.1 (0xb7fa6000)
>>         libbacpy.so.1 => /usr/bacula/lib/libbacpy.so.1 (0xb7fa4000)
>>         libbaccfg.so.1 => /usr/bacula/lib/libbaccfg.so.1 (0xb7f9d000)
>>         libbac.so.1 => /usr/bacula/lib/libbac.so.1 (0xb7f53000)
>>         libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb7e6f000)
>>         libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb7e64000)
>>         libpthread.so.0 => /lib/libpthread.so.0 (0xb7e4f000)
>>         libdl.so.2 => /lib/libdl.so.2 (0xb7e4b000)
>>         libssl.so.0.9.8 => /usr/lib/libssl.so.0.9.8 (0xb7e0e000)
>>         libcrypto.so.0.9.8 => /usr/lib/libcrypto.so.0.9.8 (0xb7ce5000)
>>         libm.so.6 => /lib/libm.so.6 (0xb7cc0000)
>>         libc.so.6 => /lib/libc.so.6 (0xb7b9e000)
>>         /lib/ld-linux.so.2 (0xb7fd4000)
>>
>> i assumed that there should be no dependencies on any shared libs with a
>> statically built bacula.
>>
>> has anyone an idea what i do wrong?
>>
>> thanks
>>  gerald
>>
>> below is the output after a successfull "./configure run"
>> ------------------------------------------------------------------------
>> Configuration on Mon Jun 15 06:50:56 EDT 2009:
>>
>>    Host:                    i686-pc-linux-gnu -- suse 10
>>    Bacula version:          Bacula 3.0.1 (30 April 2009)
>>    Source code location:    .                           
>>    Install binaries:        /usr/bacula/bin             
>>    Install libraries:       /usr/bacula/lib             
>>    Install config files:    /usr/bacula/bin             
>>    Scripts directory:       /usr/bacula/bin             
>>    Archive directory:                                   
>>    Working directory:       /usr/bacula/var/bacula/working
>>    PID directory:           /var/run                      
>>    Subsys directory:        /var/lock/subsys              
>>    Man directory:           ${datarootdir}/man            
>>    Data directory:          /usr/bacula/share             
>>    Plugin directory:        /usr/bacula/lib               
>>    C Compiler:              gcc 4.1.2                     
>>    C++ Compiler:            /usr/bin/g++ 4.1.2            
>>    Compiler flags:           -g -O2 -Wall -fno-strict-aliasing
>> -fno-exceptions -fno-rtti
>>    Linker
>> flags:                                                                       
>>  
>>    Libraries:               -lpthread
>> -ldl                                              
>>    Statically Linked Tools:
>> no                                                          
>>    Statically Linked FD:
>> yes                                                         
>>    Statically Linked SD:
>> no                                                          
>>    Statically Linked DIR:
>> no                                                          
>>    Statically Linked CONS:
>> no                                                          
>>    Database type:
>> None                                                        
>>    Database
>> port:                                                                       
>>    Database
>> lib:                                                                        
>>    Database name:
>> bacula                                                      
>>    Database user:
>> bacula                                                      
>>
>>    Job Output Email:        root@localhost
>>    Traceback Email:         root@localhost
>>    SMTP Host Address:       localhost     
>>
>>    Director Port:           9101
>>    File daemon Port:        9102
>>    Storage daemon Port:     9103
>>
>>    Director User:           
>>    Director Group:          
>>    Storage Daemon User:     
>>    Storage DaemonGroup:     
>>    File Daemon User:        
>>    File Daemon Group:       
>>
>>    SQL binaries Directory   
>>
>>    Large file support:      yes
>>    Bacula conio support:    yes -lncurses
>>    readline support:        no           
>>    TCP Wrappers support:    no           
>>    TLS support:             yes          
>>    Encryption support:      yes          
>>    ZLIB support:            yes          
>>    enable-smartalloc:       yes          
>>    enable-lockmgr:          no           
>>    bat support:             no           
>>    enable-gnome:            no           
>>    enable-bwx-console:      no           
>>    enable-tray-monitor:     no           
>>    client-only:             yes          
>>    build-dird:              yes          
>>    build-stored:            yes          
>>    ACL support:             no           
>>    XATTR support:           yes          
>>    Python support:          no           
>>    Batch insert enabled:    no
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Crystal Reports - New Free Runtime and 30 Day Trial
>> Check out the new simplified licensing option that enables unlimited
>> royalty-free distribution of the report engine for externally facing 
>> server and web deployment.
>> http://p.sf.net/sfu/businessobjects
>> _______________________________________________
>> Bacula-users mailing list
>> Bacula-users AT lists.sourceforge DOT net
>> https://lists.sourceforge.net/lists/listinfo/bacula-users

-- 
[:O]###[O:]

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users