From abcb584d0eae7270b35e1b3fed1f9661e26b8be0 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Mon, 6 Nov 2017 08:29:48 -0800 Subject: Use newly built crt*.o files to build shared objects [BZ #22362] When multi-lib GCC is used to build glibc, the search order of GCC driver for crt*.o is -B*/`gcc -print-multi-directory`, the installed diretory, -B*/. This patch adds multi-lib support to csu/Makefile so that -B/glibc-build-directory/csu/ will pick up the newly built crt*.o. Tested on x86-64 for i686 and x32. [BZ #22362] * Makerules (make-link-multidir): New. * config.make.in (multidir): New. * configure.ac (libc_cv_multidir): New. AC_SUBST. * configure: Regenerated. * csu/Makefile [$(multidir) != .](multilib-extra-objs): New. [$(multidir) != .](extra-objs): Add $(multilib-extra-objs). [$(multidir) != .]($(addprefix $(objpfx)$(multidir)/, $(install-lib))): New target. --- Makerules | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'Makerules') diff --git a/Makerules b/Makerules index bbfbefe33f..522de25cfd 100644 --- a/Makerules +++ b/Makerules @@ -1079,6 +1079,11 @@ rm -f $@.new $(SHELL) $(..)scripts/rellns-sh $< $@.new mv -f $@.new $@ endef +define make-link-multidir +$(patsubst %/,cd %,$(objpfx)); \ + $(LN_S) . $(multidir) 2> /dev/null; \ + test -L $(multidir) +endef else # If we have no symbolic links don't bother with rellns-sh. define make-link @@ -1086,6 +1091,10 @@ rm -f $@.new $(LN_S) $< $@.new mv -f $@.new $@ endef +define make-link-multidir +$(make-target-directory) +ln -f $(objpfx)/$(@F) $@ +endef endif ifeq (yes,$(build-shared)) -- cgit 1.4.1