diff options
author | Daniel Dunbar <daniel@zuster.org> | 2010-09-22 00:03:52 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2010-09-22 00:03:52 +0000 |
commit | 885b1dbc6e48db318f7a6b72c1592e8fb46b081a (patch) | |
tree | a6efbbb2c5ff4a2a18be6549d9c4b2fddc0068f4 /lib/Driver/ToolChains.cpp | |
parent | 4f209445c06a43283c6f72dda7c925538b1578e9 (diff) |
Driver/Darwin: Add a runtime library just for ___eprintf -- when targeting i386
some projects still depend on ___eprintf being available.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114509 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/ToolChains.cpp')
-rw-r--r-- | lib/Driver/ToolChains.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp index 5b4c93bb5b..79fb07519b 100644 --- a/lib/Driver/ToolChains.cpp +++ b/lib/Driver/ToolChains.cpp @@ -501,11 +501,20 @@ void DarwinClang::AddLinkRuntimeLibArgs(const ArgList &Args, 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. |