[CFT] Fix bootstrap with in-tree ISL
diff mbox

Message ID CAC1BbcRQUA7ZN6ohWJ_cqMENr2NfaxzPcewG77Ac_pToss1oLQ@mail.gmail.com
State New
Headers show

Commit Message

Bernhard Reutner-Fischer April 1, 2015, 3:09 p.m. UTC
Hi,

Trying to build config-list.mk for current trunk.
The box is a stable debian (7.8 it seems) so the OS' ISL is too old
thus i was attempting to use in-tree ISL.

When using an in-tree ISL gcc attempts to determine if it is recent
enough and AFAIU fails to do so since the system's ISL (which we will not use)
might be too old and the in-tree ISL is not yet built.

This results in HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE being not
set and thus compilation of graphite-isl-ast-to-gimple.c fails with
"template with C linkage".

The attached seems to get me past compilation of
graphite-isl-ast-to-gimple.c with config-list.mk for e.g.
alpha-linux-gnu

I'm scheduling a proper regstrap on x86_64-linux-gnu for a native
compiler but this will take days to start i fear.
So.. if somebody has spare cycles.. :)

cheers,

config/ChangeLog:

2015-04-01  Bernhard Reutner-Fischer  <aldot@gcc.gnu.org>

        * isl.m4 (ISL_CHECK_VERSION): AC_SUBST ENABLE_ISL_CHECK.

ChangeLog:

2015-04-01  Bernhard Reutner-Fischer  <aldot@gcc.gnu.org>

        * Makefile.tpl: Set HOST_ISL_CHECK from substituted
        ENABLE_ISL_CHECK.
        (HOST_EXPORTS): Add ENABLE_ISL_CHECK.
        * Makefile.in: Regenerate.

gcc/ChangeLog:

2015-04-01  Bernhard Reutner-Fischer  <aldot@gcc.gnu.org>

        * configure.ac: Assume a current ISL when using in-tree ISL.
        * configure: Regenerate.

Comments

Tobias Grosser April 1, 2015, 3:53 p.m. UTC | #1
On 04/01/2015 05:09 PM, Bernhard Reutner-Fischer wrote:
> Hi,
>
> Trying to build config-list.mk for current trunk.
> The box is a stable debian (7.8 it seems) so the OS' ISL is too old
> thus i was attempting to use in-tree ISL.
>
> When using an in-tree ISL gcc attempts to determine if it is recent
> enough and AFAIU fails to do so since the system's ISL (which we will not use)
> might be too old and the in-tree ISL is not yet built.
>
> This results in HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE being not
> set and thus compilation of graphite-isl-ast-to-gimple.c fails with
> "template with C linkage".
>
> The attached seems to get me past compilation of
> graphite-isl-ast-to-gimple.c with config-list.mk for e.g.
> alpha-linux-gnu
>
> I'm scheduling a proper regstrap on x86_64-linux-gnu for a native
> compiler but this will take days to start i fear.
> So.. if somebody has spare cycles.. :)

Hi Bernhard,

I can not give an OK for the makefile/configure changes, but in general 
this seems to be the right direction.

Thanks,
Tobias
Bernhard Reutner-Fischer April 1, 2015, 3:55 p.m. UTC | #2
On 1 April 2015 at 17:53, Tobias Grosser <tobias@grosser.es> wrote:
> On 04/01/2015 05:09 PM, Bernhard Reutner-Fischer wrote:
>>
>> Hi,
>>
>> Trying to build config-list.mk for current trunk.
>> The box is a stable debian (7.8 it seems) so the OS' ISL is too old
>> thus i was attempting to use in-tree ISL.
>>
>> When using an in-tree ISL gcc attempts to determine if it is recent
>> enough and AFAIU fails to do so since the system's ISL (which we will not
>> use)
>> might be too old and the in-tree ISL is not yet built.
>>
>> This results in HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE being not
>> set and thus compilation of graphite-isl-ast-to-gimple.c fails with
>> "template with C linkage".
>>
>> The attached seems to get me past compilation of
>> graphite-isl-ast-to-gimple.c with config-list.mk for e.g.
>> alpha-linux-gnu
>>
>> I'm scheduling a proper regstrap on x86_64-linux-gnu for a native
>> compiler but this will take days to start i fear.
>> So.. if somebody has spare cycles.. :)
>
>
> Hi Bernhard,
>
> I can not give an OK for the makefile/configure changes, but in general this
> seems to be the right direction.

It seems that the in-tree ISL is not configured nor built upon make
all-gcc, so libbackend linking fails as it stands. Will have a closer
look..

thanks,
>
> Thanks,
> Tobias
Bernhard Reutner-Fischer May 29, 2015, 12:35 p.m. UTC | #3
On 1 April 2015 at 17:55, Bernhard Reutner-Fischer
<rep.dot.nop@gmail.com> wrote:
> On 1 April 2015 at 17:53, Tobias Grosser <tobias@grosser.es> wrote:
>> On 04/01/2015 05:09 PM, Bernhard Reutner-Fischer wrote:
>>>
>>> Hi,
>>>
>>> Trying to build config-list.mk for current trunk.
>>> The box is a stable debian (7.8 it seems) so the OS' ISL is too old
>>> thus i was attempting to use in-tree ISL.
>>>
>>> When using an in-tree ISL gcc attempts to determine if it is recent
>>> enough and AFAIU fails to do so since the system's ISL (which we will not
>>> use)
>>> might be too old and the in-tree ISL is not yet built.
>>>
>>> This results in HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE being not
>>> set and thus compilation of graphite-isl-ast-to-gimple.c fails with
>>> "template with C linkage".
>>>
>>> The attached seems to get me past compilation of
>>> graphite-isl-ast-to-gimple.c with config-list.mk for e.g.
>>> alpha-linux-gnu
>>>
>>> I'm scheduling a proper regstrap on x86_64-linux-gnu for a native
>>> compiler but this will take days to start i fear.
>>> So.. if somebody has spare cycles.. :)
>>
>>
>> Hi Bernhard,
>>
>> I can not give an OK for the makefile/configure changes, but in general this
>> seems to be the right direction.
>
> It seems that the in-tree ISL is not configured nor built upon make
> all-gcc, so libbackend linking fails as it stands. Will have a closer
> look..

The "problem" above was that isl/configure was not generated (automatically).
Is the toplevel Makefile supposed to do that or is the user
responsible for running something like autoreconfig -i in the isl/
subdir before a toplevel make in such a combined tree?

thanks,
Rainer Orth June 1, 2015, 10:08 a.m. UTC | #4
Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> writes:

> When using an in-tree ISL gcc attempts to determine if it is recent
> enough and AFAIU fails to do so since the system's ISL (which we will not use)
> might be too old and the in-tree ISL is not yet built.
>
> This results in HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE being not
> set and thus compilation of graphite-isl-ast-to-gimple.c fails with
> "template with C linkage".

This test is also extremely fragile in other ways: I just tried to
bootstrap with a self-compiled (external to the tree) isl 0.14, while
configuring with --enable-default-pie.  When configuring stage2 gcc, the
HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE test incorrectly fails since
libisl.a contains non-PIC code, so the link test fails ;-(

Again, the resulting failure ("template with C linkate") is hard to
understand.  Perhaps it's time to require isl 0.13 or 0.14 and be done
with it?

	Rainer

Patch
diff mbox

When using an in-tree ISL gcc attempts to determine if it is recent
enough and fails to do so since the system's ISL (which we will not use)
might be too old and the in-tree ISL is not yet built.

This results in HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE being not
set and thus compilation of graphite-isl-ast-to-gimple.c fails with
"template with C linkage".


config/ChangeLog:

2015-04-01  Bernhard Reutner-Fischer  <aldot@gcc.gnu.org>

	* isl.m4 (ISL_CHECK_VERSION): AC_SUBST ENABLE_ISL_CHECK.

ChangeLog:

2015-04-01  Bernhard Reutner-Fischer  <aldot@gcc.gnu.org>

	* Makefile.tpl: Set HOST_ISL_CHECK from substituted
	ENABLE_ISL_CHECK.
	(HOST_EXPORTS): Add ENABLE_ISL_CHECK.
	* Makefile.in: Regenerate.

gcc/ChangeLog:

2015-04-01  Bernhard Reutner-Fischer  <aldot@gcc.gnu.org>

	* configure.ac: Assume a current ISL when using in-tree ISL.
	* configure: Regenerate.

diff --git a/Makefile.in b/Makefile.in
index 36b4008..4ea875e 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -222,6 +222,7 @@  HOST_EXPORTS = \
 	GMPINC="$(HOST_GMPINC)"; export GMPINC; \
 	ISLLIBS="$(HOST_ISLLIBS)"; export ISLLIBS; \
 	ISLINC="$(HOST_ISLINC)"; export ISLINC; \
+	ENABLE_ISL_CHECK="$(HOST_ISL_CHECK)"; export ENABLE_ISL_CHECK; \
 	LIBELFLIBS="$(HOST_LIBELFLIBS)" ; export LIBELFLIBS; \
 	LIBELFINC="$(HOST_LIBELFINC)" ; export LIBELFINC; \
 @if gcc-bootstrap
@@ -314,6 +315,8 @@  HOST_GMPINC = @gmpinc@
 # Where to find ISL
 HOST_ISLLIBS = @isllibs@
 HOST_ISLINC = @islinc@
+# in-tree ISL has ENABLE_ISL_CHECK set to "no"
+HOST_ISL_CHECK = @ENABLE_ISL_CHECK@
 
 # Where to find libelf
 HOST_LIBELFLIBS = @libelflibs@
diff --git a/Makefile.tpl b/Makefile.tpl
index 1ea1954..5794128 100644
--- a/Makefile.tpl
+++ b/Makefile.tpl
@@ -225,6 +225,7 @@  HOST_EXPORTS = \
 	GMPINC="$(HOST_GMPINC)"; export GMPINC; \
 	ISLLIBS="$(HOST_ISLLIBS)"; export ISLLIBS; \
 	ISLINC="$(HOST_ISLINC)"; export ISLINC; \
+	ENABLE_ISL_CHECK="$(HOST_ISL_CHECK)"; export ENABLE_ISL_CHECK; \
 	LIBELFLIBS="$(HOST_LIBELFLIBS)" ; export LIBELFLIBS; \
 	LIBELFINC="$(HOST_LIBELFINC)" ; export LIBELFINC; \
 @if gcc-bootstrap
@@ -317,6 +318,8 @@  HOST_GMPINC = @gmpinc@
 # Where to find ISL
 HOST_ISLLIBS = @isllibs@
 HOST_ISLINC = @islinc@
+# in-tree ISL has ENABLE_ISL_CHECK set to "no"
+HOST_ISL_CHECK = @ENABLE_ISL_CHECK@
 
 # Where to find libelf
 HOST_LIBELFLIBS = @libelflibs@
diff --git a/config/isl.m4 b/config/isl.m4
index 459fac1..67634e0 100644
--- a/config/isl.m4
+++ b/config/isl.m4
@@ -116,6 +116,7 @@  AC_DEFUN([ISL_CHECK_VERSION],
     LDFLAGS=$_isl_saved_LDFLAGS
     LIBS=$_isl_saved_LIBS
   fi
+  AC_SUBST([ENABLE_ISL_CHECK])dnl
 ]
 )
 
diff --git a/configure b/configure
index 064e69b..0e4b0f2 100755
--- a/configure
+++ b/configure
@@ -649,6 +649,7 @@  extra_linker_plugin_flags
 extra_linker_plugin_configure_flags
 islinc
 isllibs
+ENABLE_ISL_CHECK
 poststage1_ldflags
 poststage1_libs
 stage1_ldflags
diff --git a/gcc/configure b/gcc/configure
index 20dbce6..a3ac299 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -28175,15 +28175,25 @@  fi
 
 # Check whether isl_schedule_constraints_compute_schedule is available;
 # it's new in ISL-0.13.
-if test "x${ISLLIBS}" != "x" ; then
-  saved_CFLAGS="$CFLAGS"
-  CFLAGS="$CFLAGS $ISLINC"
-  saved_LIBS="$LIBS"
-  LIBS="$LIBS $ISLLIBS $GMPLIBS"
+# When using an in-tree ISL then we assume it is recent enough
+if test x"$ENABLE_ISL_CHECK" = x"no"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Checking for isl_schedule_constraints_compute_schedule" >&5
+$as_echo_n "checking Checking for isl_schedule_constraints_compute_schedule... " >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (in-tree)" >&5
+$as_echo "yes (in-tree)" >&6; }
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking Checking for isl_schedule_constraints_compute_schedule" >&5
+$as_echo "#define HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE 1" >>confdefs.h
+
+else
+  if test "x${ISLLIBS}" != "x" ; then
+    saved_CFLAGS="$CFLAGS"
+    CFLAGS="$CFLAGS $ISLINC"
+    saved_LIBS="$LIBS"
+    LIBS="$LIBS $ISLLIBS $GMPLIBS"
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Checking for isl_schedule_constraints_compute_schedule" >&5
 $as_echo_n "checking Checking for isl_schedule_constraints_compute_schedule... " >&6; }
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <isl/schedule.h>
 int
@@ -28201,16 +28211,17 @@  else
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_has_isl_schedule_constraints_compute_schedule" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_has_isl_schedule_constraints_compute_schedule" >&5
 $as_echo "$ac_has_isl_schedule_constraints_compute_schedule" >&6; }
 
-  LIBS="$saved_LIBS"
-  CFLAGS="$saved_CFLAGS"
+    LIBS="$saved_LIBS"
+    CFLAGS="$saved_CFLAGS"
 
-  if test x"$ac_has_isl_schedule_constraints_compute_schedule" = x"yes"; then
+    if test x"$ac_has_isl_schedule_constraints_compute_schedule" = x"yes"; then
 
 $as_echo "#define HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE 1" >>confdefs.h
 
+    fi
   fi
 fi
 
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 68b0ee8..a0b06b4 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -5663,25 +5663,33 @@  fi
 
 # Check whether isl_schedule_constraints_compute_schedule is available;
 # it's new in ISL-0.13.
-if test "x${ISLLIBS}" != "x" ; then
-  saved_CFLAGS="$CFLAGS"
-  CFLAGS="$CFLAGS $ISLINC"
-  saved_LIBS="$LIBS"
-  LIBS="$LIBS $ISLLIBS $GMPLIBS"
-
-  AC_MSG_CHECKING([Checking for isl_schedule_constraints_compute_schedule])
-  AC_TRY_LINK([#include <isl/schedule.h>],
-              [isl_schedule_constraints_compute_schedule (NULL);],
-              [ac_has_isl_schedule_constraints_compute_schedule=yes],
-              [ac_has_isl_schedule_constraints_compute_schedule=no])
-  AC_MSG_RESULT($ac_has_isl_schedule_constraints_compute_schedule)
-
-  LIBS="$saved_LIBS"
-  CFLAGS="$saved_CFLAGS"
-
-  if test x"$ac_has_isl_schedule_constraints_compute_schedule" = x"yes"; then
-     AC_DEFINE(HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE, 1,
-               [Define if isl_schedule_constraints_compute_schedule exists.])
+# When using an in-tree ISL then we assume it is recent enough
+if test x"$ENABLE_ISL_CHECK" = x"no"; then
+ AC_MSG_CHECKING([Checking for isl_schedule_constraints_compute_schedule])
+ AC_MSG_RESULT([yes (in-tree)])
+ AC_DEFINE(HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE, 1,
+           [Define if isl_schedule_constraints_compute_schedule exists.])
+else
+  if test "x${ISLLIBS}" != "x" ; then
+    saved_CFLAGS="$CFLAGS"
+    CFLAGS="$CFLAGS $ISLINC"
+    saved_LIBS="$LIBS"
+    LIBS="$LIBS $ISLLIBS $GMPLIBS"
+
+    AC_MSG_CHECKING([Checking for isl_schedule_constraints_compute_schedule])
+    AC_TRY_LINK([#include <isl/schedule.h>],
+                [isl_schedule_constraints_compute_schedule (NULL);],
+                [ac_has_isl_schedule_constraints_compute_schedule=yes],
+                [ac_has_isl_schedule_constraints_compute_schedule=no])
+    AC_MSG_RESULT($ac_has_isl_schedule_constraints_compute_schedule)
+
+    LIBS="$saved_LIBS"
+    CFLAGS="$saved_CFLAGS"
+
+    if test x"$ac_has_isl_schedule_constraints_compute_schedule" = x"yes"; then
+       AC_DEFINE(HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE, 1,
+                 [Define if isl_schedule_constraints_compute_schedule exists.])
+    fi
   fi
 fi