[cfe-commits] r114509 - in /cfe/trunk: lib/Driver/ToolChains.cpp runtime/Makefile

Daniel Dunbar daniel at zuster.org
Tue Sep 21 17:03:52 PDT 2010


Author: ddunbar
Date: Tue Sep 21 19:03:52 2010
New Revision: 114509

URL: http://llvm.org/viewvc/llvm-project?rev=114509&view=rev
Log:
Driver/Darwin: Add a runtime library just for ___eprintf -- when targeting i386
some projects still depend on ___eprintf being available.

Modified:
    cfe/trunk/lib/Driver/ToolChains.cpp
    cfe/trunk/runtime/Makefile

Modified: cfe/trunk/lib/Driver/ToolChains.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.cpp?rev=114509&r1=114508&r2=114509&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains.cpp Tue Sep 21 19:03:52 2010
@@ -501,11 +501,20 @@
     else if (isMacosxVersionLT(10, 6))
       CmdArgs.push_back("-lgcc_s.10.5");
 
-    // For OS X, we only need a static runtime library when targetting 10.4, to
-    // provide versions of the static functions which were omitted from
-    // 10.4.dylib.
-    if (isMacosxVersionLT(10, 5))
+    // For OS X, we thought we would only need a static runtime library when
+    // targetting 10.4, to provide versions of the static functions which were
+    // omitted from 10.4.dylib.
+    //
+    // Unfortunately, that turned out to not be true, because Darwin system
+    // headers can still use eprintf on i386, and it is not exported from
+    // libSystem. Therefore, we still must provide a runtime library just for
+    // the tiny tiny handful of projects that *might* use that symbol.
+    if (isMacosxVersionLT(10, 5)) {
       DarwinStaticLib = "libclang_rt.10.4.a";
+    } else {
+      if (getTriple().getArch() == llvm::Triple::x86)
+        DarwinStaticLib = "libclang_rt.eprintf.a";
+    }
   }
 
   /// Add the target specific static library, if needed.

Modified: cfe/trunk/runtime/Makefile
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/runtime/Makefile?rev=114509&r1=114508&r2=114509&view=diff
==============================================================================
--- cfe/trunk/runtime/Makefile (original)
+++ cfe/trunk/runtime/Makefile Tue Sep 21 19:03:52 2010
@@ -39,7 +39,7 @@
 RuntimeDirs :=
 ifeq ($(OS),Darwin)
 RuntimeDirs += darwin
-RuntimeLibrary.darwin.Configs = 10.4 armv6 cc_kext
+RuntimeLibrary.darwin.Configs = eprintf 10.4 armv6 cc_kext
 endif
 
 # Rule to build the compiler-rt libraries we need.





More information about the cfe-commits mailing list