From aecbd46a2cc33234f8132f49a44196f6a0141824 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Thu, 16 Jun 2022 20:36:56 -0700 Subject: [PATCH] fix: use '-module -avoid-version' when compiling TCL packages Quoting from #1285: They are runtime loadable (dlopen, or equivalent, from tcl program, via 'load') rather than shared libraries for dynamic linking by others. On OS X, these two concepts have different extensions (.so vs .dylib). It's confusing when a runtime-loadable module has a dynamic-linker extension. In commit 40123aedcd2761e98d8c9917be6040ea6187c97f, the -module flag was added to LDFLAGS in tclpkg/gv/Makefile.am, which fixes libgv_tcl. Could the same change be applied to the other tclpkg/*/Makefile.am LDFLAGS? Gitlab: fixes #1285 Suggested-by: Daniel Macks --- CHANGELOG.md | 1 + tclpkg/gdtclft/Makefile.am | 2 +- tclpkg/tcldot/Makefile.am | 4 ++-- tclpkg/tclhandle/Makefile.am | 1 + tclpkg/tclpathplan/Makefile.am | 2 +- tclpkg/tclstubs/Makefile.am | 1 + tclpkg/tkspline/Makefile.am | 2 +- tclpkg/tkstubs/Makefile.am | 1 + 8 files changed, 9 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 652afa385..6c8addf28 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Failed assertion in `chkSgraph` for circo layout and ortho splines. #1990 - Segmentation Fault with splines="ortho". #1658 - Transparent Label appear in SVG output #146 +- Binary tcl modules should compile with -module #1285 ## [4.0.0] – 2022-05-29 diff --git a/tclpkg/gdtclft/Makefile.am b/tclpkg/gdtclft/Makefile.am index 89d3b8bc6..c2f77c318 100644 --- a/tclpkg/gdtclft/Makefile.am +++ b/tclpkg/gdtclft/Makefile.am @@ -28,7 +28,7 @@ endif libgdtclft_la_SOURCES = gdtclft.c libgdtclft_C_la_SOURCES = gdtclft.c -libgdtclft_la_LDFLAGS = -no-undefined +libgdtclft_la_LDFLAGS = -no-undefined -module -avoid-version if WITH_LIBGD libgdtclft_la_LIBADD = \ diff --git a/tclpkg/tcldot/Makefile.am b/tclpkg/tcldot/Makefile.am index d6ff588b3..115cf9c96 100644 --- a/tclpkg/tcldot/Makefile.am +++ b/tclpkg/tcldot/Makefile.am @@ -46,7 +46,7 @@ libtcldot_la_SOURCES = \ tcldot-io.c \ no_builtins.c $(GDTCLFT) libtcldot_la_CPPFLAGS = $(AM_CPPFLAGS) -DDEMAND_LOADING=1 -libtcldot_la_LDFLAGS = -no-undefined +libtcldot_la_LDFLAGS = -no-undefined -module -avoid-version libtcldot_la_LIBADD = $(TCLHANDLE_LIBS) $(GDTCLFT_LIBS) \ $(top_builddir)/tclpkg/tclstubs/libtclstubs_C.la \ @@ -74,7 +74,7 @@ libtcldot_builtin_la_SOURCES = \ tcldot-io.c \ tcldot_builtins.c $(GDTCLFT) libtcldot_builtin_la_CPPFLAGS = $(AM_CPPFLAGS) -DDEMAND_LOADING=1 -libtcldot_builtin_la_LDFLAGS = -no-undefined +libtcldot_builtin_la_LDFLAGS = -no-undefined -module -avoid-version libtcldot_builtin_la_LIBADD = $(TCLHANDLE_LIBS) \ $(top_builddir)/plugin/dot_layout/libgvplugin_dot_layout_C.la \ diff --git a/tclpkg/tclhandle/Makefile.am b/tclpkg/tclhandle/Makefile.am index 8f5911861..039aace1c 100644 --- a/tclpkg/tclhandle/Makefile.am +++ b/tclpkg/tclhandle/Makefile.am @@ -6,3 +6,4 @@ noinst_LTLIBRARIES = libtclhandle_C.la endif libtclhandle_C_la_SOURCES = tclhandle.c +libtclhandle_C_la_LDFLAGS = -module -avoid-version diff --git a/tclpkg/tclpathplan/Makefile.am b/tclpkg/tclpathplan/Makefile.am index ee29105a4..a48dd37c0 100644 --- a/tclpkg/tclpathplan/Makefile.am +++ b/tclpkg/tclpathplan/Makefile.am @@ -15,7 +15,7 @@ libtclplan_la_CPPFLAGS = \ -I$(top_srcdir)/tclpkg/tclhandle \ -I$(top_srcdir)/lib/pathplan $(TCL_INCLUDES) libtclplan_la_CFLAGS = $(TCL_CFLAGS) -libtclplan_la_LDFLAGS = -no-undefined +libtclplan_la_LDFLAGS = -no-undefined -module -avoid-version libtclplan_la_LIBADD = \ $(top_builddir)/tclpkg/tclhandle/libtclhandle_C.la \ $(top_builddir)/tclpkg/tclstubs/libtclstubs_C.la \ diff --git a/tclpkg/tclstubs/Makefile.am b/tclpkg/tclstubs/Makefile.am index a9adb7566..0a758cc79 100644 --- a/tclpkg/tclstubs/Makefile.am +++ b/tclpkg/tclstubs/Makefile.am @@ -9,3 +9,4 @@ endif libtclstubs_C_la_SOURCES = tclStubLib.c libtclstubs_C_la_CPPFLAGS = $(TCL_CFLAGS) $(TCL_INCLUDES) libtclstubs_C_la_LIBADD = $(TCL_STUB_LIB_SPEC) +libtclstubs_C_la_LDFLAGS = -module -avoid-version diff --git a/tclpkg/tkspline/Makefile.am b/tclpkg/tkspline/Makefile.am index 6b746a79a..099654d3c 100644 --- a/tclpkg/tkspline/Makefile.am +++ b/tclpkg/tkspline/Makefile.am @@ -25,7 +25,7 @@ pdf_DATA = tkspline.3tk.pdf endif endif -libtkspline_la_LDFLAGS = -no-undefined +libtkspline_la_LDFLAGS = -no-undefined -module -avoid-version libtkspline_la_SOURCES = tkspline.c libtkspline_la_LIBADD = \ $(top_builddir)/tclpkg/tkstubs/libtkstubs_C.la \ diff --git a/tclpkg/tkstubs/Makefile.am b/tclpkg/tkstubs/Makefile.am index c63aed873..27f215390 100644 --- a/tclpkg/tkstubs/Makefile.am +++ b/tclpkg/tkstubs/Makefile.am @@ -9,3 +9,4 @@ endif libtkstubs_C_la_SOURCES = tkStubLib.c tkStubImg.c libtkstubs_C_la_CPPFLAGS = $(TCL_CFLAGS) $(TK_CFLAGS) $(TCL_INCLUDES) $(TK_INCLUDES) $(TK_XINCLUDES) libtkstubs_C_la_LIBADD = $(TK_STUB_LIB_SPEC) +libtkstubs_C_la_LDFLAGS = -module -avoid-version -- 2.40.0