ruby-changes:54656
From: k0kubun <ko1@a...>
Date: Sat, 19 Jan 2019 18:08:15 +0900 (JST)
Subject: [ruby-changes:54656] k0kubun:r66872 (trunk): Revert "mjit_worker.c: try to simplify CC_DLDFLAGS_ARGS"
k0kubun 2019-01-19 18:08:10 +0900 (Sat, 19 Jan 2019) New Revision: 66872 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=66872 Log: Revert "mjit_worker.c: try to simplify CC_DLDFLAGS_ARGS" This reverts commit 405940234eb7876a063eb7129ca61fcc318a633c. Not working on MinGW https://ci.appveyor.com/project/ruby/ruby/builds/21737578/job/09a2tr94vof6fstt Modified files: trunk/mjit_worker.c Index: mjit_worker.c =================================================================== --- mjit_worker.c (revision 66871) +++ mjit_worker.c (revision 66872) @@ -247,10 +247,10 @@ static char *libruby_pathflag; https://github.com/ruby/ruby/blob/trunk/mjit_worker.c#L247 # define MJIT_CFLAGS_PIPE 0 #endif -// Use `-nostartfiles -nodefaultlibs -nostdlib` for GCC where possible, which does not work on mingw, cygwin, AIX, and OpenBSD. -// This seems to improve MJIT performance on GCC. TODO: Check if it works with MJIT and add it on configure. +// Use `-nodefaultlibs -nostdlib` for GCC where possible, which does not work on mingw, cygwin, AIX, and OpenBSD. +// This seems to improve MJIT performance on GCC. #if defined __GNUC__ && !defined __clang__ && !defined(_WIN32) && !defined(__CYGWIN__) && !defined(_AIX) && !defined(__OpenBSD__) -# define GCC_NOSTDLIB_FLAGS "-nostartfiles", "-nodefaultlibs", "-nostdlib", +# define GCC_NOSTDLIB_FLAGS "-nodefaultlibs", "-nostdlib", #else # define GCC_NOSTDLIB_FLAGS /* empty */ #endif @@ -264,7 +264,13 @@ static const char *const CC_DEBUG_ARGS[] https://github.com/ruby/ruby/blob/trunk/mjit_worker.c#L264 static const char *const CC_OPTIMIZE_ARGS[] = {MJIT_OPTFLAGS NULL}; static const char *const CC_LDSHARED_ARGS[] = {MJIT_LDSHARED GCC_PIC_FLAGS NULL}; -static const char *const CC_DLDFLAGS_ARGS[] = {MJIT_DLDFLAGS GCC_NOSTDLIB_FLAGS NULL}; +static const char *const CC_DLDFLAGS_ARGS[] = { + MJIT_DLDFLAGS +#if defined __GNUC__ && !defined __clang__ && !defined(__OpenBSD__) + "-nostartfiles", +#endif + GCC_NOSTDLIB_FLAGS NULL +}; static const char *const CC_LIBS[] = { #if defined(_WIN32) || defined(__CYGWIN__) @@ -274,7 +280,7 @@ static const char *const CC_LIBS[] = { https://github.com/ruby/ruby/blob/trunk/mjit_worker.c#L280 # if defined(_WIN32) "-lmsvcrt", // mingw # endif - "-lgcc", // all platforms using GCC + "-lgcc", // mingw, cygwin, and GCC platforms using `-nodefaultlibs -nostdlib` #endif NULL }; -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/