From 29777e308c5943ffa510faec1acefddb4f256e02 Mon Sep 17 00:00:00 2001 From: k0kubun Date: Sun, 11 Feb 2018 05:29:13 +0000 Subject: [PATCH] common.mk: add comments about r62355 [ci skip] transform_mjit_header.rb: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- common.mk | 2 ++ tool/transform_mjit_header.rb | 1 + 2 files changed, 3 insertions(+) diff --git a/common.mk b/common.mk index 0449d24dd5..a65877aa9e 100644 --- a/common.mk +++ b/common.mk @@ -211,6 +211,8 @@ mjit-headers: $(TIMESTAMPDIR)/$(MJIT_HEADER:.h=)$(MJIT_HEADER_SUFFIX).time $(MJI mjit.$(OBJEXT): mjit_config.h mjit_config.h: Makefile +# Other `-Dxxx`s preceding `-DMJIT_HEADER` will be removed in transform_mjit_header.rb. +# So `-DMJIT_HEADER` should be passed first when rb_mjit_header.h is generated. $(TIMESTAMPDIR)/$(MJIT_HEADER:.h=)$(MJIT_HEADER_SUFFIX).time: probes.h vm.$(OBJEXT) $(ECHO) building $(@F:.time=.h) $(Q) $(CPP) -DMJIT_HEADER $(MJIT_HEADER_FLAGS) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(srcdir)/vm.c $(CPPOUTFLAG)$(@F:.time=.h).new diff --git a/tool/transform_mjit_header.rb b/tool/transform_mjit_header.rb index c291004e7e..a2ebba0fb2 100644 --- a/tool/transform_mjit_header.rb +++ b/tool/transform_mjit_header.rb @@ -109,6 +109,7 @@ module MJITHeader end # -dD outputs those macros, and it produces redefinition warnings or errors + # This assumes common.mk passes `-DMJIT_HEADER` first when it creates rb_mjit_header.h. def self.remove_predefined_macros!(code) code.sub!(/\A(#define [^\n]+|\n)*(#define MJIT_HEADER 1\n)/, '\2') end