brimdata / build-suricata

Build Suricata for packaging with Brim
8 stars 2 forks source link

Static linux build #16

Closed henridf closed 4 years ago

henridf commented 4 years ago

This PR removes most dynamic dependencies from the suricata linux binary.

The resulting deps are mostly standard system deps (and that our zeek executable has too) such as libc, libdl, libpthread, ...

I was unable to link statically with nss and nspr (see #24). We can't expect these to be present on every linux system (they are on a standard ubuntu 18.04), so we'll have to add them as deps to the .deb/.rpm packages when building those in the brim repo.

henridf@henridf-ubuntu-1804:~/suricata/src$ lddtree suricata
suricata => ./suricata (interpreter => /lib64/ld-linux-x86-64.so.2)
    libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1
    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2
    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0
    libnss3.so => /usr/lib/x86_64-linux-gnu/libnss3.so
        libnssutil3.so => /usr/lib/x86_64-linux-gnu/libnssutil3.so
        libplc4.so => /usr/lib/x86_64-linux-gnu/libplc4.so
        libplds4.so => /usr/lib/x86_64-linux-gnu/libplds4.so
    libnspr4.so => /usr/lib/x86_64-linux-gnu/libnspr4.so
        librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1
    libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6
    ld-linux-x86-64.so.2 => /lib64/ld-linux-x86-64.so.2
henridf commented 4 years ago

closes #19