[SSSD] [PATCH] TESTS: Link libsss_test_common with tevent

Lukas Slebodnik lslebodn at redhat.com
Mon Nov 18 09:59:20 UTC 2013


On (18/11/13 10:41), Lukas Slebodnik wrote:
>ehlo,
>
>Static library libsss_test_common calls tevent functions directly (in module
>common_tev.c), but it was not linked with tevent library.
>
>Compilation will fail if sssd is linked with "-Wl,--as-needed"
>  CCLD     test_utils
>/usr/bin/ld: ./.libs/libsss_test_common.a(common_tev.o): undefined reference to symbol 'tevent_context_init@@TEVENT_0.9.9'
>/usr/bin/ld: note: 'tevent_context_init@@TEVENT_0.9.9' is defined in DSO /usr/lib/gcc/x86_64-redhat-linux/4.8.2/../../../../lib64/libtevent.so so try adding it to the linker command line
>/usr/lib/gcc/x86_64-redhat-linux/4.8.2/../../../../lib64/libtevent.so: could not read symbols: Invalid operation
>clang: error: linker command failed with exit code 1 (use -v to see invocation)
>
>nm ./libsss_test_common.a  | grep tevent
>                 U tevent_context_init
>                 U _tevent_loop_once
>                 U _tevent_req_create
>                 U _tevent_req_done
>                 U _tevent_req_error
>                 U tevent_req_is_error
>                 U tevent_req_post
>
>Simple patch is attached.
One more time :-)

LS
-------------- next part --------------
>From d2d38d15eeb51bca463e89a7be2f96c417df4d06 Mon Sep 17 00:00:00 2001
From: Lukas Slebodnik <lslebodn at redhat.com>
Date: Mon, 18 Nov 2013 10:30:30 +0100
Subject: [PATCH] TESTS: Link libsss_test_common with tevent

Static library libsss_test_common calls tevent functions directly (in module
common_tev.c), but it was not linked with tevent library.
---
 Makefile.am | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Makefile.am b/Makefile.am
index de6b60d931c7a66e84423179314a132320aa3ba6..d0543d9fbf2b204cd81c46d2eaa9ebe9e28b37ed 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -907,7 +907,8 @@ libsss_test_common_la_SOURCES = \
     src/tests/leak_check.c \
     src/tests/common.c
 libsss_test_common_la_LIBADD = \
-    $(TALLOC_LIBS)
+    $(TALLOC_LIBS) \
+    $(TEVENT_LIBS)
 
 if HAVE_CHECK
 libsss_test_common_la_SOURCES += \
-- 
1.8.4.2



More information about the sssd-devel mailing list