+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.
+
2005-01-24 Ken Raeburn <raeburn@mit.edu>
* post.in (Makefile): Nuke autom4te.cache before and after
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)'