diff mbox series

[committed] d: Build the D sources in the front-end with -fno-exceptions

Message ID 20220706185605.1509576-1-ibuclaw@gdcproject.org
State New
Headers show
Series [committed] d: Build the D sources in the front-end with -fno-exceptions | expand

Commit Message

Iain Buclaw July 6, 2022, 6:56 p.m. UTC
Hi,

The D front-end does not use exceptions, but it still requires RTTI for
some lowerings of convenience language features.  This patch enforces
that by now building GDC with `-fno-exceptions'.

Bootstrapped with gcc-9, and committed to mainline.

Regards,
Iain.

---
gcc/d/ChangeLog:

	* Make-lang.in (NOEXCEPTION_DFLAGS): Define.
	(ALL_DFLAGS): Add NO_EXCEPTION_DFLAGS.
---
 gcc/d/Make-lang.in | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/gcc/d/Make-lang.in b/gcc/d/Make-lang.in
index 9f134370218..6f9b2e5c26a 100644
--- a/gcc/d/Make-lang.in
+++ b/gcc/d/Make-lang.in
@@ -57,8 +57,12 @@  CHECKING_DFLAGS =
 endif
 WARN_DFLAGS = -Wall -Wdeprecated $(NOCOMMON_FLAG)
 
+# D front-end doesn't use exceptions, but it does require RTTI.
+NOEXCEPTION_DFLAGS = $(filter-out -fno-rtti, $(NOEXCEPTION_FLAGS))
+
 ALL_DFLAGS = $(DFLAGS-$@) $(GDCFLAGS) -fversion=IN_GCC $(CHECKING_DFLAGS) \
-	$(PICFLAG) $(ALIASING_FLAGS) $(COVERAGE_FLAGS) $(WARN_DFLAGS)
+	$(PICFLAG) $(ALIASING_FLAGS) $(NOEXCEPTION_DFLAGS) $(COVERAGE_FLAGS) \
+	$(WARN_DFLAGS)
 
 DCOMPILE.base = $(GDC) $(NO_PIE_CFLAGS) -c $(ALL_DFLAGS) -o $@
 DCOMPILE = $(DCOMPILE.base) -MT $@ -MMD -MP -MF $(@D)/$(DEPDIR)/$(*F).TPo