Skip to contentSkip to conversation

package/monit: do not forcibly build a static binary

PATCH New Yann E. MORIN 2 participants 2 messages Sep 5, 2014 – Sep 6, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/monit: do not forcibly build a static binary

Static linking with glibc is not really supported, because of the NSS libraries that are still to be dynamically-loaded at runtime.

Also, Buildroot explicitly does not support statically linking with glibc.

---
 package/monit/monit-0001-no-force-static.patch | 20 ++++++++++++++++++++
 package/monit/monit.mk                         |  9 +++++++++
 2 files changed, 29 insertions(+)
 create mode 100644 package/monit/monit-0001-no-force-static.patch
package/monit/monit-0001-no-force-static.patch new file +20 -0
new file mode 100644
index 0000000..edb619b
@@ -0,0 +1,20 @@
+Do not force building a statically-linked binary
+
+Statically-linked binary do not work well with glibc, because it
+still dlopen()s the NSS libraries.
+
+Reported-by: Peter K?mmel <[email protected]>
+Signed-off-by: "Yann E. MORIN" <[email protected]>
+
+diff -durN monit-5.7.orig/Makefile.am monit-5.7/Makefile.am
+--- monit-5.7.orig/Makefile.am	2014-02-20 09:00:42.000000000 +0100
++++ monit-5.7/Makefile.am	2014-09-05 12:49:43.711104001 +0200
+@@ -85,7 +85,7 @@
+ 		  src/process/sysdep_ at [email protected]
+  
+ monit_LDADD 	= libmonit/libmonit.la
+-monit_LDFLAGS 	= -static $(EXTLDFLAGS)
++monit_LDFLAGS 	= $(EXTLDFLAGS)
+ 
+ man_MANS 	= monit.1
+ 
package/monit/monit.mk +9 -0
index 25bb5a2..fa3a6d8 100644
@@ -8,6 +8,15 @@ MONIT_VERSION = 5.7
 MONIT_SITE = http://mmonit.com/monit/dist
 MONIT_LICENSE = AGPLv3 with OpenSSL exception
 MONIT_LICENSE_FILES = COPYING
+#
+# Touching Makefile.am:
+MONIT_AUTORECONF = YES
+
+# Missing m4/ directory in the source tree
+define MONIT_M4
+	mkdir $(@D)/m4
+endef
+MONIT_POST_PATCH_HOOKS += MONIT_M4
 
 MONIT_CONF_ENV = \
 	libmonit_cv_setjmp_available=yes \
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/1 package/monit: do not forcibly build a static binary

Quoted 10 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Yann" == Yann E MORIN <[email protected]> writes:

Static linking with glibc is not really supported, because of the NSS libraries that are still to be dynamically-loaded at runtime.

Also, Buildroot explicitly does not support statically linking with glibc.

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard