talloc: rename local timeval function copies
authorRalph Boehme <slow@samba.org>
Wed, 1 Jun 2016 13:42:13 +0000 (15:42 +0200)
committerVolker Lendecke <vl@samba.org>
Wed, 1 Jun 2016 19:09:16 +0000 (21:09 +0200)
commite8c9e10dbbc585f346a4159b75fcc024cfe1c01a
treeed7133b96a297e0364d20982e1ce9d10fc24be8d
parentf8141e91a693912ea1107a49320e83702a80757a
talloc: rename local timeval function copies

timeval_current() and timeval_elapsed() are public functions from
libsamba-util. Redeclaring them as static functions here triggers linker
error when building with gcc link-time-optimisation (LTO).

This shows the error after reverting this patch:
[slow@kazak lto]$ make -j
WAF_MAKE=1 python ./buildtools/bin/waf build
Waf: Entering directory `/home/slow/git/samba/lto/bin'
        Selected embedded Heimdal build
[ 174/4259] Generating ctdb-samba-version-header
[ 174/4259] Generating ctdb-samba-version-header
[ 521/4259] Generating source4/torture/local/proto.h
[2565/4259] Compiling lib/talloc/testsuite.c
[4125/4259] Linking default/source4/torture/smbtorture
/tmp/ccvL9UCe.ltrans3.ltrans.o:<artificial>:function smbsrv_accept.lto_priv.11: error: undefined reference to 'timeval_current.lto_priv.630'
/tmp/ccvL9UCe.ltrans4.ltrans.o:<artificial>:function smbsrv_recv_smb2_request: error: undefined reference to 'timeval_current.lto_priv.630'
/tmp/ccvL9UCe.ltrans4.ltrans.o:<artificial>:function smb2srv_negprot_backend: error: undefined reference to 'timeval_current.lto_priv.630'
/tmp/ccvL9UCe.ltrans4.ltrans.o:<artificial>:function smb2srv_negprot_backend: error: undefined reference to 'timeval_current.lto_priv.630'
/tmp/ccvL9UCe.ltrans9.ltrans.o:<artificial>:function test_smb2_oplock_batch22: error: undefined reference to 'timeval_elapsed.lto_priv.628'
/tmp/ccvL9UCe.ltrans9.ltrans.o:<artificial>:function test_smb2_bench_oplock: error: undefined reference to 'timeval_elapsed.lto_priv.628'
/tmp/ccvL9UCe.ltrans9.ltrans.o:<artificial>:function test_smb2_bench_oplock: error: undefined reference to 'timeval_elapsed.lto_priv.628'
/tmp/ccvL9UCe.ltrans9.ltrans.o:<artificial>:function test_smb2_bench_oplock: error: undefined reference to 'timeval_elapsed.lto_priv.628'
collect2: error: ld returned 1 exit status
...

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Wed Jun  1 21:09:16 CEST 2016 on sn-devel-144
lib/talloc/testsuite.c