1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-17 10:26:15 +00:00
freebsd/contrib/llvm/patches/patch-r221503-default-target-triple.diff
Dimitry Andric a1f8ad145e Add separate patch files for all the customizations we have currently
applied to our copy of llvm/clang.  These can be applied in alphabetical
order to a pristine llvm/clang 3.4 release source tree, to result in the
same version used in FreeBSD.

This is intended to clearly document all the changes until now, which
mostly consist of cherry pickings from the respective upstream trunks,
plus a number of hand-written FreeBSD-specific ones.  Hopefully those
can eventually be cleaned up and sent upstream too.

MFC after:	1 week
X-MFC-With:	r263313
2014-03-18 22:07:45 +00:00

27 lines
686 B
Diff

This patch ensures the target triple that is passed during the compiler build is
respected, instead of mangling it.
Introduced here: http://svn.freebsd.org/changeset/base/221503
Index: lib/Support/Unix/Host.inc
===================================================================
--- lib/Support/Unix/Host.inc
+++ lib/Support/Unix/Host.inc
@@ -26,6 +26,11 @@
using namespace llvm;
+#ifdef __FreeBSD__
+std::string sys::getDefaultTargetTriple() {
+ return LLVM_DEFAULT_TARGET_TRIPLE;
+}
+#else // __FreeBSD__
static std::string getOSVersion() {
struct utsname info;
@@ -61,3 +66,4 @@ std::string sys::getDefaultTargetTriple() {
return Triple;
}
+#endif // __FreeBSD__