mjit.c: link precompiled object
This is needed to resolve: "error LNK2011: precompiled object not linked in; image may not run" win32/Makefile.sub: Use the same flags as ones for precompiled header. This is needed to resolve: "error C2855: command-line option '/Z7' inconsistent with precompiled header" git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64192 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
d3e90363d3
commit
88975c821c
12
mjit.c
12
mjit.c
@ -732,7 +732,7 @@ static int
|
|||||||
compile_c_to_so(const char *c_file, const char *so_file)
|
compile_c_to_so(const char *c_file, const char *so_file)
|
||||||
{
|
{
|
||||||
int exit_code;
|
int exit_code;
|
||||||
const char *files[] = { NULL, NULL, NULL, "-link", libruby_pathflag, NULL };
|
const char *files[] = { NULL, NULL, NULL, NULL, "-link", libruby_pathflag, NULL };
|
||||||
char **args;
|
char **args;
|
||||||
char *p;
|
char *p;
|
||||||
|
|
||||||
@ -748,7 +748,13 @@ compile_c_to_so(const char *c_file, const char *so_file)
|
|||||||
p = append_str2(p, pch_file, strlen(pch_file));
|
p = append_str2(p, pch_file, strlen(pch_file));
|
||||||
*p = '\0';
|
*p = '\0';
|
||||||
|
|
||||||
files[2] = c_file;
|
/* files[2] = "C:/.../rb_mjit_header-*.obj" */
|
||||||
|
files[2] = p = (char *)alloca(sizeof(char) * (strlen(pch_file) + 1));
|
||||||
|
p = append_str2(p, pch_file, strlen(pch_file) - strlen(".pch"));
|
||||||
|
p = append_lit(p, ".obj");
|
||||||
|
*p = '\0';
|
||||||
|
|
||||||
|
files[3] = c_file;
|
||||||
args = form_args(5, CC_LDSHARED_ARGS, CC_CODEFLAG_ARGS,
|
args = form_args(5, CC_LDSHARED_ARGS, CC_CODEFLAG_ARGS,
|
||||||
files, CC_LIBS, CC_DLDFLAGS_ARGS);
|
files, CC_LIBS, CC_DLDFLAGS_ARGS);
|
||||||
if (args == NULL)
|
if (args == NULL)
|
||||||
@ -1801,7 +1807,7 @@ mjit_finish(void)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
/* Wait for pch finish */
|
/* Wait for pch finish */
|
||||||
verbose(2, "Canceling pch and worker threads");
|
verbose(2, "Canceling worker thread");
|
||||||
CRITICAL_SECTION_START(3, "in mjit_finish to wakeup from pch");
|
CRITICAL_SECTION_START(3, "in mjit_finish to wakeup from pch");
|
||||||
/* As our threads are detached, we could just cancel them. But it
|
/* As our threads are detached, we could just cancel them. But it
|
||||||
is a bad idea because OS processes (C compiler) started by
|
is a bad idea because OS processes (C compiler) started by
|
||||||
|
@ -316,9 +316,13 @@ MJIT_PRECOMPILED_HEADER = $(MJIT_HEADER_INSTALL_DIR)/$(MJIT_PRECOMPILED_HEADER_N
|
|||||||
MJIT_CC = $(CC)
|
MJIT_CC = $(CC)
|
||||||
!endif
|
!endif
|
||||||
!ifndef MJIT_OPTFLAGS
|
!ifndef MJIT_OPTFLAGS
|
||||||
MJIT_OPTFLAGS = $(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)
|
||||||
!endif
|
!endif
|
||||||
!ifndef MJIT_DEBUGFLAGS
|
!ifndef MJIT_DEBUGFLAGS
|
||||||
|
# TODO: Make this work... Another header for debug build needs to be installed first.
|
||||||
MJIT_DEBUGFLAGS = $(DEBUGFLAGS)
|
MJIT_DEBUGFLAGS = $(DEBUGFLAGS)
|
||||||
!endif
|
!endif
|
||||||
!ifndef MJIT_LDSHARED
|
!ifndef MJIT_LDSHARED
|
||||||
|
Loading…
x
Reference in New Issue
Block a user