public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r11-5854] c++: Fix MODULE_VERSION breakage
@ 2020-12-08 14:35 Nathan Sidwell
0 siblings, 0 replies; only message in thread
From: Nathan Sidwell @ 2020-12-08 14:35 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:0bd4fecbea3b3da9befe24906f699d63fb28ed71
commit r11-5854-g0bd4fecbea3b3da9befe24906f699d63fb28ed71
Author: Nathan Sidwell <nathan@acm.org>
Date: Tue Dec 8 06:31:31 2020 -0800
c++: Fix MODULE_VERSION breakage
Adding includes to module.cc triggered the kind of build failure I
wanted to check for. In this case it was MODULE_VERSION not being
defined, and module.cc's internal #error triggering. I've relaxed the
check in Make-lang, so we proviude MODULE_VERSION when DEVPHASE is not
empty (rather than when it is 'experimental'). AFAICT devphase is
empty for release builds, and the #error will force us to decide
whether modules is sufficiently baked at that point.
gcc/cp
* Make-lang.in (MODULE_VERSION): Override when DEVPHASE not empty.
* module.cc: Comment.
Diff:
---
gcc/cp/Make-lang.in | 3 ++-
gcc/cp/module.cc | 1 +
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in
index d7dc0dec2b8..52116652900 100644
--- a/gcc/cp/Make-lang.in
+++ b/gcc/cp/Make-lang.in
@@ -57,7 +57,8 @@ CFLAGS-cp/g++spec.o += $(DRIVER_DEFINES)
CFLAGS-cp/module.o += -DHOST_MACHINE=\"$(host)\" \
-DTARGET_MACHINE=\"$(target)\"
-ifeq ($(DEVPHASE_c),experimental)
+# In non-release builds, use a date-related module version.
+ifneq ($(DEVPHASE_c),)
# Some date's don't grok 'r', if so, simply use today's
# date (don't bootstrap at midnight).
MODULE_VERSION := $(shell date -r $(srcdir)/cp/module.cc '+%y%m%d-%H%M' \
diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc
index 24580c70907..9a5d73af20e 100644
--- a/gcc/cp/module.cc
+++ b/gcc/cp/module.cc
@@ -32,6 +32,7 @@ along with GCC; see the file COPYING3. If not see
#define MODULE_MINOR(V) ((V) % 10000)
#define EXPERIMENT(A,B) (IS_EXPERIMENTAL (MODULE_VERSION) ? (A) : (B))
#ifndef MODULE_VERSION
+// Be sure you're ready! Remove #error this before release!
#error "Shtopp! What are you doing? This is not ready yet."
#include "bversion.h"
#define MODULE_VERSION (BUILDING_GCC_MAJOR * 10000U + BUILDING_GCC_MINOR)
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-12-08 14:35 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-08 14:35 [gcc r11-5854] c++: Fix MODULE_VERSION breakage Nathan Sidwell
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).