This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RFA: Fix copying of libgcc multilibs


libgcc/Makefile.in includes:

---------------------------------------------------------------------------
# Dependencies for "all" are set later in the file.
all: all-multi
	# Now that we have built all the objects, we need to copy
	# them back to the GCC directory.  Too many things (other
	# in-tree libraries, and DejaGNU) know about the layout
	# of the build tree, for now.
	$(MAKE) install DESTDIR=$(gcc_objdir) \
	  slibdir= libsubdir= MULTIOSDIR=$(MULTIDIR)
---------------------------------------------------------------------------

"all-multi" therefore installs each multilib's files into
"$objdir/gcc/$mlib/...", as expected.  But the default multilib's
"install" rule is itself recursive, so "all" recurses again, this time
installing with DESTDIR="../../gcc".  For non-default multilibs, this
means installing in "$objdir/$target_alias/$mlib/libgcc/../../gcc/".
I noticed this because libjava's testsuite was finding
"$objdir/$target_alias/gcc" instead of "$objdir/gcc", and was then
trying to run "$objdir/$target_alias/gcc/xgcc --print-multi-lib".

I wasn't sure whether we should add an "install-leaf" rule,
override MULTIDIRS, override MULTIDO, or something else,
but Dan voted for the first.

Bootstrapped & regression-tested x86_64-linux-gnu.  Also regression-tested
on mips64-linux-gnu.  OK to install?

Richard


libgcc/
	* Makefile.in (all): Use install-leaf rather than install.
	(install): Split most of the rule into...
	(install-leaf): ...this new one.

Index: libgcc/Makefile.in
===================================================================
--- libgcc/Makefile.in	2007-12-20 17:18:51.000000000 +0000
+++ libgcc/Makefile.in	2007-12-20 17:20:41.000000000 +0000
@@ -99,7 +99,7 @@ all: all-multi
 	# them back to the GCC directory.  Too many things (other
 	# in-tree libraries, and DejaGNU) know about the layout
 	# of the build tree, for now.
-	$(MAKE) install DESTDIR=$(gcc_objdir) \
+	$(MAKE) install-leaf DESTDIR=$(gcc_objdir) \
 	  slibdir= libsubdir= MULTIOSDIR=$(MULTIDIR)
 
 .PHONY: all-multi
@@ -882,7 +882,7 @@ install-shared:
 		@shlib_base_name@,libgcc_s,$(subst \
 		@shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(SHLIB_INSTALL))))
 
-install: $(install-shared) $(install-libunwind)
+install-leaf: $(install-shared) $(install-libunwind)
 	$(mkinstalldirs) $(DESTDIR)$(inst_libdir)
 
 	$(INSTALL_DATA) libgcc.a $(DESTDIR)$(inst_libdir)/
@@ -898,6 +898,7 @@ install: $(install-shared) $(install-lib
 	  $(INSTALL_DATA) $$file $(DESTDIR)$(inst_libdir)/;	\
 	done
 
+install: install-leaf
 	@$(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=install
 
 .PHONY: install install-shared install-libunwind


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]