--- Makefile +++ Makefile @@ -13,8 +13,9 @@ # CC=gcc -CC_FLAGS=-fPIC -Wall -LD=ld +LIBC=$(shell ldd `which bash`|grep 'libc.so.6'| sed 's/^.*=> *//g;s/ .*$$//g') +CC_FLAGS=-fPIC $(RPM_OPT_FLAGS) -DLIBC_PATH=\"$(LIBC)\" +LD=$(CC) LD_FLAGS=-shared INSTALL=install --- src_vipa.c +++ src_vipa.c @@ -42,7 +42,7 @@ #include -#define LIBC_PATH "libc.so.6" +/* #define LIBC_PATH "libc.so.6" defined in Makefile */ #define DLOPEN_FLAG RTLD_LAZY @@ -1255,7 +1255,7 @@ } #ifndef LC_TEST -void _init(void) +static void __attribute__((constructor)) _init(void) { leader_pid = getpid(); init_mutexes(); @@ -1265,7 +1265,7 @@ read_config_file(); } -void _fini(void) +static void __attribute__((destructor)) _fini(void) { if (dl_handle) dlclose(dl_handle); destroy_shm();