+2005-02-08 Ken Raeburn <raeburn@mit.edu>
+
+ * lib.in (config.status): Change target to be in $thisconfigdir
+ rather than local.
+ (osf1.exports): Create a temporary file then rename into place.
+ Add options for library init/fini symbols, handling multiple
+ values.
+
+ * shlib.conf (case alpha*-dec-osf*): Don't handle init/fini
+ symbols here.
+ (case mips-sgi-irix*): Handle multiple init/fini symbols. Always
+ set $initfini before it gets used.
+ (case *-*-solaris*, not gcc): Handle multiple init/fini symbols.
+ (case *-*-aix*): Handle multiple fini symbols.
+
2004-12-17 Jeffrey Altman <jaltman@mit.edu>
* win-pre.in: add -debug switch to LOPTS if DEBUG_SYMBOLS
echo >> binutils.versions "};"
osf1.exports: $(SHLIB_EXPORT_FILE) Makefile
- sed "s/^/-exported_symbol /" < $(SHLIB_EXPORT_FILE) > osf1.exports
+ $(RM) osf1.tmp osf1.exports
+ sed "s/^/-exported_symbol /" < $(SHLIB_EXPORT_FILE) > osf1.tmp
+ for f in . $(LIBINITFUNC); do \
+ if test "$$f" != "." ; then \
+ echo " -init $$f"__auxinit >> osf1.tmp; \
+ else :; fi; \
+ done
+ a=""; \
+ for f in . $(LIBFINIFUNC); do \
+ if test "$$f" != "." ; then \
+ a="-fini $$f $$a"; \
+ else :; fi; \
+ done; echo " $$a" >> osf1.tmp; \
+ mv -f osf1.tmp osf1.exports
lib$(LIBBASE)$(PFLIBEXT): $(PFOBJLISTS)
$(RM) $@
$(RANLIB) $(DESTDIR)$(KRB5_LIBDIR)/lib$(LIBBASE)$(PFLIBEXT)
Makefile: $(SRCTOP)/config/lib.in
-config.status: $(SRCTOP)/config/shlib.conf
+$(thisconfigdir)/config.status: $(SRCTOP)/config/shlib.conf
# Use the following if links need to be made to $(TOPLIBD):
# all-unix:: all-liblinks
SHLIBEXT=.so
# Alpha OSF/1 doesn't need separate PIC objects
SHOBJEXT=.o
- INIT_FINI_PREP='if test -z "$(LIBINITFUNC)"; then initfini=""; else initfini="-Wl,-init,$(LIBINITFUNC)__auxinit"; fi; if test -z "$(LIBFINIFUNC)";then :;else initfini="$$initfini -Wl,-fini,$(LIBFINIFUNC)"; fi'
+ INIT_FINI_PREP=initfini=
LDCOMBINE='$(CC) $(PTHREAD_CFLAGS) -shared -Wl,-expect_unresolved -Wl,\* -Wl,-update_registry -Wl,$(BUILDTOP)/so_locations -Wl,-soname -Wl,lib$(LIBBASE)$(SHLIBSEXT) -Wl,-hidden -Wl,-input,osf1.exports $$initfini'
SHLIB_EXPORT_FILE_DEP=osf1.exports
use_linker_init_option=yes
SHOBJEXT=.o
if test "$krb5_cv_prog_gcc" = yes; then
LDCOMBINE_TAIL=""
+ INIT_FINI_PREP="initfini="
else
use_linker_init_option=yes
use_linker_fini_option=yes
- INIT_FINI_PREP='if test -z "$(LIBINITFUNC)"; then initfini=""; else initfini="-Wl,-init,$(LIBINITFUNC)__auxinit"; fi; if test -z "$(LIBFINIFUNC)";then :;else initfini="$$initfini -Wl,-fini,$(LIBFINIFUNC)"; fi'
+ INIT_FINI_PREP='initfini=; for f in . $(LIBINITFUNC); do if test $$f = .; then :; else initfini="$$initfini -Wl,-init,$${f}__auxinit"; fi; done; for f in . $(LIBFINIFUNC); do if test $$f = .; then :; else initfini="$$initfini -Wl,-fini,$${f}"; fi; done'
LDCOMBINE_TAIL='-Wl,-exports_file -Wl,$(SHLIB_EXPORT_FILE)'
fi
LDCOMBINE='$(CC) -shared -Wl,-ignore_unresolved -Wl,-update_registry -Wl,$(BUILDTOP)/so_locations -Wl,-soname -Wl,lib$(LIBBASE)$(SHLIBSEXT) $$initfini'
LDCOMBINE='$(CC) -dy -G -z text -h lib$(LIBBASE)$(SHLIBSEXT) $$initfini'
#
INIT_FINI_PREP='if test -z "$(LIBINITFUNC)"; then initfini=; else initfini="-Wl,-z,initarray=$(LIBINITFUNC)__auxinit"; fi ; if test -z "$(LIBFINIFUNC)"; then :; else initfini="$$initfini -Wl,-z,finiarray=$(LIBFINIFUNC)" ; fi'
+ INIT_FINI_PREP='initfini=; for f in . $(LIBINITFUNC); do if test $$f = .; then :; else initfini="$$initfini -Wl,-z,initarray=$${f}__auxinit"; fi; done; for f in . $(LIBFINIFUNC); do if test $$f = .; then :; else initfini="$$initfini -Wl,-z,finiarray=$$f"; fi; done'
use_linker_init_option=yes
use_linker_fini_option=yes
fi
SHLIB_EXPFLAGS=' $(SHLIB_DIRS) $(SHLIB_EXPLIBS)'
PROFFLAGS=-pg
if test "$krb5_cv_prog_gcc" = "yes" ; then
+ wl_prefix=-Wl,
RPATH_FLAG='-Wl,-blibpath:'
LDCOMBINE='$(CC) -shared -v -o shr.o.$(LIBMAJOR).$(LIBMINOR) $$objlist -nostartfiles -Xlinker -bgcbypass:1 -Xlinker -bfilelist -Xlinker -bM:SRE -Xlinker -bE:$(SHLIB_EXPORT_FILE) -Xlinker -bernotok $(SHLIB_EXPFLAGS) -lc $$initfini'
- INIT_FINI_PREP='if test -z "$(LIBFINIFUNC)"; then initfini=""; else initfini="-Wl,-binitfini::$(LIBFINIFUNC):3"; fi'
- use_linker_fini_option=yes
else
+ wl_prefix=
RPATH_FLAG=-blibpath:
LDCOMBINE='/bin/ld -o shr.o.$(LIBMAJOR).$(LIBMINOR) $$objlist -H512 -T512 -bnoentry -bgcbypass:1 -bnodelcsect -bfilelist -bM:SRE -bE:$(SHLIB_EXPORT_FILE) -bernotok $(SHLIB_EXPFLAGS) -lc $$initfini'
- INIT_FINI_PREP='if test -z "$(LIBFINIFUNC)"; then initfini=""; else initfini="-binitfini::$(LIBFINIFUNC):3"; fi'
- use_linker_fini_option=yes
fi
+ # Assume initialization always delayed.
+ INIT_FINI_PREP="wl=${wl_prefix}; "'i=1; initfini=; for f in . $(LIBFINIFUNC); do if test $$f != .; then initfini="$$initfini $${wl}-binitfini::$$f:$$i"; else :; fi; i=`expr $$i + 1`; done'
+ use_linker_fini_option=yes
MAKE_SHLIB_COMMAND="${INIT_FINI_PREP} && ${LDCOMBINE}"' && ar cq $@ shr.o.$(LIBMAJOR).$(LIBMINOR) && chmod +x $@ && rm -f shr.o.$(LIBMAJOR).$(LIBMINOR)'
RPATH_TAIL=:/usr/lib:/lib
CC_LINK_SHARED='$(CC) $(PROG_LIBPATH) $(RPATH_FLAG)$(PROG_RPATH):'"$RPATH_TAIL"' $(CFLAGS) $(LDFLAGS)'
+2005-02-08 Ken Raeburn <raeburn@mit.edu>
+
+ * k5-platform.h (PROGRAM_EXITING) [__GNUC__ && !_WIN32 &&
+ CONSTRUCTOR_ATTR_WORKS]: Define as zero.
+
2005-01-04 Jeffrey Altman <jaltman@mit.edu>
* win-mac.h: define NEED_INSIXADDR_ANY for ipv6 symbol
: (abort(),0))
# define INITIALIZER_RAN(NAME) (JOIN__2(NAME,ran).did_run == 3 && JOIN__2(NAME, ran).error == 0)
+# define PROGRAM_EXITING() (0)
+
#elif defined(USE_LINKER_INIT_OPTION) || defined(_WIN32)
/* Run initializer at load time, via linker magic, or in the
+2005-02-08 Ken Raeburn <raeburn@mit.edu>
+
+ * Makefile.in (LIBINITFUNC, LIBFINIFUNC): Define.
+
2005-01-17 Jeffrey Altman <jaltman@mit.edu>
* gss_libinit.c: implement cleanup of mutexes, static vars, etc for Windows
LIBBASE=gssapi_krb5
LIBMAJOR=2
LIBMINOR=2
+LIBINITFUNC=gssint_lib_init
+LIBFINIFUNC=gssint_lib_fini
STOBJLISTS=OBJS.ST generic/OBJS.ST krb5/OBJS.ST
SUBDIROBJLISTS=generic/OBJS.ST krb5/OBJS.ST
SHLIB_EXPDEPS=\
+2005-02-08 Ken Raeburn <raeburn@mit.edu>
+
+ * Makefile.in (LIBINITFUNC, LIBFINIFUNC): Define.
+
2005-01-17 Jeffrey Altman <jaltman@mit.edu>
* krb5_libinit.c: implement library cleanup of mutexes, static vars, etc
LIBBASE=krb5
LIBMAJOR=3
LIBMINOR=2
+LIBINITFUNC=profile_library_initializer krb5int_lib_init
+LIBFINIFUNC=profile_library_finalizer krb5int_lib_fini
STOBJLISTS= \
OBJS.ST \
interfering with the global list of thread specific data
(used for library termination).
+2005-02-08 Ken Raeburn <raeburn@mit.edu>
+
+ * threads.c (k5_key_delete) [pthread case]: Reset flags and
+ destructor function pointer to unset state.
+ (krb5int_thread_support_init, krb5int_thread_support_fini): If
+ SHOW_INITFINI_FUNCS is defined, print some tracing messages.
+
2005-01-17 Jeffrey Altman <jaltman@mit.edu>
* threads.c: implement cleanup of static vars on library
#else /* POSIX */
- /* Not written yet -- resource leak! */
- /* abort(); */
+ {
+ int err;
+
+ /* XXX RESOURCE LEAK:
+
+ Need to destroy the allocated objects first! */
+
+ err = k5_mutex_lock(&key_lock);
+ if (err == 0) {
+ assert(destructors_set[keynum] == 1);
+ destructors_set[keynum] = 0;
+ destructors[keynum] = NULL;
+ k5_mutex_unlock(&key_lock);
+ }
+ }
#endif
{
int err;
+#ifdef SHOW_INITFINI_FUNCS
+ printf("krb5int_thread_support_init\n");
+#endif
+
#ifndef ENABLE_THREADS
/* Nothing to do for TLS initialization. */
if (! INITIALIZER_RAN (krb5int_thread_support_init))
return;
+#ifdef SHOW_INITFINI_FUNCS
+ printf("krb5int_thread_support_fini\n");
+#endif
+
#ifndef ENABLE_THREADS
/* Do nothing. */