[前][次][番号順一覧][スレッド一覧]

ruby-changes:52004

From: k0kubun <ko1@a...>
Date: Wed, 8 Aug 2018 00:14:54 +0900 (JST)
Subject: [ruby-changes:52004] k0kubun:r64219 (trunk): win32/Makefile.sub: escape `=` in MJIT cflags

k0kubun	2018-08-08 00:14:48 +0900 (Wed, 08 Aug 2018)

  New Revision: 64219

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=64219

  Log:
    win32/Makefile.sub: escape `=` in MJIT cflags
    
    Since `=` is considered as delimiter in `()` of `for`, having
    `-DRUBY_DEVEL=1` in CPPFLAGS had resulted in:
    
     #define MJIT_OPTFLAGS "-DMJIT_HEADER", \
       "-DRUBY_DEVEL", \
       "1", \
    
    Even escaped `for %I in (... -DRUBY_DEVEL^=1)` does not yield an
    expected result. This commit is a workaround for this issue.
    
    After this commit, mjit_config.h will have:
    
     #define MJIT_OPTFLAGS "-DMJIT_HEADER", \
       "-DRUBY_DEVEL" MJIT_CONFIG_ESCAPED_EQ "1", \
    
    And C macro resolves MJIT_CONFIG_ESCAPED_EQ to "=".

  Modified files:
    trunk/win32/Makefile.sub
Index: win32/Makefile.sub
===================================================================
--- win32/Makefile.sub	(revision 64218)
+++ win32/Makefile.sub	(revision 64219)
@@ -316,10 +316,9 @@ MJIT_PRECOMPILED_HEADER = $(MJIT_HEADER_ https://github.com/ruby/ruby/blob/trunk/win32/Makefile.sub#L316
 MJIT_CC = $(CC)
 !endif
 !ifndef MJIT_OPTFLAGS
-# Short-term TODO: Include `$(XCFLAGS) $(CPPFLAGS)` to suppress warning. Currently adding them breakes JIT.
-# Long-term  TODO: Use only $(OPTFLAGS) for performance. It requires to modify flags for precompiled header too.
-# Using flags used for building precompiled header to make JIT succeed.
-MJIT_OPTFLAGS = -DMJIT_HEADER $(CFLAGS)
+# TODO: Use only $(OPTFLAGS) for performance. It requires to modify flags for precompiled header too.
+# For now, using flags used for building precompiled header to make JIT succeed.
+MJIT_OPTFLAGS = -DMJIT_HEADER $(CFLAGS) $(XCFLAGS) $(CPPFLAGS)
 !endif
 !ifndef MJIT_DEBUGFLAGS
 # TODO: Make this work... Another header for debug build needs to be installed first.
@@ -1332,6 +1331,7 @@ mjit_config.h: https://github.com/ruby/ruby/blob/trunk/win32/Makefile.sub#L1331
 #ifndef RUBY_MJIT_CONFIG_H
 #define RUBY_MJIT_CONFIG_H 1
 
+#define MJIT_CONFIG_ESCAPED_EQ "="
 #define MJIT_BUILD_DIR "$(MAKEDIR)"
 #define MJIT_PRECOMPILED_HEADER_NAME "/$(MJIT_HEADER_INSTALL_DIR)/$(MJIT_PRECOMPILED_HEADER_NAME)"
 <<KEEP
@@ -1345,11 +1345,11 @@ mjit_config.h: https://github.com/ruby/ruby/blob/trunk/win32/Makefile.sub#L1345
 	@echo /* MJIT_CFLAGS */>> $@
 	@
 	@(set sep=#define MJIT_OPTFLAGS ) & \
-	for %I in ($(MJIT_OPTFLAGS)) do @(call echo.%%sep%%"%%~I", \& set sep= ) >> $@
+	for %I in ($(MJIT_OPTFLAGS:^==" MJIT_CONFIG_ESCAPED_EQ ")) do @(call echo.%%sep%%"%%~I", \& set sep= ) >> $@
 	@echo /* MJIT_OPTFLAGS */>> $@
 	@
 	@(set sep=#define MJIT_DEBUGFLAGS ) & \
-	for %I in ($(MJIT_DEBUGFLAGS)) do @(call echo.%%sep%%"%%~I", \& set sep= ) >> $@
+	for %I in ($(MJIT_DEBUGFLAGS:^==" MJIT_CONFIG_ESCAPED_EQ ")) do @(call echo.%%sep%%"%%~I", \& set sep= ) >> $@
 	@echo /* MJIT_DEBUGFLAGS */>> $@
 	@
 	@(set sep=#define MJIT_LDSHARED ) & \

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]