conmon
conmon copied to clipboard
fails to compile when static linking is used
Hi,
the following fix can be used to compile conmon statically, because the header is not required:
diff --git a/src/seccomp_notify.c b/src/seccomp_notify.c
index 8d34d9d..2a8371d 100644
--- a/src/seccomp_notify.c
+++ b/src/seccomp_notify.c
@@ -7,7 +7,6 @@
#include <errno.h>
#include <sys/ioctl.h>
-#include <dlfcn.h>
#include <sys/wait.h>
#include <sys/mount.h>
#include <signal.h>
best regards Waldemar
Hi Waldemar,
Removing this include breaks dynamic build:
src/seccomp_notify.c: In function 'seccomp_notify_plugins_load':
src/seccomp_notify.c:136:42: warning: implicit declaration of function 'dlopen'; did you mean 'popen'? [-Wimplicit-function-declaration]
136 | ctx->plugins[s].handle = dlopen(it, RTLD_NOW);
| ^~~~~~
| popen
src/seccomp_notify.c:136:53: error: 'RTLD_NOW' undeclared (first use in this function)
136 | ctx->plugins[s].handle = dlopen(it, RTLD_NOW);
| ^~~~~~~~
Full build log: http://autobuild.buildroot.org/results/13d/13d3b46990720bba8621c922b5dce54ab650e96d/build-end.log
However, this include must be moved to fix static build without seccomp, see #462