ruby-changes:52791
From: k0kubun <ko1@a...>
Date: Fri, 12 Oct 2018 01:28:08 +0900 (JST)
Subject: [ruby-changes:52791] k0kubun:r65003 (trunk): win32/Makefile.sub: generate MJIT header pdb
k0kubun 2018-10-12 01:28:04 +0900 (Fri, 12 Oct 2018) New Revision: 65003 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=65003 Log: win32/Makefile.sub: generate MJIT header pdb in the MJIT-header-specific path, not default path like vc140.pdb. mjit_worker.c: specify the MJIT-header-specific pdb path. tool/rbinstall.rb: install MJIT header pdb as well. Modified files: trunk/mjit_worker.c trunk/tool/rbinstall.rb trunk/win32/Makefile.sub Index: win32/Makefile.sub =================================================================== --- win32/Makefile.sub (revision 65002) +++ win32/Makefile.sub (revision 65003) @@ -1275,9 +1275,11 @@ clean-local:: https://github.com/ruby/ruby/blob/trunk/win32/Makefile.sub#L1275 $(Q)$(RM) $(MJIT_PRECOMPILED_HEADER_NAME) $(MJIT_PRECOMPILED_HEADER_NAME:.pch=.)$(OBJEXT) $(Q)$(RM) $(TIMESTAMPDIR)/$(MJIT_PRECOMPILED_HEADER_NAME:.pch=.time) mjit_config.h $(Q)$(RM) $(MJIT_HEADER_INSTALL_DIR)/rb_mjit_header-*.pch + $(Q)$(RM) $(MJIT_HEADER_INSTALL_DIR)/rb_mjit_header-*.pdb $(Q)$(RM) $(MJIT_HEADER_INSTALL_DIR)/rb_mjit_header-*.$(OBJEXT) -$(Q) $(RMDIRS) $(MJIT_HEADER_INSTALL_DIR) 2> $(NULL) || exit 0 $(Q)$(RM) $(arch_hdrdir)/rb_mjit_header-*.pch + $(Q)$(RM) $(arch_hdrdir)/rb_mjit_header-*.pdb $(Q)$(RM) $(arch_hdrdir)/rb_mjit_header-*.$(OBJEXT) # Non-mswin environment is not using prebuilt precompiled header because upgrading compiler @@ -1292,7 +1294,7 @@ clean-local:: https://github.com/ruby/ruby/blob/trunk/win32/Makefile.sub#L1294 $(TIMESTAMPDIR)/$(MJIT_PRECOMPILED_HEADER_NAME:.pch=).time: probes.h vm.$(OBJEXT) $(ECHO) building $(@F:.time=.pch) $(Q) $(CC) -DMJIT_HEADER $(CFLAGS) $(XCFLAGS:-DRUBY_EXPORT =) -URUBY_EXPORT $(CPPFLAGS) $(srcdir)/vm.c -c -Yc \ - $(COUTFLAG)$(@F:.time=.)$(OBJEXT) -Fp$(@F:.time=.pch).new + $(COUTFLAG)$(@F:.time=.)$(OBJEXT) -Fd$(@F:.time=.pdb) -Fp$(@F:.time=.pch).new $(Q) $(IFCHANGE) "--timestamp=$@" $(@F:.time=.pch) $(@F:.time=.pch).new $(MJIT_PRECOMPILED_HEADER_NAME): $(TIMESTAMPDIR)/$(MJIT_PRECOMPILED_HEADER_NAME:.pch=).time @@ -1301,9 +1303,11 @@ $(MJIT_PRECOMPILED_HEADER): $(MJIT_PRECO https://github.com/ruby/ruby/blob/trunk/win32/Makefile.sub#L1303 $(Q) $(MAKEDIRS) $(MJIT_HEADER_INSTALL_DIR) $(Q) $(MAKE_LINK) $(MJIT_PRECOMPILED_HEADER_NAME) $@ $(Q) $(MAKE_LINK) $(MJIT_PRECOMPILED_HEADER_NAME:.pch=.)$(OBJEXT) $(MJIT_HEADER_INSTALL_DIR)/$(MJIT_PRECOMPILED_HEADER_NAME:.pch=.)$(OBJEXT) + $(Q) $(MAKE_LINK) $(MJIT_PRECOMPILED_HEADER_NAME:.pch=.pdb) $(MJIT_HEADER_INSTALL_DIR)/$(MJIT_PRECOMPILED_HEADER_NAME:.pch=.pdb) $(Q) $(MAKEDIRS) $(arch_hdrdir) $(Q) $(MAKE_LINK) $(MJIT_PRECOMPILED_HEADER_NAME) $(arch_hdrdir)/$(MJIT_PRECOMPILED_HEADER_NAME) $(Q) $(MAKE_LINK) $(MJIT_PRECOMPILED_HEADER_NAME:.pch=.)$(OBJEXT) $(arch_hdrdir)/$(MJIT_PRECOMPILED_HEADER_NAME:.pch=.)$(OBJEXT) + $(Q) $(MAKE_LINK) $(MJIT_PRECOMPILED_HEADER_NAME:.pch=.pdb) $(arch_hdrdir)/$(MJIT_PRECOMPILED_HEADER_NAME:.pch=.pdb) INSNS = opt_sc.inc optinsn.inc optunifs.inc insns.inc insns_info.inc \ vmtc.inc vm.inc mjit_compile.inc Index: mjit_worker.c =================================================================== --- mjit_worker.c (revision 65002) +++ mjit_worker.c (revision 65003) @@ -692,7 +692,7 @@ static int https://github.com/ruby/ruby/blob/trunk/mjit_worker.c#L692 compile_c_to_so(const char *c_file, const char *so_file) { int exit_code; - const char *files[] = { NULL, NULL, NULL, NULL, NULL, "-link", libruby_pathflag, NULL }; + const char *files[] = { NULL, NULL, NULL, NULL, NULL, NULL, "-link", libruby_pathflag, NULL }; char **args; char *p, *obj_file; @@ -728,6 +728,13 @@ compile_c_to_so(const char *c_file, cons https://github.com/ruby/ruby/blob/trunk/mjit_worker.c#L728 p = append_str2(p, c_file, strlen(c_file)); *p = '\0'; + /* files[5] = "-Fd*.pdb" */ + files[5] = p = alloca(sizeof(char) * (rb_strlen_lit("-Fd") + strlen(pch_file) + 1)); + p = append_lit(p, "-Fd"); + p = append_str2(p, pch_file, strlen(pch_file) - rb_strlen_lit(".pch")); + p = append_lit(p, ".pdb"); + *p = '\0'; + args = form_args(5, CC_LDSHARED_ARGS, CC_CODEFLAG_ARGS, files, CC_LIBS, CC_DLDFLAGS_ARGS); if (args == NULL) Index: tool/rbinstall.rb =================================================================== --- tool/rbinstall.rb (revision 65002) +++ tool/rbinstall.rb (revision 65003) @@ -406,6 +406,7 @@ install?(:ext, :arch, :hdr, :'arch-hdr', https://github.com/ruby/ruby/blob/trunk/tool/rbinstall.rb#L406 install_recursive("#{$extout}/include/#{CONFIG['arch']}", archhdrdir, :glob => "*.h", :mode => $data_mode) install_recursive("#{$extout}/include/#{CONFIG['arch']}", archhdrdir, :glob => "rb_mjit_header-*.obj", :mode => $data_mode) install_recursive("#{$extout}/include/#{CONFIG['arch']}", archhdrdir, :glob => "rb_mjit_header-*.pch", :mode => $data_mode) + install_recursive("#{$extout}/include/#{CONFIG['arch']}", archhdrdir, :glob => "rb_mjit_header-*.pdb", :mode => $data_mode) end install?(:ext, :comm, :'ext-comm') do prepare "extension scripts", rubylibdir -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/