From: Stephen Hemminger Date: Wed, 13 Mar 2013 15:29:59 +0000 (-0700) Subject: Fix build when shared libraries are disabled X-Git-Tag: v3.9.0~33 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e7b24b67db358d081f2c232a437df4fb860d0ed7;p=thirdparty%2Fiproute2.git 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. --- diff --git a/genl/static-syms.c b/genl/static-syms.c index 1ed3a8a90..0bc80743a 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 b0be5a0f4..c54f8d8e8 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 1ed3a8a90..0bc80743a 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 1ed3a8a90..0bc80743a 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"