#39 compile znc-static

closed-wont-fix
nobody
None
5
2008-06-03
2008-02-21
paladin
No

hi,
i cant compile znc on a shell from a shellprovider.
i need use the static version compiled on a other linux system, but i became a error...

[code]
./configure --prefix=/home/bart/znc
checking for g++... g++
checking for C++ compiler default output file name... a.out
checking whether the C++ compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking for gcc... gcc
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for getopt_long in -lgnugetopt... no
checking for stat... yes
checking for lstat... yes
checking for chmod... yes
checking for open... yes
checking for dlopen... no
checking for BIO_new in -lcrypto... yes
checking for SSL_shutdown in -lssl... yes
checking for dlopen in -ldl... yes
checking for perl... /usr/bin/perl
checking for perl_alloc in -lperl... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating znc-config
config.status: creating modules/Makefile

znc 0.052 configured

debug: no
ipv6: no
openssl: yes
modules: yes
perl: yes
sasl: no
[/code]

[code]
make znc-static
g++ -D_GNU_SOURCE -fPIC -Wall -W -Wno-unused -O2 -fomit-frame-pointer -Woverloaded-virtual -DHAVE_LIBSSL -D_MODULES -D_MODDIR_=\"/home/mircforce/znc/libexec/znc\" -c -o String.o String.cpp
g++ -D_GNU_SOURCE -fPIC -Wall -W -Wno-unused -O2 -fomit-frame-pointer -Woverloaded-virtual -DHAVE_LIBSSL -D_MODULES -D_MODDIR_=\"/home/mircforce/znc/libexec/znc\" -c -o Csocket.o Csocket.cpp
g++ -D_GNU_SOURCE -fPIC -Wall -W -Wno-unused -O2 -fomit-frame-pointer -Woverloaded-virtual -DHAVE_LIBSSL -D_MODULES -D_MODDIR_=\"/home/mircforce/znc/libexec/znc\" -c -o main.o main.cpp
main.cpp: In function 'int main(int, char**, char**)':
main.cpp:128: warning: deprecated conversion from string constant to 'char*'
main.cpp:139: warning: deprecated conversion from string constant to 'char*'
g++ -D_GNU_SOURCE -fPIC -Wall -W -Wno-unused -O2 -fomit-frame-pointer -Woverloaded-virtual -DHAVE_LIBSSL -D_MODULES -D_MODDIR_=\"/home/mircforce/znc/libexec/znc\" -c -o znc.o znc.cpp
g++ -D_GNU_SOURCE -fPIC -Wall -W -Wno-unused -O2 -fomit-frame-pointer -Woverloaded-virtual -DHAVE_LIBSSL -D_MODULES -D_MODDIR_=\"/home/mircforce/znc/libexec/znc\" -c -o User.o User.cpp
g++ -D_GNU_SOURCE -fPIC -Wall -W -Wno-unused -O2 -fomit-frame-pointer -Woverloaded-virtual -DHAVE_LIBSSL -D_MODULES -D_MODDIR_=\"/home/mircforce/znc/libexec/znc\" -c -o IRCSock.o IRCSock.cpp
g++ -D_GNU_SOURCE -fPIC -Wall -W -Wno-unused -O2 -fomit-frame-pointer -Woverloaded-virtual -DHAVE_LIBSSL -D_MODULES -D_MODDIR_=\"/home/mircforce/znc/libexec/znc\" -c -o Client.o Client.cpp
g++ -D_GNU_SOURCE -fPIC -Wall -W -Wno-unused -O2 -fomit-frame-pointer -Woverloaded-virtual -DHAVE_LIBSSL -D_MODULES -D_MODDIR_=\"/home/mircforce/znc/libexec/znc\" -c -o DCCBounce.o DCCBounce.cpp
g++ -D_GNU_SOURCE -fPIC -Wall -W -Wno-unused -O2 -fomit-frame-pointer -Woverloaded-virtual -DHAVE_LIBSSL -D_MODULES -D_MODDIR_=\"/home/mircforce/znc/libexec/znc\" -c -o DCCSock.o DCCSock.cpp
g++ -D_GNU_SOURCE -fPIC -Wall -W -Wno-unused -O2 -fomit-frame-pointer -Woverloaded-virtual -DHAVE_LIBSSL -D_MODULES -D_MODDIR_=\"/home/mircforce/znc/libexec/znc\" -c -o Chan.o Chan.cpp
g++ -D_GNU_SOURCE -fPIC -Wall -W -Wno-unused -O2 -fomit-frame-pointer -Woverloaded-virtual -DHAVE_LIBSSL -D_MODULES -D_MODDIR_=\"/home/mircforce/znc/libexec/znc\" -c -o Nick.o Nick.cpp
g++ -D_GNU_SOURCE -fPIC -Wall -W -Wno-unused -O2 -fomit-frame-pointer -Woverloaded-virtual -DHAVE_LIBSSL -D_MODULES -D_MODDIR_=\"/home/mircforce/znc/libexec/znc\" -c -o Server.o Server.cpp
g++ -D_GNU_SOURCE -fPIC -Wall -W -Wno-unused -O2 -fomit-frame-pointer -Woverloaded-virtual -DHAVE_LIBSSL -D_MODULES -D_MODDIR_=\"/home/mircforce/znc/libexec/znc\" -c -o Modules.o Modules.cpp
g++ -D_GNU_SOURCE -fPIC -Wall -W -Wno-unused -O2 -fomit-frame-pointer -Woverloaded-virtual -DHAVE_LIBSSL -D_MODULES -D_MODDIR_=\"/home/mircforce/znc/libexec/znc\" -c -o MD5.o MD5.cpp
g++ -D_GNU_SOURCE -fPIC -Wall -W -Wno-unused -O2 -fomit-frame-pointer -Woverloaded-virtual -DHAVE_LIBSSL -D_MODULES -D_MODDIR_=\"/home/mircforce/znc/libexec/znc\" -c -o Buffer.o Buffer.cpp
g++ -D_GNU_SOURCE -fPIC -Wall -W -Wno-unused -O2 -fomit-frame-pointer -Woverloaded-virtual -DHAVE_LIBSSL -D_MODULES -D_MODDIR_=\"/home/mircforce/znc/libexec/znc\" -c -o Utils.o Utils.cpp
g++ -D_GNU_SOURCE -fPIC -Wall -W -Wno-unused -O2 -fomit-frame-pointer -Woverloaded-virtual -DHAVE_LIBSSL -D_MODULES -D_MODDIR_=\"/home/mircforce/znc/libexec/znc\" -c -o FileUtils.o FileUtils.cpp
FileUtils.cpp: In member function 'int CExecSock::popen2(int&, int&, const CString&)':
FileUtils.cpp:388: warning: deprecated conversion from string constant to 'char*'
FileUtils.cpp:388: warning: deprecated conversion from string constant to 'char*'
g++ -D_GNU_SOURCE -fPIC -Wall -W -Wno-unused -O2 -fomit-frame-pointer -Woverloaded-virtual -DHAVE_LIBSSL -D_MODULES -D_MODDIR_=\"/home/mircforce/znc/libexec/znc\" -c -o HTTPSock.o HTTPSock.cpp
g++ -D_GNU_SOURCE -fPIC -Wall -W -Wno-unused -O2 -fomit-frame-pointer -Woverloaded-virtual -DHAVE_LIBSSL -D_MODULES -D_MODDIR_=\"/home/mircforce/znc/libexec/znc\" -c -o Template.o Template.cpp
g++ -Wl,--export-dynamic -static -o znc-static String.o Csocket.o main.o znc.o User.o IRCSock.o Client.o DCCBounce.o DCCSock.o Chan.o Nick.o Server.o Modules.o MD5.o Buffer.o Utils.o FileUtils.o HTTPSock.o Template.o -ldl -lssl -lcrypto
Modules.o: In function `CModules::GetModInfo(CModInfo&, CString const&)':
Modules.cpp:(.text+0x3722): warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
znc.o: In function `CZNC::InitDirs(CString const&, CString const&)':
znc.cpp:(.text+0x544f): warning: Using 'getpwuid' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
Csocket.o: In function `GetAddrInfo(CString const&, Csock*, CSSockAddr&)':
Csocket.cpp:(.text+0x12dc): warning: Using 'gethostbyname_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/lib/gcc/i486-linux-gnu/4.2.3/../../../../lib/libcrypto.a(c_zlib.o): In function `zlib_stateful_expand_block':
(.text+0x129): undefined reference to `inflate'
/usr/lib/gcc/i486-linux-gnu/4.2.3/../../../../lib/libcrypto.a(c_zlib.o): In function `zlib_stateful_compress_block':
(.text+0x1a9): undefined reference to `deflate'
/usr/lib/gcc/i486-linux-gnu/4.2.3/../../../../lib/libcrypto.a(c_zlib.o): In function `zlib_stateful_init':
(.text+0x260): undefined reference to `inflateInit_'
/usr/lib/gcc/i486-linux-gnu/4.2.3/../../../../lib/libcrypto.a(c_zlib.o): In function `zlib_stateful_init':
(.text+0x2d0): undefined reference to `deflateInit_'
/usr/lib/gcc/i486-linux-gnu/4.2.3/../../../../lib/libcrypto.a(c_zlib.o): In function `zlib_stateful_free_ex_data':
(.text+0x39e): undefined reference to `inflateEnd'
/usr/lib/gcc/i486-linux-gnu/4.2.3/../../../../lib/libcrypto.a(c_zlib.o): In function `zlib_stateful_free_ex_data':
(.text+0x3a9): undefined reference to `deflateEnd'
collect2: ld returned 1 exit status
make: *** [znc-static] Fehler 1
[/code]

Related

Code: code

Discussion

  • Psychon
    Psychon
    2008-02-23

    Logged In: YES
    user_id=1654410
    Originator: NO

    Those warnings sound bad and the fact that lipcrypto doesnt want to be linked in statically sounds bad too...

    I guess zlib needs to be linked in for that errors to go away (LDFLAGS=-lz ./configure).
    I don't need this here on my local pc, so let's blame libcrypto :P

    For the warnings: Sounds like znc-static won't be that static. No idea what we could/should to about that...

    psychon

     
  • Psychon
    Psychon
    2008-06-03

    • status: open --> closed-wont-fix
     
  • Psychon
    Psychon
    2008-06-03

    Logged In: YES
    user_id=1654410
    Originator: NO

    Ok, forgot this one :/

    The build error is probably fixed with 'LDFLAGS=-lz', no idea, but that ZNC won't be able to load any modules.
    The solution was to remove the 'make znc-static' target.
    Sorry

    psychon