summaryrefslogtreecommitdiff
path: root/mjit_worker.c
diff options
context:
space:
mode:
authork0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-01-14 06:18:53 +0000
committerk0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-01-14 06:18:53 +0000
commitd14089fb3cef922a0c3a61661fd1c92bd083e991 (patch)
tree9faebb8682adee2734306acfac0dc9004e64e21d /mjit_worker.c
parentd89d1d468779ccea52d9b8da4f9d967543d28723 (diff)
mjit_worker.c: pass -lgcc to GCC platforms
using `-nodefaultlibs -nostdlib`. I assume libgcc is needed when we use -nostdlib, and it's linked on some platforms but not linked on some platforms (like aarch64, and possibly AIX as well) as said in https://wiki.osdev.org/Libgcc : > You can link with libgcc by passing -lgcc when linking your kernel with your compiler. You don't need to do this unless you pass the -nodefaultlibs option (implied by -nostdlib) Also note that -nostdlib is not strictly needed (rather implied -nodefaultlibs is problematic for Gentoo like Bug#15513, which will be approached later) but helpful for performance. So I want to keep it for now. [Bug #15522] I'm not trying to add `-nodefaultlibs -nostdlib` for AIX in this commit because AIX RubyCI is dead right now, but I'll try to add them again once RubyCI is fixed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66812 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'mjit_worker.c')
-rw-r--r--mjit_worker.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/mjit_worker.c b/mjit_worker.c
index b69fe1e..e56b454 100644
--- a/mjit_worker.c
+++ b/mjit_worker.c
@@ -268,14 +268,14 @@ static const char *const CC_DLDFLAGS_ARGS[] = {
};
static const char *const CC_LIBS[] = {
-#if defined(_WIN32) || defined(__CYGWIN__) // mswin, mingw, cygwin
- MJIT_LIBS
+#if defined(_WIN32) || defined(__CYGWIN__)
+ MJIT_LIBS // mswin, mingw, cygwin
#endif
-#if defined(_WIN32) && defined __GNUC__ && !defined __clang__ // mingw
- "-lmsvcrt",
-#endif
-#if (defined(_WIN32) || defined(__CYGWIN__)) && defined __GNUC__ && !defined __clang__ // mingw, cygwin
- "-lgcc",
+#if defined __GNUC__ && !defined __clang__
+# if defined(_WIN32)
+ "-lmsvcrt", // mingw
+# endif
+ "-lgcc", // mingw, cygwin, and GCC platforms using `-nodefaultlibs -nostdlib`
#endif
NULL
};