This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: PR bootstrap/62260: Build inside source tree doesn't work with lto-plugin
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 26 Aug 2014 10:48:09 +0200
- Subject: Re: PATCH: PR bootstrap/62260: Build inside source tree doesn't work with lto-plugin
- Authentication-results: sourceware.org; auth=none
- References: <20140825215440 dot GA9567 at intel dot com>
On Mon, Aug 25, 2014 at 11:54 PM, H.J. Lu <hongjiu.lu@intel.com> wrote:
> 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?
Ok.
I wonder if it is finally time to hard-error on build-in-source-tree ...
Thanks,
Richard.
> 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)