Skip to contentSkip to conversation

build: pass -no-undefined properly

PATCH In review Ross Burton 2 participants 3 messages Oct 14, 2020 – Oct 20, 2020 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 build: pass -no-undefined properly

From: Ross Burton <[email protected]>

-no-undefined was added to the libell.la LDFLAGS in commit 8391d72d, back in 2012, as part of adding versioning. I believe there was some confusion here as passing -no-undefined to libtool is different to passing -no-undefined to the linker. The former changes libtool's behaviour on Windows hosts related to static libraries, the latter will warn if symbols are used but not defined.

---
 Makefile.am | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile.am +1 -1
index 9b3e3c9..7518c6a 100644
@@ -141,7 +141,7 @@ ell_libell_la_SOURCES = $(linux_headers) \
 			ell/icmp6.c \
 			ell/icmp6-private.h
 
-ell_libell_la_LDFLAGS = -no-undefined \
+ell_libell_la_LDFLAGS = -Wl,--no-undefined \
 			-Wl,--version-script=$(top_srcdir)/ell/ell.sym \
 			-version-info $(ELL_CURRENT):$(ELL_REVISION):$(ELL_AGE)
 
Signature · 1 line
2.28.0
#1 lore raw

PATCH 2/2 build: don't check for or use libdl

From: Ross Burton <[email protected]>

Commit e129cb4 removed the plugin interface entirely, so there's no need to look for dlopen() or pass -ldl when building.

---
 configure.ac  | 3 ---
 ell/ell.pc.in | 2 +-
 2 files changed, 1 insertion(+), 4 deletions(-)
configure.ac +0 -3
index 490784f..b8347e4 100644
@@ -108,9 +108,6 @@ AC_CHECK_FUNC(timerfd_create, dummy=yes,
 AC_CHECK_FUNC(epoll_create, dummy=yes,
 			AC_MSG_ERROR(epoll support is required))
 
-AC_CHECK_LIB(dl, dlopen, dummy=yes,
-			AC_MSG_ERROR(dynamic linking loader is required))
-
 AC_CHECK_HEADERS(linux/types.h linux/if_alg.h)
 
 AC_ARG_ENABLE(glib, AC_HELP_STRING([--enable-glib],
ell/ell.pc.in +1 -1
index 4fc933b..414ea75 100644
@@ -6,5 +6,5 @@ includedir=@includedir@
 Name: ELL
 Description: Embedded Linux library
 Version: @VERSION@
-Libs: -L${libdir} -lell -ldl
+Libs: -L${libdir} -lell
 Cflags: -I${includedir}
Signature · 1 line
2.28.0
#2 lore raw
In reply to Ross Burton

Hi Ross,

Quoted 8 lines · Ross Burton

From: Ross Burton <[email protected]>

-no-undefined was added to the libell.la LDFLAGS in commit 8391d72d, back in 2012, as part of adding versioning. I believe there was some confusion here as passing -no-undefined to libtool is different to passing -no-undefined to the linker. The former changes libtool's behaviour on Windows hosts related to static libraries, the latter will warn if symbols are used but not defined.

Quoted 4 lines
---
  Makefile.am | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

Both applied, thanks.

Regards,
-Denis