[PATCH] D48861: Add OpenEmbedded vendor
Mandeep Singh Grang via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 2 18:26:35 PDT 2018
mgrang created this revision.
mgrang added reviewers: chandlerc, compnerd, rengolin.
Herald added a reviewer: javed.absar.
Herald added subscribers: dexonsmith, kristof.beyls.
The lib paths are not correctly picked up for OpenEmbedded sysroots (like arm-oe-linux-gnueabi). I fix this in a follow-up clang patch. But in order to add the correct libs I need to detect if the vendor is oe. For this reason, it is first necessary to teach llvm to detect oe vendor, which is what this patch does.
Repository:
rL LLVM
https://reviews.llvm.org/D48861
Files:
include/llvm/ADT/Triple.h
lib/Support/Triple.cpp
unittests/ADT/TripleTest.cpp
Index: unittests/ADT/TripleTest.cpp
===================================================================
--- unittests/ADT/TripleTest.cpp
+++ unittests/ADT/TripleTest.cpp
@@ -361,6 +361,12 @@
EXPECT_EQ(Triple::Linux, T.getOS());
EXPECT_EQ(Triple::GNUABI64, T.getEnvironment());
+ T = Triple("arm-oe-linux-gnueabi");
+ EXPECT_EQ(Triple::arm, T.getArch());
+ EXPECT_EQ(Triple::OpenEmbedded, T.getVendor());
+ EXPECT_EQ(Triple::Linux, T.getOS());
+ EXPECT_EQ(Triple::GNUEABI, T.getEnvironment());
+
T = Triple("huh");
EXPECT_EQ(Triple::UnknownArch, T.getArch());
}
Index: lib/Support/Triple.cpp
===================================================================
--- lib/Support/Triple.cpp
+++ lib/Support/Triple.cpp
@@ -168,6 +168,7 @@
case AMD: return "amd";
case Mesa: return "mesa";
case SUSE: return "suse";
+ case OpenEmbedded: return "oe";
}
llvm_unreachable("Invalid VendorType!");
@@ -463,6 +464,7 @@
.Case("amd", Triple::AMD)
.Case("mesa", Triple::Mesa)
.Case("suse", Triple::SUSE)
+ .Case("oe", Triple::OpenEmbedded)
.Default(Triple::UnknownVendor);
}
Index: include/llvm/ADT/Triple.h
===================================================================
--- include/llvm/ADT/Triple.h
+++ include/llvm/ADT/Triple.h
@@ -145,7 +145,8 @@
AMD,
Mesa,
SUSE,
- LastVendorType = SUSE
+ OpenEmbedded,
+ LastVendorType = OpenEmbedded
};
enum OSType {
UnknownOS,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D48861.153839.patch
Type: text/x-patch
Size: 1456 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180703/e46b03a6/attachment.bin>
More information about the llvm-commits
mailing list