Skip to contentSkip to conversation

unit: Fixed Mesh Crypto unit test build for LTO

PATCH Applied Brian Gix 1 participant 2 messages Nov 5, 2019 – Nov 7, 2019

Subsystems (2)
lore
Share & tools
lore

Brian Gix

author
#0 lore raw

PATCH 1/1 unit: Fixed Mesh Crypto unit test build for LTO

Was erroneously compiling and linking explicit unit test versions of the ELL source dependancies while also linking with the library made from same sources. The created Link Time Optimization (LTO) problems when calling exit(), as there were two copies of the constructors and destructors from ell/log.c.

---
 Makefile.am | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
Makefile.am +2 -4
index 84c9712c9..8d419fb30 100644
@@ -524,10 +524,8 @@ if MESH
 unit_tests += unit/test-mesh-crypto
 unit_test_mesh_crypto_CPPFLAGS = $(ell_cflags)
 unit_test_mesh_crypto_SOURCES = unit/test-mesh-crypto.c \
-				mesh/crypto.h ell/internal ell/ell.h \
-				$(ell_sources)
-unit_test_mesh_crypto_LDADD = src/libshared-ell.la \
-			$(ell_ldadd)
+				mesh/crypto.h ell/internal ell/ell.h
+unit_test_mesh_crypto_LDADD = $(ell_ldadd)
 endif
 
 if MAINTAINER_MODE
Signature · 1 line
2.21.0
author Applied
#1 lore raw

Applied

Quoted 26 lines · Brian Gix

Was erroneously compiling and linking explicit unit test versions of the ELL source dependancies while also linking with the library made from same sources. This created Link Time Optimization (LTO) problems when calling exit(), as there were two copies of the constructors and destructors from ell/log.c.

---
 Makefile.am | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
Makefile.am +2 -4
index 84c9712c9..8d419fb30 100644
@@ -524,10 +524,8 @@ if MESH
 unit_tests += unit/test-mesh-crypto
 unit_test_mesh_crypto_CPPFLAGS = $(ell_cflags)
 unit_test_mesh_crypto_SOURCES = unit/test-mesh-crypto.c \
-				mesh/crypto.h ell/internal ell/ell.h \
-				$(ell_sources)
-unit_test_mesh_crypto_LDADD = src/libshared-ell.la \
-			$(ell_ldadd)
+				mesh/crypto.h ell/internal ell/ell.h
+unit_test_mesh_crypto_LDADD = $(ell_ldadd)
 endif
 
 if MAINTAINER_MODE