[前][次][番号順一覧][スレッド一覧]

ruby-changes:54597

From: k0kubun <ko1@a...>
Date: Mon, 14 Jan 2019 15:18:59 +0900 (JST)
Subject: [ruby-changes:54597] k0kubun:r66812 (trunk): mjit_worker.c: pass -lgcc to GCC platforms

k0kubun	2019-01-14 15:18:53 +0900 (Mon, 14 Jan 2019)

  New Revision: 66812

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=66812

  Log:
    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.

  Modified files:
    trunk/mjit_worker.c
Index: mjit_worker.c
===================================================================
--- mjit_worker.c	(revision 66811)
+++ mjit_worker.c	(revision 66812)
@@ -268,14 +268,14 @@ static const char *const CC_DLDFLAGS_ARG https://github.com/ruby/ruby/blob/trunk/mjit_worker.c#L268
 };
 
 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
 };

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]