conmon icon indicating copy to clipboard operation
conmon copied to clipboard

fails to compile when static linking is used

Open wbx-github opened this issue 2 years ago • 2 comments

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

wbx-github avatar Aug 12 '23 10:08 wbx-github

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

ffontaine avatar Sep 16 '23 12:09 ffontaine

However, this include must be moved to fix static build without seccomp, see #462

ffontaine avatar Nov 01 '23 16:11 ffontaine