summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-09-22 00:03:52 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-09-22 00:03:52 +0000
commitda4f6b5151dd6b159c10fc4e06cb8aa9f4e03da8 (patch)
tree3586ba61e188802fe423a892d8f4a8206966e40a
parente479e9643b1cc9c9738bbd3a425240f8adc83ecc (diff)
downloadbcm5719-llvm-da4f6b5151dd6b159c10fc4e06cb8aa9f4e03da8.tar.gz
bcm5719-llvm-da4f6b5151dd6b159c10fc4e06cb8aa9f4e03da8.zip
Driver/Darwin: Add a runtime library just for ___eprintf -- when targeting i386
some projects still depend on ___eprintf being available. llvm-svn: 114509
-rw-r--r--clang/lib/Driver/ToolChains.cpp17
-rw-r--r--clang/runtime/Makefile2
2 files changed, 14 insertions, 5 deletions
diff --git a/clang/lib/Driver/ToolChains.cpp b/clang/lib/Driver/ToolChains.cpp
index 5b4c93bb5b8..79fb07519bd 100644
--- a/clang/lib/Driver/ToolChains.cpp
+++ b/clang/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.
diff --git a/clang/runtime/Makefile b/clang/runtime/Makefile
index 0e8b359123b..4307604b8a8 100644
--- a/clang/runtime/Makefile
+++ b/clang/runtime/Makefile
@@ -39,7 +39,7 @@ ifeq ($(shell test -d $(COMPILERRT_SRC_ROOT) && echo OK),OK)
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.
OpenPOWER on IntegriCloud