Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building dynamic nc and openssl on libressl-3.8.1 #906

Open
arachsys opened this issue Aug 31, 2023 · 4 comments
Open

Building dynamic nc and openssl on libressl-3.8.1 #906

arachsys opened this issue Aug 31, 2023 · 4 comments

Comments

@arachsys
Copy link

arachsys commented Aug 31, 2023

As noted in the changelog:

  • Applications bundled as part of the LibreSSL package internally,
    nc(1) and openssl(1), now are linked statically if static libraries
    are built.

Wanting to build dynamically linked nc and openssl tools, I followed the implied advice in the above and configured with --disable-static --enable-nc. However, this doesn't work. It still results in statically linked tools.

Am I not properly disabling the building of static libraries with --disable-static, or is there some other trick I can use to override this new behaviour? I'm happy to build libressl twice if necessary to get both shared and static libraries, but still have the dynamically-linked nc and openssl.

@arachsys
Copy link
Author

arachsys commented Jan 4, 2024

Answering my own question for the benefit of anyone else who might want to do this:

diff --git a/apps/nc/Makefile.am b/apps/nc/Makefile.am
index aba306e..28ef3ec 100644
--- a/apps/nc/Makefile.am
+++ b/apps/nc/Makefile.am
@@ -16,12 +16,10 @@ endif
 EXTRA_DIST = nc.1
 EXTRA_DIST += CMakeLists.txt

-nc_LDADD = $(libcrypto_la_objects)
+nc_LDADD = $(abs_top_builddir)/tls/libtls.la
 nc_LDADD += $(libcompat_la_objects)
 nc_LDADD += $(libcompatnoopt_la_objects)
-nc_LDADD += $(libssl_la_objects)
-nc_LDADD += $(libtls_la_objects)

 nc_LDADD += $(PLATFORM_LDADD) $(PROG_LDADD)

 AM_CPPFLAGS += -I$(top_srcdir)/apps/nc/compat
diff --git a/apps/ocspcheck/Makefile.am b/apps/ocspcheck/Makefile.am
index e6f3c54..2d1aa5d 100644
--- a/apps/ocspcheck/Makefile.am
+++ b/apps/ocspcheck/Makefile.am
@@ -14,11 +14,10 @@ endif
 EXTRA_DIST = ocspcheck.8
 EXTRA_DIST += CMakeLists.txt

-ocspcheck_LDADD = $(libcrypto_la_objects)
+ocspcheck_LDADD = $(abs_top_builddir)/ssl/libssl.la
+ocspcheck_LDADD += $(abs_top_builddir)/tls/libtls.la
 ocspcheck_LDADD += $(libcompat_la_objects)
 ocspcheck_LDADD += $(libcompatnoopt_la_objects)
-ocspcheck_LDADD += $(libssl_la_objects)
-ocspcheck_LDADD += $(libtls_la_objects)
 ocspcheck_LDADD += $(PLATFORM_LDADD) $(PROG_LDADD)

 ocspcheck_SOURCES = http.c
diff --git a/apps/openssl/Makefile.am b/apps/openssl/Makefile.am
index 2567ef0..95ed845 100644
--- a/apps/openssl/Makefile.am
+++ b/apps/openssl/Makefile.am
@@ -10,10 +10,9 @@ else
 noinst_PROGRAMS = openssl
 endif

-openssl_LDADD = $(libcrypto_la_objects)
+openssl_LDADD = $(abs_top_builddir)/ssl/libssl.la
 openssl_LDADD += $(libcompat_la_objects)
 openssl_LDADD += $(libcompatnoopt_la_objects)
-openssl_LDADD += $(libssl_la_objects)
 openssl_LDADD += $(PLATFORM_LDADD) $(PROG_LDADD)

 openssl_SOURCES = apps.c

@orbea
Copy link

orbea commented Jan 16, 2024

@arachsys Is there a reason to not make a PR?

@arachsys
Copy link
Author

arachsys commented Jan 16, 2024

@arachsys Is there a reason to not make a PR?

Yes: this reverses an intentional change by the maintainer in a316f8a. I'm assuming there's a good reason for the standard build to generate statically linked tools although the commit message doesn't hint at it.

Potentially plumbing through something like configure --enable-dynamic-tools to conditionalise this behaviour might fly with them, though, if you wanted something more packaged than a build-time patch.

@orbea
Copy link

orbea commented Jan 16, 2024

It would be nice to maintain as few patches as possible, but maybe @busterb can kindly explain the reasoning behind the commit? Maybe there is something I don't realize?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants