]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
d: Build the D sources in the front-end with -fno-exceptions
authorIain Buclaw <ibuclaw@gdcproject.org>
Fri, 1 Jul 2022 15:40:18 +0000 (17:40 +0200)
committerIain Buclaw <ibuclaw@gdcproject.org>
Wed, 6 Jul 2022 17:51:38 +0000 (19:51 +0200)
The D front-end does not use exceptions, but it still requires RTTI for
some lowerings of convenience language features.  Enforce it with by
building with `-fno-exceptions'.

gcc/d/ChangeLog:

* Make-lang.in (NOEXCEPTION_DFLAGS): Define.
(ALL_DFLAGS): Add NO_EXCEPTION_DFLAGS.

gcc/d/Make-lang.in

index 9f1343702185586d65afe1239a20e75f70a44048..6f9b2e5c26a140e2468babe48073a200ac1bd606 100644 (file)
@@ -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