* [PATCH] config: Add check whether D compiler works (PR103528)
@ 2021-12-16 23:12 Iain Buclaw
2021-12-18 21:30 ` Segher Boessenkool
0 siblings, 1 reply; 3+ messages in thread
From: Iain Buclaw @ 2021-12-16 23:12 UTC (permalink / raw)
To: gcc-patches; +Cc: ro, segher, iain, Iain Buclaw
Hi,
This patch extends AC_PROG_GDC so that as well as checking for the
existence of a GDC compiler, also validate that it has also been built
with libphobos, otherwise warn or fail with the message that GDC is
required to build d.
Tested on a system running powerpcle-linux both without a D compiler,
and with a D compiler configured with --disable-libphobos.
This would also help with Solaris and Darwin ports, where support for
both D and runtime isn't present across all current releases.
OK for mainline?
Regards,
Iain
---
config/ChangeLog:
PR d/103528
* acx.m4 (ACX_PROG_GDC): Add check whether D compiler works.
ChangeLog:
* configure: Regenerate.
---
config/acx.m4 | 13 +++++++++++++
configure | 19 +++++++++++++++++++
2 files changed, 32 insertions(+)
diff --git a/config/acx.m4 b/config/acx.m4
index 3c65d820628..b86c4f9e51d 100644
--- a/config/acx.m4
+++ b/config/acx.m4
@@ -425,7 +425,20 @@ AC_DEFUN([ACX_PROG_GDC],
[AC_REQUIRE([AC_CHECK_TOOL_PREFIX])
AC_REQUIRE([AC_PROG_CC])
AC_CHECK_TOOL(GDC, gdc, no)
+AC_CACHE_CHECK([whether the D compiler works],
+ acx_cv_d_compiler_works,
+[cat >conftest.d <<EOF
+module conftest; int main() { return 0; }
+EOF
+acx_cv_d_compiler_works=no
if test "x$GDC" != xno; then
+ errors=`(${GDC} $1[]m4_ifval([$1], [ ])-c conftest.d) 2>&1 || echo failure`
+ if test x"$errors" = x && test -f conftest.$ac_objext; then
+ acx_cv_d_compiler_works=yes
+ fi
+ rm -f conftest.*
+fi])
+if test "x$GDC" != xno && test x$acx_cv_d_compiler_works != xno; then
have_gdc=yes
else
have_gdc=no
diff --git a/configure b/configure
index 7f619d24ec5..869c654ea71 100755
--- a/configure
+++ b/configure
@@ -5721,7 +5721,26 @@ else
GDC="$ac_cv_prog_GDC"
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the D compiler works" >&5
+$as_echo_n "checking whether the D compiler works... " >&6; }
+if ${acx_cv_d_compiler_works+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.d <<EOF
+module conftest; int main() { return 0; }
+EOF
+acx_cv_d_compiler_works=no
if test "x$GDC" != xno; then
+ errors=`(${GDC} -c conftest.d) 2>&1 || echo failure`
+ if test x"$errors" = x && test -f conftest.$ac_objext; then
+ acx_cv_d_compiler_works=yes
+ fi
+ rm -f conftest.*
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $acx_cv_d_compiler_works" >&5
+$as_echo "$acx_cv_d_compiler_works" >&6; }
+if test "x$GDC" != xno && test x$acx_cv_d_compiler_works != xno; then
have_gdc=yes
else
have_gdc=no
--
2.32.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] config: Add check whether D compiler works (PR103528)
2021-12-16 23:12 [PATCH] config: Add check whether D compiler works (PR103528) Iain Buclaw
@ 2021-12-18 21:30 ` Segher Boessenkool
2021-12-19 20:54 ` ibuclaw
0 siblings, 1 reply; 3+ messages in thread
From: Segher Boessenkool @ 2021-12-18 21:30 UTC (permalink / raw)
To: Iain Buclaw; +Cc: gcc-patches, ro, iain
On Fri, Dec 17, 2021 at 12:12:28AM +0100, Iain Buclaw wrote:
> Hi,
>
> This patch extends AC_PROG_GDC so that as well as checking for the
> existence of a GDC compiler, also validate that it has also been built
> with libphobos, otherwise warn or fail with the message that GDC is
> required to build d.
>
> Tested on a system running powerpcle-linux both without a D compiler,
> and with a D compiler configured with --disable-libphobos.
>
> This would also help with Solaris and Darwin ports, where support for
> both D and runtime isn't present across all current releases.
>
> OK for mainline?
This fixes PR103739 by not building D at all anymore. That is also a
regression of course, but at least it doesn't break bootstrap anymore :-)
Thanks,
Segher
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] config: Add check whether D compiler works (PR103528)
2021-12-18 21:30 ` Segher Boessenkool
@ 2021-12-19 20:54 ` ibuclaw
0 siblings, 0 replies; 3+ messages in thread
From: ibuclaw @ 2021-12-19 20:54 UTC (permalink / raw)
To: Segher Boessenkool; +Cc: gcc-patches, ro, iain
> On 18/12/2021 22:30 Segher Boessenkool <segher@kernel.crashing.org> wrote:
>
>
> On Fri, Dec 17, 2021 at 12:12:28AM +0100, Iain Buclaw wrote:
> > Hi,
> >
> > This patch extends AC_PROG_GDC so that as well as checking for the
> > existence of a GDC compiler, also validate that it has also been built
> > with libphobos, otherwise warn or fail with the message that GDC is
> > required to build d.
> >
> > Tested on a system running powerpcle-linux both without a D compiler,
> > and with a D compiler configured with --disable-libphobos.
> >
> > This would also help with Solaris and Darwin ports, where support for
> > both D and runtime isn't present across all current releases.
> >
> > OK for mainline?
>
> This fixes PR103739 by not building D at all anymore. That is also a
> regression of course, but at least it doesn't break bootstrap anymore :-)
>
Well, you don't have a working D compiler installed then!
As I mentioned in your bug report, from my testing, powerpc can be bootstrapped from gcc-10 or gcc-11 without issue.
Iain.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-12-19 20:54 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-16 23:12 [PATCH] config: Add check whether D compiler works (PR103528) Iain Buclaw
2021-12-18 21:30 ` Segher Boessenkool
2021-12-19 20:54 ` ibuclaw
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).