From 51612524585887e6659ed75a123e8d69301b6304 Mon Sep 17 00:00:00 2001 From: Stanislaw Kardach Date: Thu, 23 Jan 2020 11:41:31 +0100 Subject: build: do not define libodp as part of helper This prevents multiple inclusion of libodp-linux during builds, once as part of libodphelper and then directly by the application. This causes problems when linking statically with LTO enabled. On tested compiler (9.2.1-9ubuntu2) such duplication causes constructor symbols to be defined multiple times. This means that constructors will be run multiple times which leads to unexpected behavior. To fix this, remove libodp from helper link list. This works when compiling applications because there is no point in using libodphelper without libodp-linux, therefore both libraries have to be provided. After removing library order in example/Makefile.inc is required to ensure the proper linking. Signed-off-by: Stanislaw Kardach Signed-off-by: Nithin Dabilpuram Reviewed-by: Matias Elo Reviewed-by: Petri Savolainen --- helper/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'helper/Makefile.am') diff --git a/helper/Makefile.am b/helper/Makefile.am index cfeeeeb40..aa645cc8e 100644 --- a/helper/Makefile.am +++ b/helper/Makefile.am @@ -60,6 +60,6 @@ __LIB__libodphelper_la_SOURCES += \ linux/thread.c endif -__LIB__libodphelper_la_LIBADD = $(PTHREAD_LIBS) $(LIB)/libodp-linux.la +__LIB__libodphelper_la_LIBADD = $(PTHREAD_LIBS) lib_LTLIBRARIES = $(LIB)/libodphelper.la -- cgit v1.2.3