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

fails to compile when static linking is used #443

Open
wbx-github opened this issue Aug 12, 2023 · 2 comments
Open

fails to compile when static linking is used #443

wbx-github opened this issue Aug 12, 2023 · 2 comments

Comments

@wbx-github
Copy link

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

@ffontaine
Copy link
Contributor

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
Copy link
Contributor

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

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