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]

PATCH: PR bootstrap/62260: Build inside source tree doesn't work with lto-plugin


Inside lto-plugin, when $host_subdir is '.', which means GCC is configured
inside source tree, gcc_build_dir is ../../$host_subdir/gcc, not
../$(host_subdir)/gcc. Tested with both in-tree and out-tree build on
Linux/x86-64.  OK for trunk?

Thanks.


H.J.
---
2014-08-25  H.J. Lu  <hongjiu.lu@intel.com>

	PR bootstrap/62260
	* Makefile.am (gcc_build_dir): Set to @gcc_build_dir@.
	* configure.ac (gcc_build_dir): Set according to $host_subdir.
	* Makefile.in: Regenerated.
	* configure: Likewise.

diff --git a/lto-plugin/Makefile.am b/lto-plugin/Makefile.am
index f3fb89b..93ea649 100644
--- a/lto-plugin/Makefile.am
+++ b/lto-plugin/Makefile.am
@@ -15,7 +15,7 @@ override CFLAGS := $(filter-out -fsanitize=address,$(CFLAGS))
 override LDFLAGS := $(filter-out -fsanitize=address,$(LDFLAGS))
 
 libexecsub_LTLIBRARIES = liblto_plugin.la
-gcc_build_dir = ../$(host_subdir)/gcc
+gcc_build_dir = @gcc_build_dir@
 in_gcc_libs = $(foreach lib, $(libexecsub_LTLIBRARIES), $(gcc_build_dir)/$(lib))
 
 liblto_plugin_la_SOURCES = lto-plugin.c
diff --git a/lto-plugin/configure.ac b/lto-plugin/configure.ac
index 6a5ae8a..c3ae93e 100644
--- a/lto-plugin/configure.ac
+++ b/lto-plugin/configure.ac
@@ -27,6 +27,13 @@ if test "x$have_static_libgcc" = xyes; then
 fi
 AC_SUBST(ac_lto_plugin_ldflags)
 
+if test x"$host_subdir" = x.; then
+   gcc_build_dir=../gcc
+else
+   gcc_build_dir=../../$host_subdir/gcc
+fi
+AC_SUBST(gcc_build_dir)
+
 AM_PROG_LIBTOOL
 ACX_LT_HOST_FLAGS
 AC_SUBST(target_noncanonical)


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