talloc: rename local timeval function copies

Enterprise / Samba - Ralph Boehme [samba.org] - 1 June 2016 14:09 UTC

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::function smbsrv_accept.lto_priv.11: error: undefined reference to 'timeval_current.lto_priv.630' /tmp/ccvL9UCe.ltrans4.ltrans.o::function smbsrv_recv_smb2_request: error: undefined reference to 'timeval_current.lto_priv.630' /tmp/ccvL9UCe.ltrans4.ltrans.o::function smb2srv_negprot_backend: error: undefined reference to 'timeval_current.lto_priv.630' /tmp/ccvL9UCe.ltrans4.ltrans.o::function smb2srv_negprot_backend: error: undefined reference to 'timeval_current.lto_priv.630' /tmp/ccvL9UCe.ltrans9.ltrans.o::function test_smb2_oplock_batch22: error: undefined reference to 'timeval_elapsed.lto_priv.628' /tmp/ccvL9UCe.ltrans9.ltrans.o::function test_smb2_bench_oplock: error: undefined reference to 'timeval_elapsed.lto_priv.628' /tmp/ccvL9UCe.ltrans9.ltrans.o::function test_smb2_bench_oplock: error: undefined reference to 'timeval_elapsed.lto_priv.628' /tmp/ccvL9UCe.ltrans9.ltrans.o::function test_smb2_bench_oplock: error: undefined reference to 'timeval_elapsed.lto_priv.628' collect2: error: ld returned 1 exit status

e8c9e10 talloc: rename local timeval function copies
lib/talloc/testsuite.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)

Upstream: gitweb.samba.org


  • Share