Hi, Bartlett I decided to cut some subsystem by myself, So I spent several days to study the SAMBA 4 WAF build system and now know the base steps of build. but which subsystem can be removed for snmd/nmbd/smbpasswd ? followings are the full dependencies of these 3 binary ldd bin/smbpasswd libpthread.so.0 => /lib/libpthread.so.0 (0xf7139000) libsamba-util.so.0 => /tmp/samba4/lib/libsamba-util.so.0 (0xf70c1000) libreplace-samba4.so => /tmp/samba4/lib/private/libreplace-samba4.so (0xf70b0000) libmsrpc3-samba4.so => /tmp/samba4/lib/private/libmsrpc3-samba4.so (0xf7086000) libsamba-errors.so.1 => /tmp/samba4/lib/libsamba-errors.so.1 (0xf6f90000) libsmbconf.so.0 => /tmp/samba4/lib/libsmbconf.so.0 (0xf6f27000) libtalloc.so.2 => /tmp/samba4/lib/private/libtalloc.so.2 (0xf6f12000) libsamba3-util-samba4.so => /tmp/samba4/lib/private/libsamba3-util-samba4.so (0xf6efb000) libsamba-passdb.so.0 => /tmp/samba4/lib/libsamba-passdb.so.0 (0xf6eb6000) libdcerpc-samba-samba4.so => /tmp/samba4/lib/private/libdcerpc-samba-samba4.so (0xf6d71000) libsamba-debug-samba4.so => /tmp/samba4/lib/private/libsamba-debug-samba4.so (0xf6d5d000) liblibsmb-samba4.so => /tmp/samba4/lib/private/liblibsmb-samba4.so (0xf6cfa000) libcliauth-samba4.so => /tmp/samba4/lib/private/libcliauth-samba4.so (0xf6cdb000) libndr-standard.so.0 => /tmp/samba4/lib/libndr-standard.so.0 (0xf6a22000) libcli-smb-common-samba4.so => /tmp/samba4/lib/private/libcli-smb-common-samba4.so (0xf69f1000) libsecrets3-samba4.so => /tmp/samba4/lib/private/libsecrets3-samba4.so (0xf69d9000) libc.so.6 => /lib/libc.so.6 (0xf689b000) /lib/ld-linux.so.3 (0xf7162000) libtime-basic-samba4.so => /tmp/samba4/lib/private/libtime-basic-samba4.so (0xf688a000) libgenrand-samba4.so => /tmp/samba4/lib/private/libgenrand-samba4.so (0xf6879000) libsocket-blocking-samba4.so => /tmp/samba4/lib/private/libsocket-blocking-samba4.so (0xf6868000) libtevent.so.0 => /tmp/samba4/lib/private/libtevent.so.0 (0xf684d000) librt.so.1 => /lib/librt.so.1 (0xf6836000) libtevent-util.so.0 => /tmp/samba4/lib/libtevent-util.so.0 (0xf6824000) libsamba-credentials.so.0 => /tmp/samba4/lib/libsamba-credentials.so.0 (0xf6806000) libndr-samba-samba4.so => /tmp/samba4/lib/private/libndr-samba-samba4.so (0xf66f8000) libsamba-hostconfig.so.0 => /tmp/samba4/lib/libsamba-hostconfig.so.0 (0xf66cc000) libdbwrap-samba4.so => /tmp/samba4/lib/private/libdbwrap-samba4.so (0xf66b4000) libdcerpc-binding.so.0 => /tmp/samba4/lib/libdcerpc-binding.so.0 (0xf668d000) libutil-tdb-samba4.so => /tmp/samba4/lib/private/libutil-tdb-samba4.so (0xf667b000) libgse-samba4.so => /tmp/samba4/lib/private/libgse-samba4.so (0xf664a000) libsamba-sockets-samba4.so => /tmp/samba4/lib/private/libsamba-sockets-samba4.so (0xf6628000) libndr.so.0 => /tmp/samba4/lib/libndr.so.0 (0xf6608000) libgensec-samba4.so => /tmp/samba4/lib/private/libgensec-samba4.so (0xf65e7000) libsmbregistry-samba4.so => /tmp/samba4/lib/private/libsmbregistry-samba4.so (0xf65c0000) libtalloc-report-samba4.so => /tmp/samba4/lib/private/libtalloc-report-samba4.so (0xf65af000) libmessages-dgm-samba4.so => /tmp/samba4/lib/private/libmessages-dgm-samba4.so (0xf6598000) libCHARSET3-samba4.so => /tmp/samba4/lib/private/libCHARSET3-samba4.so (0xf6586000) libsys-rw-samba4.so => /tmp/samba4/lib/private/libsys-rw-samba4.so (0xf6575000) libsamba-security-samba4.so => /tmp/samba4/lib/private/libsamba-security-samba4.so (0xf654f000) libmessages-util-samba4.so => /tmp/samba4/lib/private/libmessages-util-samba4.so (0xf653e000) libinterfaces-samba4.so => /tmp/samba4/lib/private/libinterfaces-samba4.so (0xf652c000) libserver-id-db-samba4.so => /tmp/samba4/lib/private/libserver-id-db-samba4.so (0xf651a000) libsamba-cluster-support-samba4.so => /tmp/samba4/lib/private/libsamba-cluster-support-samba4.so (0xf6509000) libutil-reg-samba4.so => /tmp/samba4/lib/private/libutil-reg-samba4.so (0xf64f8000) libtdb.so.1 => /tmp/samba4/lib/private/libtdb.so.1 (0xf64d7000) libsmbd-shim-samba4.so => /tmp/samba4/lib/private/libsmbd-shim-samba4.so (0xf64c6000) libutil-setid-samba4.so => /tmp/samba4/lib/private/libutil-setid-samba4.so (0xf64b5000) libtdb-wrap-samba4.so => /tmp/samba4/lib/private/libtdb-wrap-samba4.so (0xf64a3000) libsmb-transport-samba4.so => /tmp/samba4/lib/private/libsmb-transport-samba4.so (0xf648f000) libserver-role-samba4.so => /tmp/samba4/lib/private/libserver-role-samba4.so (0xf647e000) libnsl.so.1 => /lib/libnsl.so.1 (0xf645a000) libwbclient.so.0 => /tmp/samba4/lib/libwbclient.so.0 (0xf643f000) libsamba-modules-samba4.so => /tmp/samba4/lib/private/libsamba-modules-samba4.so (0xf642d000) libcli-cldap-samba4.so => /tmp/samba4/lib/private/libcli-cldap-samba4.so (0xf6417000) libkrb5samba-samba4.so => /tmp/samba4/lib/private/libkrb5samba-samba4.so (0xf63fd000) libutil-cmdline-samba4.so => /tmp/samba4/lib/private/libutil-cmdline-samba4.so (0xf63eb000) libcom_err-samba4.so.0 => /tmp/samba4/lib/private/libcom_err-samba4.so.0 (0xf63d9000) libasn1util-samba4.so => /tmp/samba4/lib/private/libasn1util-samba4.so (0xf63c5000) libndr-nbt.so.0 => /tmp/samba4/lib/libndr-nbt.so.0 (0xf63a4000) libiov-buf-samba4.so => /tmp/samba4/lib/private/libiov-buf-samba4.so (0xf6393000) libldb.so.1 => /tmp/samba4/lib/private/libldb.so.1 (0xf635f000) libsamdb-common-samba4.so => /tmp/samba4/lib/private/libsamdb-common-samba4.so (0xf632c000) libgssapi-samba4.so.2 => /tmp/samba4/lib/private/libgssapi-samba4.so.2 (0xf62f9000) libldbsamba-samba4.so => /tmp/samba4/lib/private/libldbsamba-samba4.so (0xf62c8000) libauthkrb5-samba4.so => /tmp/samba4/lib/private/libauthkrb5-samba4.so (0xf62ab000) libkrb5-samba4.so.26 => /tmp/samba4/lib/private/libkrb5-samba4.so.26 (0xf624d000) libz-samba4.so => /tmp/samba4/lib/private/libz-samba4.so (0xf622e000) libaddns-samba4.so => /tmp/samba4/lib/private/libaddns-samba4.so (0xf6216000) libcli-nbt-samba4.so => /tmp/samba4/lib/private/libcli-nbt-samba4.so (0xf61fe000) libsamdb.so.0 => /tmp/samba4/lib/libsamdb.so.0 (0xf61db000) libmsghdr-samba4.so => /tmp/samba4/lib/private/libmsghdr-samba4.so (0xf61c9000) libwinbind-client-samba4.so => /tmp/samba4/lib/private/libwinbind-client-samba4.so (0xf61b7000) libdl.so.2 => /lib/libdl.so.2 (0xf61a4000) libcli-ldap-common-samba4.so => /tmp/samba4/lib/private/libcli-ldap-common-samba4.so (0xf618d000) libasn1-samba4.so.8 => /tmp/samba4/lib/private/libasn1-samba4.so.8 (0xf6125000) libflag-mapping-samba4.so => /tmp/samba4/lib/private/libflag-mapping-samba4.so (0xf6114000) libroken-samba4.so.19 => /tmp/samba4/lib/private/libroken-samba4.so.19 (0xf60fb000) libhcrypto-samba4.so.5 => /tmp/samba4/lib/private/libhcrypto-samba4.so.5 (0xf60c2000) libheimbase-samba4.so.1 => /tmp/samba4/lib/private/libheimbase-samba4.so.1 (0xf60af000) libndr-krb5pac.so.0 => /tmp/samba4/lib/libndr-krb5pac.so.0 (0xf6095000) libauth-sam-reply-samba4.so => /tmp/samba4/lib/private/libauth-sam-reply-samba4.so (0xf6082000) libhx509-samba4.so.5 => /tmp/samba4/lib/private/libhx509-samba4.so.5 (0xf6040000) libwind-samba4.so.0 => /tmp/samba4/lib/private/libwind-samba4.so.0 (0xf6009000) libresolv.so.2 => /lib/libresolv.so.2 (0xf5fe5000) ldd sbin/nmbd libpthread.so.0 => /lib/libpthread.so.0 (0xf73b6000) libpopt-samba3-samba4.so => /tmp/samba4/lib/private/libpopt-samba3-samba4.so (0xf73a2000) libsamba-util.so.0 => /tmp/samba4/lib/libsamba-util.so.0 (0xf732a000) liblibsmb-samba4.so => /tmp/samba4/lib/private/liblibsmb-samba4.so (0xf72c7000) libsamba-errors.so.1 => /tmp/samba4/lib/libsamba-errors.so.1 (0xf71d1000) libtevent.so.0 => /tmp/samba4/lib/private/libtevent.so.0 (0xf71b6000) libreplace-samba4.so => /tmp/samba4/lib/private/libreplace-samba4.so (0xf71a5000) libsamba-security-samba4.so => /tmp/samba4/lib/private/libsamba-security-samba4.so (0xf717f000) libsmbconf.so.0 => /tmp/samba4/lib/libsmbconf.so.0 (0xf7116000) libtalloc.so.2 => /tmp/samba4/lib/private/libtalloc.so.2 (0xf7101000) libsys-rw-samba4.so => /tmp/samba4/lib/private/libsys-rw-samba4.so (0xf70f0000) libutil-tdb-samba4.so => /tmp/samba4/lib/private/libutil-tdb-samba4.so (0xf70de000) libsamba3-util-samba4.so => /tmp/samba4/lib/private/libsamba3-util-samba4.so (0xf70c7000) libsocket-blocking-samba4.so => /tmp/samba4/lib/private/libsocket-blocking-samba4.so (0xf70b6000) libsamba-sockets-samba4.so => /tmp/samba4/lib/private/libsamba-sockets-samba4.so (0xf7094000) libndr.so.0 => /tmp/samba4/lib/libndr.so.0 (0xf7074000) libpopt-samba4.so => /tmp/samba4/lib/private/libpopt-samba4.so (0xf705e000) libsamba-debug-samba4.so => /tmp/samba4/lib/private/libsamba-debug-samba4.so (0xf704a000) libcli-cldap-samba4.so => /tmp/samba4/lib/private/libcli-cldap-samba4.so (0xf7034000) libcli-smb-common-samba4.so => /tmp/samba4/lib/private/libcli-smb-common-samba4.so (0xf7003000) libgse-samba4.so => /tmp/samba4/lib/private/libgse-samba4.so (0xf6fd2000) libtdb.so.1 => /tmp/samba4/lib/private/libtdb.so.1 (0xf6fb1000) libCHARSET3-samba4.so => /tmp/samba4/lib/private/libCHARSET3-samba4.so (0xf6f9f000) libsmbregistry-samba4.so => /tmp/samba4/lib/private/libsmbregistry-samba4.so (0xf6f78000) libndr-nbt.so.0 => /tmp/samba4/lib/libndr-nbt.so.0 (0xf6f57000) libcli-nbt-samba4.so => /tmp/samba4/lib/private/libcli-nbt-samba4.so (0xf6f3f000) libc.so.6 => /lib/libc.so.6 (0xf6e01000) /lib/ld-linux.so.3 (0xf73df000) libutil-cmdline-samba4.so => /tmp/samba4/lib/private/libutil-cmdline-samba4.so (0xf6def000) libsamba-hostconfig.so.0 => /tmp/samba4/lib/libsamba-hostconfig.so.0 (0xf6dc3000) libtime-basic-samba4.so => /tmp/samba4/lib/private/libtime-basic-samba4.so (0xf6db2000) libgenrand-samba4.so => /tmp/samba4/lib/private/libgenrand-samba4.so (0xf6da1000) librt.so.1 => /lib/librt.so.1 (0xf6d8a000) libcliauth-samba4.so => /tmp/samba4/lib/private/libcliauth-samba4.so (0xf6d6b000) libkrb5samba-samba4.so => /tmp/samba4/lib/private/libkrb5samba-samba4.so (0xf6d51000) libgensec-samba4.so => /tmp/samba4/lib/private/libgensec-samba4.so (0xf6d30000) libcom_err-samba4.so.0 => /tmp/samba4/lib/private/libcom_err-samba4.so.0 (0xf6d1e000) libasn1util-samba4.so => /tmp/samba4/lib/private/libasn1util-samba4.so (0xf6d0a000) libtevent-util.so.0 => /tmp/samba4/lib/libtevent-util.so.0 (0xf6cf8000) libsmb-transport-samba4.so => /tmp/samba4/lib/private/libsmb-transport-samba4.so (0xf6ce4000) libsamba-credentials.so.0 => /tmp/samba4/lib/libsamba-credentials.so.0 (0xf6cc6000) libtalloc-report-samba4.so => /tmp/samba4/lib/private/libtalloc-report-samba4.so (0xf6cb5000) libmessages-dgm-samba4.so => /tmp/samba4/lib/private/libmessages-dgm-samba4.so (0xf6c9e000) libmessages-util-samba4.so => /tmp/samba4/lib/private/libmessages-util-samba4.so (0xf6c8d000) libinterfaces-samba4.so => /tmp/samba4/lib/private/libinterfaces-samba4.so (0xf6c7b000) libserver-id-db-samba4.so => /tmp/samba4/lib/private/libserver-id-db-samba4.so (0xf6c69000) libdbwrap-samba4.so => /tmp/samba4/lib/private/libdbwrap-samba4.so (0xf6c51000) libsamba-cluster-support-samba4.so => /tmp/samba4/lib/private/libsamba-cluster-support-samba4.so (0xf6c40000) libutil-reg-samba4.so => /tmp/samba4/lib/private/libutil-reg-samba4.so (0xf6c2f000) libsmbd-shim-samba4.so => /tmp/samba4/lib/private/libsmbd-shim-samba4.so (0xf6c1e000) libutil-setid-samba4.so => /tmp/samba4/lib/private/libutil-setid-samba4.so (0xf6c0d000) libtdb-wrap-samba4.so => /tmp/samba4/lib/private/libtdb-wrap-samba4.so (0xf6bfb000) libserver-role-samba4.so => /tmp/samba4/lib/private/libserver-role-samba4.so (0xf6bea000) libndr-standard.so.0 => /tmp/samba4/lib/libndr-standard.so.0 (0xf6931000) libnsl.so.1 => /lib/libnsl.so.1 (0xf690d000) libiov-buf-samba4.so => /tmp/samba4/lib/private/libiov-buf-samba4.so (0xf68fc000) libldb.so.1 => /tmp/samba4/lib/private/libldb.so.1 (0xf68c8000) libcli-ldap-common-samba4.so => /tmp/samba4/lib/private/libcli-ldap-common-samba4.so (0xf68b2000) libkrb5-samba4.so.26 => /tmp/samba4/lib/private/libkrb5-samba4.so.26 (0xf6854000) libaddns-samba4.so => /tmp/samba4/lib/private/libaddns-samba4.so (0xf683c000) libgssapi-samba4.so.2 => /tmp/samba4/lib/private/libgssapi-samba4.so.2 (0xf6809000) libsecrets3-samba4.so => /tmp/samba4/lib/private/libsecrets3-samba4.so (0xf67f1000) libauthkrb5-samba4.so => /tmp/samba4/lib/private/libauthkrb5-samba4.so (0xf67d4000) libndr-samba-samba4.so => /tmp/samba4/lib/private/libndr-samba-samba4.so (0xf66c6000) libasn1-samba4.so.8 => /tmp/samba4/lib/private/libasn1-samba4.so.8 (0xf665e000) libwbclient.so.0 => /tmp/samba4/lib/libwbclient.so.0 (0xf6643000) libsamba-modules-samba4.so => /tmp/samba4/lib/private/libsamba-modules-samba4.so (0xf6631000) libsamdb.so.0 => /tmp/samba4/lib/libsamdb.so.0 (0xf660e000) libsamdb-common-samba4.so => /tmp/samba4/lib/private/libsamdb-common-samba4.so (0xf65db000) libldbsamba-samba4.so => /tmp/samba4/lib/private/libldbsamba-samba4.so (0xf65a9000) libmsghdr-samba4.so => /tmp/samba4/lib/private/libmsghdr-samba4.so (0xf6598000) libdl.so.2 => /lib/libdl.so.2 (0xf6585000) libheimbase-samba4.so.1 => /tmp/samba4/lib/private/libheimbase-samba4.so.1 (0xf6572000) libhx509-samba4.so.5 => /tmp/samba4/lib/private/libhx509-samba4.so.5 (0xf6530000) libhcrypto-samba4.so.5 => /tmp/samba4/lib/private/libhcrypto-samba4.so.5 (0xf64f8000) libroken-samba4.so.19 => /tmp/samba4/lib/private/libroken-samba4.so.19 (0xf64df000) libwind-samba4.so.0 => /tmp/samba4/lib/private/libwind-samba4.so.0 (0xf64a8000) libresolv.so.2 => /lib/libresolv.so.2 (0xf6484000) libndr-krb5pac.so.0 => /tmp/samba4/lib/libndr-krb5pac.so.0 (0xf6469000) libauth-sam-reply-samba4.so => /tmp/samba4/lib/private/libauth-sam-reply-samba4.so (0xf6456000) libz-samba4.so => /tmp/samba4/lib/private/libz-samba4.so (0xf6437000) libwinbind-client-samba4.so => /tmp/samba4/lib/private/libwinbind-client-samba4.so (0xf6425000) libflag-mapping-samba4.so => /tmp/samba4/lib/private/libflag-mapping-samba4.so (0xf6413000) ldd sbin/smbd libpthread.so.0 => /lib/libpthread.so.0 (0xf7086000) libsamba-util.so.0 => /tmp/samba4/lib/libsamba-util.so.0 (0xf700e000) libsmbd-base-samba4.so => /tmp/samba4/lib/private/libsmbd-base-samba4.so (0xf6d56000) libsamba-debug-samba4.so => /tmp/samba4/lib/private/libsamba-debug-samba4.so (0xf6d42000) libgenrand-samba4.so => /tmp/samba4/lib/private/libgenrand-samba4.so (0xf6d31000) libtalloc.so.2 => /tmp/samba4/lib/private/libtalloc.so.2 (0xf6d1c000) libsocket-blocking-samba4.so => /tmp/samba4/lib/private/libsocket-blocking-samba4.so (0xf6d0b000) libtevent.so.0 => /tmp/samba4/lib/private/libtevent.so.0 (0xf6cf0000) libsmbregistry-samba4.so => /tmp/samba4/lib/private/libsmbregistry-samba4.so (0xf6cc9000) libtevent-util.so.0 => /tmp/samba4/lib/libtevent-util.so.0 (0xf6cb7000) libndr-samba-samba4.so => /tmp/samba4/lib/private/libndr-samba-samba4.so (0xf6ba9000) libsamba-errors.so.1 => /tmp/samba4/lib/libsamba-errors.so.1 (0xf6ab3000) libsys-rw-samba4.so => /tmp/samba4/lib/private/libsys-rw-samba4.so (0xf6aa2000) libsamba3-util-samba4.so => /tmp/samba4/lib/private/libsamba3-util-samba4.so (0xf6a8b000) libsamba-passdb.so.0 => /tmp/samba4/lib/libsamba-passdb.so.0 (0xf6a46000) libcliauth-samba4.so => /tmp/samba4/lib/private/libcliauth-samba4.so (0xf6a27000) libpopt-samba3-samba4.so => /tmp/samba4/lib/private/libpopt-samba3-samba4.so (0xf6a13000) libauth-samba4.so => /tmp/samba4/lib/private/libauth-samba4.so (0xf69e6000) libsmbconf.so.0 => /tmp/samba4/lib/libsmbconf.so.0 (0xf697d000) libsamba-cluster-support-samba4.so => /tmp/samba4/lib/private/libsamba-cluster-support-samba4.so (0xf696c000) libsamba-sockets-samba4.so => /tmp/samba4/lib/private/libsamba-sockets-samba4.so (0xf694a000) libsmbd-shim-samba4.so => /tmp/samba4/lib/private/libsmbd-shim-samba4.so (0xf6939000) libndr-standard.so.0 => /tmp/samba4/lib/libndr-standard.so.0 (0xf6680000) libsecrets3-samba4.so => /tmp/samba4/lib/private/libsecrets3-samba4.so (0xf6668000) libsamba-hostconfig.so.0 => /tmp/samba4/lib/libsamba-hostconfig.so.0 (0xf663c000) libpopt-samba4.so => /tmp/samba4/lib/private/libpopt-samba4.so (0xf6626000) libc.so.6 => /lib/libc.so.6 (0xf64e8000) /lib/ld-linux.so.3 (0xf70af000) libtime-basic-samba4.so => /tmp/samba4/lib/private/libtime-basic-samba4.so (0xf64d7000) libreplace-samba4.so => /tmp/samba4/lib/private/libreplace-samba4.so (0xf64c6000) librt.so.1 => /lib/librt.so.1 (0xf64af000) libprinting-migrate-samba4.so => /tmp/samba4/lib/private/libprinting-migrate-samba4.so (0xf648d000) libmessages-dgm-samba4.so => /tmp/samba4/lib/private/libmessages-dgm-samba4.so (0xf6476000) libsamba-security-samba4.so => /tmp/samba4/lib/private/libsamba-security-samba4.so (0xf6450000) libnetapi.so.0 => /tmp/samba4/lib/libnetapi.so.0 (0xf63f2000) libsmbd-conn-samba4.so => /tmp/samba4/lib/private/libsmbd-conn-samba4.so (0xf63e0000) libutil-tdb-samba4.so => /tmp/samba4/lib/private/libutil-tdb-samba4.so (0xf63ce000) libnpa-tstream-samba4.so => /tmp/samba4/lib/private/libnpa-tstream-samba4.so (0xf63b7000) libtdb.so.1 => /tmp/samba4/lib/private/libtdb.so.1 (0xf6396000) liblibsmb-samba4.so => /tmp/samba4/lib/private/liblibsmb-samba4.so (0xf6333000) libmsrpc3-samba4.so => /tmp/samba4/lib/private/libmsrpc3-samba4.so (0xf6309000) libserver-id-db-samba4.so => /tmp/samba4/lib/private/libserver-id-db-samba4.so (0xf62f7000) libdbwrap-samba4.so => /tmp/samba4/lib/private/libdbwrap-samba4.so (0xf62df000) libiov-buf-samba4.so => /tmp/samba4/lib/private/libiov-buf-samba4.so (0xf62ce000) libkrb5samba-samba4.so => /tmp/samba4/lib/private/libkrb5samba-samba4.so (0xf62b4000) libdcerpc-samba-samba4.so => /tmp/samba4/lib/private/libdcerpc-samba-samba4.so (0xf616f000) libndr.so.0 => /tmp/samba4/lib/libndr.so.0 (0xf614f000) libutil-reg-samba4.so => /tmp/samba4/lib/private/libutil-reg-samba4.so (0xf613e000) libcli-spoolss-samba4.so => /tmp/samba4/lib/private/libcli-spoolss-samba4.so (0xf612a000) libcom_err-samba4.so.0 => /tmp/samba4/lib/private/libcom_err-samba4.so.0 (0xf6118000) libads-samba4.so => /tmp/samba4/lib/private/libads-samba4.so (0xf60fe000) libwbclient.so.0 => /tmp/samba4/lib/libwbclient.so.0 (0xf60e3000) libutil-setid-samba4.so => /tmp/samba4/lib/private/libutil-setid-samba4.so (0xf60d2000) liblibcli-lsa3-samba4.so => /tmp/samba4/lib/private/liblibcli-lsa3-samba4.so (0xf60bf000) libcli-smb-common-samba4.so => /tmp/samba4/lib/private/libcli-smb-common-samba4.so (0xf608e000) libgse-samba4.so => /tmp/samba4/lib/private/libgse-samba4.so (0xf605d000) libgensec-samba4.so => /tmp/samba4/lib/private/libgensec-samba4.so (0xf603c000) libdcerpc-binding.so.0 => /tmp/samba4/lib/libdcerpc-binding.so.0 (0xf6015000) libndr-samba4.so => /tmp/samba4/lib/private/libndr-samba4.so (0xf5f02000) libCHARSET3-samba4.so => /tmp/samba4/lib/private/libCHARSET3-samba4.so (0xf5ef0000) libauthkrb5-samba4.so => /tmp/samba4/lib/private/libauthkrb5-samba4.so (0xf5ed3000) libsmb-transport-samba4.so => /tmp/samba4/lib/private/libsmb-transport-samba4.so (0xf5ebf000) libsamba-modules-samba4.so => /tmp/samba4/lib/private/libsamba-modules-samba4.so (0xf5ead000) libasn1util-samba4.so => /tmp/samba4/lib/private/libasn1util-samba4.so (0xf5e99000) libndr-nbt.so.0 => /tmp/samba4/lib/libndr-nbt.so.0 (0xf5e78000) libz-samba4.so => /tmp/samba4/lib/private/libz-samba4.so (0xf5e59000) libsamba-credentials.so.0 => /tmp/samba4/lib/libsamba-credentials.so.0 (0xf5e3b000) libtdb-wrap-samba4.so => /tmp/samba4/lib/private/libtdb-wrap-samba4.so (0xf5e29000) libutil-cmdline-samba4.so => /tmp/samba4/lib/private/libutil-cmdline-samba4.so (0xf5e17000) liblibcli-netlogon3-samba4.so => /tmp/samba4/lib/private/liblibcli-netlogon3-samba4.so (0xf5e03000) libndr-krb5pac.so.0 => /tmp/samba4/lib/libndr-krb5pac.so.0 (0xf5de9000) libauth-sam-reply-samba4.so => /tmp/samba4/lib/private/libauth-sam-reply-samba4.so (0xf5dd6000) libnsl.so.1 => /lib/libnsl.so.1 (0xf5db1000) libcrypt.so.1 => /lib/libcrypt.so.1 (0xf5d72000) libtalloc-report-samba4.so => /tmp/samba4/lib/private/libtalloc-report-samba4.so (0xf5d61000) libmessages-util-samba4.so => /tmp/samba4/lib/private/libmessages-util-samba4.so (0xf5d50000) libinterfaces-samba4.so => /tmp/samba4/lib/private/libinterfaces-samba4.so (0xf5d3e000) libserver-role-samba4.so => /tmp/samba4/lib/private/libserver-role-samba4.so (0xf5d2c000) libmsghdr-samba4.so => /tmp/samba4/lib/private/libmsghdr-samba4.so (0xf5d1b000) libtrusts-util-samba4.so => /tmp/samba4/lib/private/libtrusts-util-samba4.so (0xf5d08000) libflag-mapping-samba4.so => /tmp/samba4/lib/private/libflag-mapping-samba4.so (0xf5cf6000) libcli-cldap-samba4.so => /tmp/samba4/lib/private/libcli-cldap-samba4.so (0xf5ce0000) libkrb5-samba4.so.26 => /tmp/samba4/lib/private/libkrb5-samba4.so.26 (0xf5c82000) libasn1-samba4.so.8 => /tmp/samba4/lib/private/libasn1-samba4.so.8 (0xf5c19000) libaddns-samba4.so => /tmp/samba4/lib/private/libaddns-samba4.so (0xf5c01000) libwinbind-client-samba4.so => /tmp/samba4/lib/private/libwinbind-client-samba4.so (0xf5bef000) libgssapi-samba4.so.2 => /tmp/samba4/lib/private/libgssapi-samba4.so.2 (0xf5bbb000) libcli-nbt-samba4.so => /tmp/samba4/lib/private/libcli-nbt-samba4.so (0xf5ba3000) libsamdb.so.0 => /tmp/samba4/lib/libsamdb.so.0 (0xf5b80000) libdl.so.2 => /lib/libdl.so.2 (0xf5b6d000) libldb.so.1 => /tmp/samba4/lib/private/libldb.so.1 (0xf5b38000) libsamdb-common-samba4.so => /tmp/samba4/lib/private/libsamdb-common-samba4.so (0xf5b05000) libldbsamba-samba4.so => /tmp/samba4/lib/private/libldbsamba-samba4.so (0xf5ad4000) libcli-ldap-common-samba4.so => /tmp/samba4/lib/private/libcli-ldap-common-samba4.so (0xf5abe000) libheimbase-samba4.so.1 => /tmp/samba4/lib/private/libheimbase-samba4.so.1 (0xf5aaa000) libhx509-samba4.so.5 => /tmp/samba4/lib/private/libhx509-samba4.so.5 (0xf5a69000) libhcrypto-samba4.so.5 => /tmp/samba4/lib/private/libhcrypto-samba4.so.5 (0xf5a31000) libroken-samba4.so.19 => /tmp/samba4/lib/private/libroken-samba4.so.19 (0xf5a18000) libwind-samba4.so.0 => /tmp/samba4/lib/private/libwind-samba4.so.0 (0xf59e1000) libresolv.so.2 => /lib/libresolv.so.2 (0xf59bc000) Thanks very much.> -----原始邮件----- > 发件人: "Andrew Bartlett via samba" <samba at lists.samba.org> > 发送时间: 2017-07-30 16:17:30 (星期日) > 收件人: "yuanjp at hust.edu.cn" <yuanjp at hust.edu.cn>, samba <samba at lists.samba.org> > 抄送: > 主题: Re: [Samba] how to reduce binary size of SAMBA 4 for embeded device > > On Sun, 2017-07-30 at 15:18 +0800, yuanjp--- via samba wrote: > > Hi Bartlett > > > > as far as I know, lots of soho router still use SAMBA 3 > > I think the binary size is the main consideration. > > does Samba team have a plan for --with-tiny-smbd? > > We look forward to it. > > Not that I'm aware of. I had expected interest when I posted my > efforts with link-time-optimisation, but nothing went anywhere. > > So from here, I suggest you either dig into the build system (patches > most welcome!), or contract a Samba development shop[1] to look into > this for you. > > If you do dig into the build system, look at how the MIT KDC and > without-ad-dc options are implemented, using the enabled flag on each > subsystem. > > Thanks, > > Andrew Bartlett > [1] https://www.samba.org/samba/support/globalsupport.html > > -- > Andrew Bartlett http://samba.org/~abartlet/ > Authentication Developer, Samba Team http://samba.org > Samba Developer, Catalyst IT http://catalyst.net.nz/services/samba > > > -- > To unsubscribe from this list go to the following URL and read the > instructions: https://lists.samba.org/mailman/options/samba
Andrew Bartlett
2017-Aug-06 05:03 UTC
[Samba] how to reduce binary size of SAMBA 4 for embeded device
On Wed, 2017-08-02 at 17:37 +0800, 袁建鹏 wrote:> Hi, Bartlett > > I decided to cut some subsystem by myself, > So I spent several days to study the SAMBA 4 WAF build system and now know the base steps of build. > but which subsystem can be removed for snmd/nmbd/smbpasswd ?That is, essentially, your task. You could compile it under callcatcher, or use some other symbol dependency tracker to work out what libraries are linked but not used. The real problem however is when a binary like smbd links against a library, a, which uses b. However often the way that smbd uses a does not require b, but it remains a useless dependency. The classic example of this is also the easiest one to start solving, which is that smbd links against libndr-standard and libndr-samba- samba4. However, most of those libs are not used: sometimes the only link in is via the ndr_table which lists all our generated IDL by UUID. A re-structure of this code so that we have one library that is just what a minimal smbd needs, and other for larger tasks like the client tools and the AD DC, would be quite handy. A starting point would be to disable subsystems for a minimal build, that simply wouldn't compile the unused elements, followed by code changes to make other currently 'used' elements that are not strictly needed for the file server alone become unused, then disabled. It isn't easy, but it will be worthwhile. Andrew Bartlett -- Andrew Bartlett http://samba.org/~abartlet/ Authentication Developer, Samba Team http://samba.org Samba Developer, Catalyst IT http://catalyst.net.nz/services/samba
Andrew Bartlett
2019-Nov-15 02:20 UTC
[Samba] how to reduce binary size of SAMBA 4 for embeded device
On Sun, 2017-08-06 at 17:03 +1200, Andrew Bartlett via samba wrote:> On Wed, 2017-08-02 at 17:37 +0800, ??? wrote: > > Hi, Bartlett > > > > I decided to cut some subsystem by myself, > > So I spent several days to study the SAMBA 4 WAF build system and > > now know the base steps of build. > > but which subsystem can be removed for snmd/nmbd/smbpasswd ? > > That is, essentially, your task. You could compile it under > callcatcher, or use some other symbol dependency tracker to work out > what libraries are linked but not used. > > The real problem however is when a binary like smbd links against a > library, a, which uses b. However often the way that smbd uses a > does > not require b, but it remains a useless dependency. > > The classic example of this is also the easiest one to start solving, > which is that smbd links against libndr-standard and libndr-samba- > samba4. However, most of those libs are not used: sometimes the only > link in is via the ndr_table which lists all our generated IDL by > UUID.I had a go at this recently, and re-posted the results here: https://lists.samba.org/archive/samba-technical/2019-November/134539.html Changing "-O2" to "-Os -s" I got Samba to a 9152kb smbd. Still much more than I know you are hoping for, and I had to cut some important functionality to make this proof of concept compile, but it shows what is possible. Andrew Bartlett -- Andrew Bartlett https://samba.org/~abartlet/ Authentication Developer, Samba Team https://samba.org Samba Development and Support, Catalyst IT https://catalyst.net.nz/services/samba