1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

mjit.c: fix cc arguments

* mjit.c (CC_LIBS): MJIT_LIBS is used only on Windows.

* mjit.c (compile_c_to_so): moved source and shared object files
  to simplify indexes.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63272 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2018-04-27 05:20:40 +00:00
parent 6dafb4c910
commit ea631cc184

16
mjit.c
View file

@ -581,10 +581,12 @@ static const char *const CC_DLDFLAGS_ARGS[] = {
}; };
static const char *const CC_LIBS[] = { static const char *const CC_LIBS[] = {
#ifdef _WIN32
MJIT_LIBS MJIT_LIBS
#if defined __GNUC__ && !defined __clang__ && !defined _WIN32 # if defined __GNUC__ && !defined __clang__
"-lmsvcrt", "-lmsvcrt",
"-lgcc", "-lgcc",
# endif
#endif #endif
NULL NULL
}; };
@ -653,13 +655,13 @@ compile_c_to_so(const char *c_file, const char *so_file)
{ {
int exit_code; int exit_code;
const char *files[] = { const char *files[] = {
#ifdef __clang__
"-include-pch", NULL,
#endif
#ifndef _MSC_VER #ifndef _MSC_VER
"-o", "-o",
#endif #endif
NULL, NULL, NULL, NULL,
#ifdef __clang__
"-include-pch", NULL,
#endif
#ifdef _WIN32 #ifdef _WIN32
# ifdef _MSC_VER # ifdef _MSC_VER
"-link", "-link",
@ -683,10 +685,10 @@ compile_c_to_so(const char *c_file, const char *so_file)
files[1] = c_file; files[1] = c_file;
#else #else
# ifdef __clang__ # ifdef __clang__
files[1] = pch_file; files[4] = pch_file;
# endif # endif
files[numberof(files)-3] = c_file; files[2] = c_file;
files[numberof(files)-4] = so_file; files[1] = so_file;
#endif #endif
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);