From e7b24b67db358d081f2c232a437df4fb860d0ed7 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Wed, 13 Mar 2013 08:29:59 -0700 Subject: [PATCH] Fix build when shared libraries are disabled On some platforms, shared libraries are not used. The stub code need some updating to not generate errors. --- genl/static-syms.c | 8 ++++++++ include/dlfcn.h | 1 + ip/static-syms.c | 8 ++++++++ tc/static-syms.c | 8 ++++++++ 4 files changed, 25 insertions(+) diff --git a/genl/static-syms.c b/genl/static-syms.c index 1ed3a8a9..0bc80743 100644 --- a/genl/static-syms.c +++ b/genl/static-syms.c @@ -1,4 +1,12 @@ +/* + * This file creates a dummy version of dynamic loading + * for environments where dynamic linking + * is not used or available. + */ + #include +#include "dlfcn.h" + void *_dlsym(const char *sym) { #include "static-syms.h" diff --git a/include/dlfcn.h b/include/dlfcn.h index b0be5a0f..c54f8d8e 100644 --- a/include/dlfcn.h +++ b/include/dlfcn.h @@ -8,6 +8,7 @@ #else #define RTLD_LAZY 0 +#define RTLD_GLOBAL 1 #define _FAKE_DLFCN_HDL (void *)0xbeefcafe static inline void *dlopen(const char *file, int flag) diff --git a/ip/static-syms.c b/ip/static-syms.c index 1ed3a8a9..0bc80743 100644 --- a/ip/static-syms.c +++ b/ip/static-syms.c @@ -1,4 +1,12 @@ +/* + * This file creates a dummy version of dynamic loading + * for environments where dynamic linking + * is not used or available. + */ + #include +#include "dlfcn.h" + void *_dlsym(const char *sym) { #include "static-syms.h" diff --git a/tc/static-syms.c b/tc/static-syms.c index 1ed3a8a9..0bc80743 100644 --- a/tc/static-syms.c +++ b/tc/static-syms.c @@ -1,4 +1,12 @@ +/* + * This file creates a dummy version of dynamic loading + * for environments where dynamic linking + * is not used or available. + */ + #include +#include "dlfcn.h" + void *_dlsym(const char *sym) { #include "static-syms.h"