From cc51ecffd75ed7c21040013118b1c76ee55f94e7 Mon Sep 17 00:00:00 2001 From: dim Date: Thu, 5 May 2011 16:14:13 +0000 Subject: [PATCH] Make cross-compiling using clang work better, by respecting the LLVM_HOSTTRIPLE that is defined during the cross-tools stage. Using clang, you can now build amd64 world and kernel on i386, and vice versa. Other arches still need work. --- contrib/llvm/lib/Support/Unix/Host.inc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/contrib/llvm/lib/Support/Unix/Host.inc b/contrib/llvm/lib/Support/Unix/Host.inc index 8cbec8cd7ee8..9c7523071dd4 100644 --- a/contrib/llvm/lib/Support/Unix/Host.inc +++ b/contrib/llvm/lib/Support/Unix/Host.inc @@ -35,6 +35,9 @@ static std::string getOSVersion() { } std::string sys::getHostTriple() { +#ifdef __FreeBSD__ + return LLVM_HOSTTRIPLE; +#else // FIXME: Derive directly instead of relying on the autoconf generated // variable. @@ -91,4 +94,5 @@ std::string sys::getHostTriple() { } return Triple; +#endif }