# [SOLVED] emerging samba fails - missing MD5 functions

## suprafluid

Hi all,

While setting up a new server, I came across this problem:

When emerging net-fs/samba-4.5.10, emerge stops at this line:

```

[2279/2709] Linking default/libcli/smb/libsmb-transport-samba4.so

13:24:28 runner x86_64-pc-linux-gnu-gcc default/lib/async_req/async_sock_1.o default/libcli/smb/read_smb_1.o -o /var/tmp/portage/net-fs/samba-4.5.10/work/samba-4.5.10-abi_x86_64.amd64/bin/default/libcli/smb/libsmb-transport-samba4.so -march=sandybridge -O2 -pipe -Wl,-O1 -Wl,--as-needed -Wl,-O1 -Wl,--as-needed -Wl,-z,relro,-z,now -lpthread -Wl,-no-undefined -Wl,--export-dynamic -fstack-protector -shared -Wl,--version-script=/var/tmp/portage/net-fs/samba-4.5.10/work/samba-4.5.10-abi_x86_64.amd64/bin/default/libcli/smb/smb_transport.vscript -Wl,-rpath,/usr/lib64 -Ldefault/libcli/util -Ldefault/lib/replace -Ldefault/lib/util -L/usr/local/lib -Wl,-Bdynamic -liov-buf-samba4 -ltevent-util -lsocket-blocking-samba4 -lreplace-samba4 -lsamba-errors -lsamba-debug-samba4 -ltime-basic-samba4 -lrt -ldl -lnsl -lattr -lcrypt -ltevent -ltalloc

[2280/2709] Linking default/lib/async_req/async_connect_send_test

13:24:28 runner x86_64-pc-linux-gnu-gcc default/lib/async_req/async_sock_1.o default/lib/async_req/async_connect_send_test_2.o -o /var/tmp/portage/net-fs/samba-4.5.10/work/samba-4.5.10-abi_x86_64.amd64/bin/default/lib/async_req/async_connect_send_test -march=sandybridge -O2 -pipe -Wl,-O1 -Wl,--as-needed -Wl,-O1 -Wl,--as-needed -pie -Wl,-z,relro,-z,now -lpthread -Wl,-no-undefined -Wl,--export-dynamic -fstack-protector -Wl,-rpath,/usr/lib64 -Ldefault/libcli/util -Ldefault/lib/replace -Ldefault/lib/util -L/usr/local/lib -Wl,-Bdynamic -liov-buf-samba4 -ltevent-util -lsocket-blocking-samba4 -lreplace-samba4 -lsamba-errors -lsamba-debug-samba4 -ltime-basic-samba4 -lrt -ldl -lnsl -lattr -lcrypt -ltevent -ltalloc

default/lib/crypto/hmacmd5_1.o: In function `hmac_md5_init_rfc2104':

hmacmd5.c:(.text+0x11c): undefined reference to `MD5Init'

hmacmd5.c:(.text+0x12c): undefined reference to `MD5Update'

hmacmd5.c:(.text+0x156): undefined reference to `MD5Init'

hmacmd5.c:(.text+0x16b): undefined reference to `MD5Update'

hmacmd5.c:(.text+0x176): undefined reference to `MD5Final'

default/lib/crypto/hmacmd5_1.o: In function `hmac_md5_final':

hmacmd5.c:(.text+0x21e): undefined reference to `MD5Final'

hmacmd5.c:(.text+0x226): undefined reference to `MD5Init'

hmacmd5.c:(.text+0x23a): undefined reference to `MD5Update'

hmacmd5.c:(.text+0x24a): undefined reference to `MD5Update'

hmacmd5.c:(.text+0x255): undefined reference to `MD5Final'

default/lib/crypto/hmacmd5_1.o: In function `hmac_md5_update':

hmacmd5.c:(.text+0x1dd): undefined reference to `MD5Update'

collect2: error: ld returned 1 exit status

Waf: Leaving directory `/var/tmp/portage/net-fs/samba-4.5.10/work/samba-4.5.10-abi_x86_64.amd64/bin'

Build failed:  -> task failed (err #1):

   {task: cc_link crc32_1.o,hmacmd5_1.o,md4_1.o,arcfour_1.o,sha256_1.o,sha512_1.o,hmacsha256_1.o,aes_1.o,

rijndael-alg-fst_1.o,aes_cmac_128_1.o,aes_ccm_128_1.o,aes_gcm_128_1.o,codepoints_2.o,

convert_string_2.o,util_str_2.o,util_unistr_w_2.o,pull_push_2.o,util_unistr_2.o,weird_2.o,

charset_macosxfs_2.o,strv_6.o,iconv_1.o,dynconfig_1.o,tini_4.o,talloc_stack_32.o,

smb_threads_32.o,rbtree_32.o,rfc1738_32.o,become_daemon_32.o,system_32.o,select_32.o,

getpass_32.o,genrand_util_32.o,fsusage_32.o,params_32.o,util_id_32.o,util_net_32.o,

util_strlist_v3_32.o,util_paths_32.o,idtree_random_32.o,base64_32.o,util_str_32.o,

util_str_common_32.o,ms_fnmatch_32.o,server_id_32.o,dprintf_32.o,bitmap_32.o,pidfile_32.o,

tevent_debug_32.o,memcache_32.o,tiniparser_5.o,xfile_17.o,data_blob_17.o,util_file_17.o,

time_17.o,signal_17.o,util_17.o,idtree_17.o,fault_17.o,substitute_17.o,util_process_17.o,

util_strlist_17.o,strv_util_17.o -> libsamba-util.so}

ERROR: net-fs/samba-4.5.10::gentoo failed (compile phase):

```

In libcrypt, there are no MD5 functions? At least nm show none of them. I re-emerged also glibc (2.23-r4 and also tried  ~amd64 v2.25), openssl... with no success.

Any ideas what I could try to get samba running?

[Moderator edit: broke extremely long whitespace-free lines in code tags to fix thread layout. What kind of crazy build system uses comma-separated object file lists? -Hu]

----------

## fedeliallalinea

MD5Final, MD5Init,... are in dev-libs/libbsd package. Try to recompile this package

----------

## suprafluid

Thanks a lot!! re-emergeing libbsd-0.8.3 solved it!

----------

