summaryrefslogtreecommitdiff
path: root/mjit_worker.c
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-01-17 21:54:24 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-01-17 21:54:24 +0000
commitb2f102d11909e3aa18c37ff4881d0add9a975359 (patch)
treed0f9bbae31eeb34146a4ba4826f614add7db6694 /mjit_worker.c
parent0fe64561955534e9ee376e766509048d9957e67a (diff)
merge revision(s) 66811,66812,66816: [Backport #15522]
mjit_worker.c: untangle CC_LIBS nesting This should have no impact. The CC_LIBS was too hard to read for human. I don't remember whether the order of -lmsvcrt and -lgcc matters or not, but I kept that for the best safety. 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. mjit_worker.c: try passing -nostdlib to AIX r66812 might have allowed this. Testing. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_6@66849 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 a2797098d4..9860bb13e6 100644
--- a/mjit_worker.c
+++ b/mjit_worker.c
@@ -260,7 +260,7 @@ static const char *const CC_DLDFLAGS_ARGS[] = {
MJIT_DLDFLAGS
#if defined __GNUC__ && !defined __clang__
"-nostartfiles",
-# if !defined(_WIN32) && !defined(__CYGWIN__) && !defined(_AIX)
+# if !defined(_WIN32) && !defined(__CYGWIN__)
"-nodefaultlibs", "-nostdlib",
# endif
#endif
@@ -269,13 +269,13 @@ static const char *const CC_DLDFLAGS_ARGS[] = {
static const char *const CC_LIBS[] = {
#if defined(_WIN32) || defined(__CYGWIN__)
- MJIT_LIBS
-# if defined __GNUC__ && !defined __clang__
-# if defined(_WIN32)
- "-lmsvcrt",
-# endif
- "-lgcc",
+ MJIT_LIBS // mswin, mingw, cygwin
+#endif
+#if defined __GNUC__ && !defined __clang__
+# if defined(_WIN32)
+ "-lmsvcrt", // mingw
# endif
+ "-lgcc", // mingw, cygwin, and GCC platforms using `-nodefaultlibs -nostdlib`
#endif
NULL
};