This is the mail archive of the gcc@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: Also check configure.ac in binutils source tree


On Tue, Jul 14, 2015 at 7:06 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Tue, Jul 14, 2015 at 7:00 PM,  <pinskia@gmail.com> wrote:
>>
>>
>>
>>> On Jul 15, 2015, at 9:20 AM, Alan Modra <amodra@gmail.com> wrote:
>>>
>>>> On Tue, Jul 14, 2015 at 10:13:06AM +0100, Jan Beulich wrote:
>>>> Alan, gcc maintainers,
>>>>
>>>> I was quite surprised for my gcc 4.9.3 build (using binutils 2.25 instead
>>>> of 2.24 as I had in use with 4.9.2) to fail in rather obscure ways. Quite
>>>> a bit of digging resulted in me finding that gcc/configure.ac looks for
>>>> configure.in in a number of binutils subtrees.
>>>
>>> I haven't used combined tree builds of binutils+gcc for a very long
>>> time, so this issue wasn't on my radar at all, sorry.
>>>
>>>> Globally replacing
>>>> configure.in by configure.[ai][cn] appears to address this, but I'm not
>>>> sure whether that would be an acceptable change
>>>
>>> Certainly sounds reasonable.
>>>
>>>> (there doesn't seem
>>>> to be a fix for this in gcc trunk either, which I originally expected I could
>>>> simply backport).
>>>
>>> The configure.in->configure.ac rename happened over a year ago so I
>>> guess this shows that not too many people use combined binutils+gcc
>>> builds nowadays.  I've always found combined binutils+gcc builds not
>>> worth the bother compared to simply building and installing binutils
>>> first, as Jim suggests.
>>
>>
>> Combined builds are very useful for doing Candian crosses.  Though it might just because my build script has been doing a combined build now for 5 years.  Also I noticed it was broken and ignored it as my script did not break, only when I did a native build did it break.
>>
>
> We should fix gcc/configure.ac.
>

Here is a patch.  Tested on Linux/x86-64 with native GCC as well as
cross-toolchain.
Any comments, feedbacks, objections?

Thanks.

-- 
H.J.
---
The configure.in files in binutils source tree have been renamed to
configure.ac.  This patch checks both configure.in and configure.ac in
binutils source tree.

* configure.ac (gcc_cv_as_gas_configure): New.  Set if
configure.in or configure.ac exist.
(gcc_cv_ld_gld_configure): Likewise.
(gcc_cv_binutils_configure): Likewise.
(gcc_cv_as): Check $gcc_cv_as_gas_configure instead of
$gcc_cv_as_gas_srcdir/configure.in.
(gcc_cv_ld): Check $gcc_cv_ld_gld_configure instead of
$gcc_cv_ld_gld_srcdir/configure.in.
(gcc_cv_nm): Check $gcc_cv_binutils_configure instead of
$gcc_cv_binutils_srcdir/configure.in.
(gcc_cv_objdump): Likewise.
(gcc_cv_readelf): Likewise.
* configure: Regenerated.
From ff4cfec084398aa5603c44896c7f583bc6a01045 Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Wed, 15 Jul 2015 08:07:04 -0700
Subject: [PATCH] Also check configure.ac in binutils source tree

The configure.in files in binutils source tree have been renamed to
configure.ac.  This patch checks both configure.in and configure.ac in
binutils source tree.

	* configure.ac (gcc_cv_as_gas_configure): New.  Set if
	configure.in or configure.ac exist.
	(gcc_cv_ld_gld_configure): Likewise.
	(gcc_cv_binutils_configure): Likewise.
	(gcc_cv_as): Check $gcc_cv_as_gas_configure instead of
	$gcc_cv_as_gas_srcdir/configure.in.
	(gcc_cv_ld): Check $gcc_cv_ld_gld_configure instead of
	$gcc_cv_ld_gld_srcdir/configure.in.
	(gcc_cv_nm): Check $gcc_cv_binutils_configure instead of
	$gcc_cv_binutils_srcdir/configure.in.
	(gcc_cv_objdump): Likewise.
	(gcc_cv_readelf): Likewise.
	* configure: Regenerated.
---
 gcc/configure    | 30 ++++++++++++++++++++++++------
 gcc/configure.ac | 30 ++++++++++++++++++++++++------
 2 files changed, 48 insertions(+), 12 deletions(-)

diff --git a/gcc/configure b/gcc/configure
index e0755f9..002e6b1 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -21668,6 +21668,12 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
 gcc_cv_gas_major_version=
 gcc_cv_gas_minor_version=
 gcc_cv_as_gas_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/gas
+gcc_cv_as_gas_configure=
+if test -f $gcc_cv_as_gas_srcdir/configure.in; then
+	gcc_cv_as_gas_configure=$gcc_cv_as_gas_srcdir/configure.in;
+elif test -f $gcc_cv_as_gas_srcdir/configure.ac; then
+	gcc_cv_as_gas_configure=$gcc_cv_as_gas_srcdir/configure.ac
+fi
 
 if test "${gcc_cv_as+set}" = set; then :
 
@@ -21675,7 +21681,7 @@ else
 
 if test -x "$DEFAULT_ASSEMBLER"; then
 	gcc_cv_as="$DEFAULT_ASSEMBLER"
-elif test -f $gcc_cv_as_gas_srcdir/configure.in \
+elif test -n "$gcc_cv_as_gas_configure" \
      && test -f ../gas/Makefile \
      && test x$build = x$host; then
 	gcc_cv_as=../gas/as-new$build_exeext
@@ -21826,6 +21832,12 @@ gcc_cv_gld_minor_version=
 gcc_cv_ld_gld_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/ld
 gcc_cv_ld_gold_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/gold
 gcc_cv_ld_bfd_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/bfd
+gcc_cv_ld_gld_configure=
+if test -f $gcc_cv_ld_gld_srcdir/configure.in; then
+	gcc_cv_ld_gld_configure=gcc_cv_ld_gld_srcdir/configure.in
+elif test -f $gcc_cv_ld_gld_srcdir/configure.ac; then
+	gcc_cv_ld_gld_configure=gcc_cv_ld_gld_srcdir/configure.ac
+fi
 
 if test "${gcc_cv_ld+set}" = set; then :
 
@@ -21838,7 +21850,7 @@ elif test $install_gold_as_default = yes \
      && test -f ../gold/Makefile \
      && test x$build = x$host; then
 	gcc_cv_ld=../gold/ld-new$build_exeext
-elif test -f $gcc_cv_ld_gld_srcdir/configure.in \
+elif test -n "$gcc_cv_ld_gld_configure" \
      && test -f ../ld/Makefile \
      && test x$build = x$host; then
 	gcc_cv_ld=../ld/ld-new$build_exeext
@@ -21954,7 +21966,7 @@ $as_echo "newly built ld" >&6; }
 	elif test "$ld_is_gold" = yes; then
 	  in_tree_ld_is_elf=yes
 	fi
-	for f in $gcc_cv_ld_bfd_srcdir/configure $gcc_cv_ld_gld_srcdir/configure $gcc_cv_ld_gld_srcdir/configure.in $gcc_cv_ld_gld_srcdir/Makefile.in
+	for f in $gcc_cv_ld_bfd_srcdir/configure $gcc_cv_ld_gld_srcdir/configure $gcc_cv_ld_gld_configure $gcc_cv_ld_gld_srcdir/Makefile.in
 	do
 		gcc_cv_gld_version=`sed -n -e 's/^[ 	]*VERSION=[^0-9A-Za-z_]*\([0-9]*\.[0-9]*.*\)/VERSION=\1/p' < $f`
 		if test x$gcc_cv_gld_version != x; then
@@ -21983,11 +21995,17 @@ fi
 
 # Figure out what nm we will be using.
 gcc_cv_binutils_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/binutils
+gcc_cv_binutils_configure=
+if test -f $gcc_cv_binutils_srcdir/configure.in; then
+	gcc_cv_binutils_configure=$gcc_cv_binutils_srcdir/configure.in
+elif test -f $gcc_cv_binutils_srcdir/configure.ac; then
+	gcc_cv_binutils_configure=$gcc_cv_binutils_srcdir/configure.ac
+fi
 if test "${gcc_cv_nm+set}" = set; then :
 
 else
 
-if test -f $gcc_cv_binutils_srcdir/configure.in \
+if test -n "$gcc_cv_binutils_configure" \
      && test -f ../binutils/Makefile \
      && test x$build = x$host; then
 	gcc_cv_nm=../binutils/nm-new$build_exeext
@@ -22066,7 +22084,7 @@ if test "${gcc_cv_objdump+set}" = set; then :
 
 else
 
-if test -f $gcc_cv_binutils_srcdir/configure.in \
+if test -n "$gcc_cv_binutils_configure" \
      && test -f ../binutils/Makefile \
      && test x$build = x$host; then
 	# Single tree build which includes binutils.
@@ -22138,7 +22156,7 @@ if test "${gcc_cv_readelf+set}" = set; then :
 
 else
 
-if test -f $gcc_cv_binutils_srcdir/configure.in \
+if test -n "$gcc_cv_binutils_configure" \
      && test -f ../binutils/Makefile \
      && test x$build = x$host; then
 	# Single tree build which includes binutils.
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 7af6dbd..fa92a3d 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -2080,12 +2080,18 @@ AC_SUBST(enable_fast_install)
 gcc_cv_gas_major_version=
 gcc_cv_gas_minor_version=
 gcc_cv_as_gas_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/gas
+gcc_cv_as_gas_configure=
+if test -f $gcc_cv_as_gas_srcdir/configure.in; then
+	gcc_cv_as_gas_configure=$gcc_cv_as_gas_srcdir/configure.in;
+elif test -f $gcc_cv_as_gas_srcdir/configure.ac; then
+	gcc_cv_as_gas_configure=$gcc_cv_as_gas_srcdir/configure.ac
+fi
 
 m4_pattern_allow([AS_FOR_TARGET])dnl
 AS_VAR_SET_IF(gcc_cv_as,, [
 if test -x "$DEFAULT_ASSEMBLER"; then
 	gcc_cv_as="$DEFAULT_ASSEMBLER"
-elif test -f $gcc_cv_as_gas_srcdir/configure.in \
+elif test -n "$gcc_cv_as_gas_configure" \
      && test -f ../gas/Makefile \
      && test x$build = x$host; then
 	gcc_cv_as=../gas/as-new$build_exeext
@@ -2165,6 +2171,12 @@ gcc_cv_gld_minor_version=
 gcc_cv_ld_gld_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/ld
 gcc_cv_ld_gold_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/gold
 gcc_cv_ld_bfd_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/bfd
+gcc_cv_ld_gld_configure=
+if test -f $gcc_cv_ld_gld_srcdir/configure.in; then
+	gcc_cv_ld_gld_configure=gcc_cv_ld_gld_srcdir/configure.in
+elif test -f $gcc_cv_ld_gld_srcdir/configure.ac; then
+	gcc_cv_ld_gld_configure=gcc_cv_ld_gld_srcdir/configure.ac
+fi
 
 AS_VAR_SET_IF(gcc_cv_ld,, [
 if test -x "$DEFAULT_LINKER"; then
@@ -2174,7 +2186,7 @@ elif test $install_gold_as_default = yes \
      && test -f ../gold/Makefile \
      && test x$build = x$host; then
 	gcc_cv_ld=../gold/ld-new$build_exeext
-elif test -f $gcc_cv_ld_gld_srcdir/configure.in \
+elif test -n "$gcc_cv_ld_gld_configure" \
      && test -f ../ld/Makefile \
      && test x$build = x$host; then
 	gcc_cv_ld=../ld/ld-new$build_exeext
@@ -2238,7 +2250,7 @@ if test "$gcc_cv_ld" = ../ld/ld-new$build_exeext \
 	elif test "$ld_is_gold" = yes; then
 	  in_tree_ld_is_elf=yes
 	fi
-	for f in $gcc_cv_ld_bfd_srcdir/configure $gcc_cv_ld_gld_srcdir/configure $gcc_cv_ld_gld_srcdir/configure.in $gcc_cv_ld_gld_srcdir/Makefile.in
+	for f in $gcc_cv_ld_bfd_srcdir/configure $gcc_cv_ld_gld_srcdir/configure $gcc_cv_ld_gld_configure $gcc_cv_ld_gld_srcdir/Makefile.in
 	do
 changequote(,)dnl
 		gcc_cv_gld_version=`sed -n -e 's/^[ 	]*VERSION=[^0-9A-Za-z_]*\([0-9]*\.[0-9]*.*\)/VERSION=\1/p' < $f`
@@ -2270,8 +2282,14 @@ AC_SUBST(ORIGINAL_LD_GOLD_FOR_TARGET)
 
 # Figure out what nm we will be using.
 gcc_cv_binutils_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/binutils
+gcc_cv_binutils_configure=
+if test -f $gcc_cv_binutils_srcdir/configure.in; then
+	gcc_cv_binutils_configure=$gcc_cv_binutils_srcdir/configure.in
+elif test -f $gcc_cv_binutils_srcdir/configure.ac; then
+	gcc_cv_binutils_configure=$gcc_cv_binutils_srcdir/configure.ac
+fi
 AS_VAR_SET_IF(gcc_cv_nm,, [
-if test -f $gcc_cv_binutils_srcdir/configure.in \
+if test -n "$gcc_cv_binutils_configure" \
      && test -f ../binutils/Makefile \
      && test x$build = x$host; then
 	gcc_cv_nm=../binutils/nm-new$build_exeext
@@ -2303,7 +2321,7 @@ esac
 
 # Figure out what objdump we will be using.
 AS_VAR_SET_IF(gcc_cv_objdump,, [
-if test -f $gcc_cv_binutils_srcdir/configure.in \
+if test -n "$gcc_cv_binutils_configure" \
      && test -f ../binutils/Makefile \
      && test x$build = x$host; then
 	# Single tree build which includes binutils.
@@ -2328,7 +2346,7 @@ fi
 
 # Figure out what readelf we will be using.
 AS_VAR_SET_IF(gcc_cv_readelf,, [
-if test -f $gcc_cv_binutils_srcdir/configure.in \
+if test -n "$gcc_cv_binutils_configure" \
      && test -f ../binutils/Makefile \
      && test x$build = x$host; then
 	# Single tree build which includes binutils.
-- 
2.4.3


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