From ea631cc184da08a0db7ef5ce3f6ba9df4d02c138 Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 27 Apr 2018 05:20:40 +0000 Subject: [PATCH] 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 --- mjit.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/mjit.c b/mjit.c index 9dc15e5382..1ba574f919 100644 --- a/mjit.c +++ b/mjit.c @@ -581,10 +581,12 @@ static const char *const CC_DLDFLAGS_ARGS[] = { }; static const char *const CC_LIBS[] = { +#ifdef _WIN32 MJIT_LIBS -#if defined __GNUC__ && !defined __clang__ && !defined _WIN32 +# if defined __GNUC__ && !defined __clang__ "-lmsvcrt", "-lgcc", +# endif #endif NULL }; @@ -653,13 +655,13 @@ compile_c_to_so(const char *c_file, const char *so_file) { int exit_code; const char *files[] = { -#ifdef __clang__ - "-include-pch", NULL, -#endif #ifndef _MSC_VER "-o", #endif NULL, NULL, +#ifdef __clang__ + "-include-pch", NULL, +#endif #ifdef _WIN32 # ifdef _MSC_VER "-link", @@ -683,10 +685,10 @@ compile_c_to_so(const char *c_file, const char *so_file) files[1] = c_file; #else # ifdef __clang__ - files[1] = pch_file; + files[4] = pch_file; # endif - files[numberof(files)-3] = c_file; - files[numberof(files)-4] = so_file; + files[2] = c_file; + files[1] = so_file; #endif args = form_args(5, CC_LDSHARED_ARGS, CC_CODEFLAG_ARGS, files, CC_LIBS, CC_DLDFLAGS_ARGS);