diff options
author | Khem Raj <raj.khem@gmail.com> | 2017-07-27 10:40:11 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-07-31 15:13:32 +0100 |
commit | 5c77067ee9c18e056515a5e83e7282b0035dfb49 (patch) | |
tree | 50508739f29e81b23586480eab22bda43f0e936a /meta/recipes-devtools/llvm/llvm | |
parent | e7bb5ae841eabe86763f8e2fe5c92f4c7080420d (diff) | |
download | poky-5c77067ee9c18e056515a5e83e7282b0035dfb49.tar.gz |
llvm: Add recipe for 5.0
Based on recipe from meta-oe and clang recipe from meta-clang
Needed by mesa
Fixes
[YOCTO #11529]
(From OE-Core rev: 8724ef9c53e7804ead9ba0f019369b0e4daada63)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/llvm/llvm')
-rw-r--r-- | meta/recipes-devtools/llvm/llvm/0001-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch | 93 | ||||
-rw-r--r-- | meta/recipes-devtools/llvm/llvm/0002-llvm-allow-env-override-of-exe-path.patch | 39 |
2 files changed, 132 insertions, 0 deletions
diff --git a/meta/recipes-devtools/llvm/llvm/0001-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch b/meta/recipes-devtools/llvm/llvm/0001-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch new file mode 100644 index 0000000000..e251799259 --- /dev/null +++ b/meta/recipes-devtools/llvm/llvm/0001-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch | |||
@@ -0,0 +1,93 @@ | |||
1 | From 28293e48cf1a52004c6a78de448718441f9e05f9 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Sat, 21 May 2016 00:33:20 +0000 | ||
4 | Subject: [PATCH 1/2] llvm: TargetLibraryInfo: Undefine libc functions if they | ||
5 | are macros | ||
6 | |||
7 | musl defines some functions as macros and not inline functions | ||
8 | if this is the case then make sure to undefine them | ||
9 | |||
10 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
11 | --- | ||
12 | Upstream-Status: Pending | ||
13 | |||
14 | include/llvm/Analysis/TargetLibraryInfo.def | 21 +++++++++++++++++++++ | ||
15 | 1 file changed, 21 insertions(+) | ||
16 | |||
17 | diff --git a/include/llvm/Analysis/TargetLibraryInfo.def b/include/llvm/Analysis/TargetLibraryInfo.def | ||
18 | index 9cbe917c146..aff8419cf54 100644 | ||
19 | --- a/include/llvm/Analysis/TargetLibraryInfo.def | ||
20 | +++ b/include/llvm/Analysis/TargetLibraryInfo.def | ||
21 | @@ -656,6 +656,9 @@ TLI_DEFINE_STRING_INTERNAL("fmodl") | ||
22 | TLI_DEFINE_ENUM_INTERNAL(fopen) | ||
23 | TLI_DEFINE_STRING_INTERNAL("fopen") | ||
24 | /// FILE *fopen64(const char *filename, const char *opentype) | ||
25 | +#ifdef fopen64 | ||
26 | +#undef fopen64 | ||
27 | +#endif | ||
28 | TLI_DEFINE_ENUM_INTERNAL(fopen64) | ||
29 | TLI_DEFINE_STRING_INTERNAL("fopen64") | ||
30 | /// int fprintf(FILE *stream, const char *format, ...); | ||
31 | @@ -691,6 +694,9 @@ TLI_DEFINE_STRING_INTERNAL("fseek") | ||
32 | /// int fseeko(FILE *stream, off_t offset, int whence); | ||
33 | TLI_DEFINE_ENUM_INTERNAL(fseeko) | ||
34 | TLI_DEFINE_STRING_INTERNAL("fseeko") | ||
35 | +#ifdef fseeko64 | ||
36 | +#undef fseeko64 | ||
37 | +#endif | ||
38 | /// int fseeko64(FILE *stream, off64_t offset, int whence) | ||
39 | TLI_DEFINE_ENUM_INTERNAL(fseeko64) | ||
40 | TLI_DEFINE_STRING_INTERNAL("fseeko64") | ||
41 | @@ -701,6 +707,9 @@ TLI_DEFINE_STRING_INTERNAL("fsetpos") | ||
42 | TLI_DEFINE_ENUM_INTERNAL(fstat) | ||
43 | TLI_DEFINE_STRING_INTERNAL("fstat") | ||
44 | /// int fstat64(int filedes, struct stat64 *buf) | ||
45 | +#ifdef fstat64 | ||
46 | +#undef fstat64 | ||
47 | +#endif | ||
48 | TLI_DEFINE_ENUM_INTERNAL(fstat64) | ||
49 | TLI_DEFINE_STRING_INTERNAL("fstat64") | ||
50 | /// int fstatvfs(int fildes, struct statvfs *buf); | ||
51 | @@ -716,6 +725,9 @@ TLI_DEFINE_STRING_INTERNAL("ftell") | ||
52 | TLI_DEFINE_ENUM_INTERNAL(ftello) | ||
53 | TLI_DEFINE_STRING_INTERNAL("ftello") | ||
54 | /// off64_t ftello64(FILE *stream) | ||
55 | +#ifdef ftello64 | ||
56 | +#undef ftello64 | ||
57 | +#endif | ||
58 | TLI_DEFINE_ENUM_INTERNAL(ftello64) | ||
59 | TLI_DEFINE_STRING_INTERNAL("ftello64") | ||
60 | /// int ftrylockfile(FILE *file); | ||
61 | @@ -836,6 +848,9 @@ TLI_DEFINE_STRING_INTERNAL("logl") | ||
62 | TLI_DEFINE_ENUM_INTERNAL(lstat) | ||
63 | TLI_DEFINE_STRING_INTERNAL("lstat") | ||
64 | /// int lstat64(const char *path, struct stat64 *buf); | ||
65 | +#ifdef lstat64 | ||
66 | +#undef lstat64 | ||
67 | +#endif | ||
68 | TLI_DEFINE_ENUM_INTERNAL(lstat64) | ||
69 | TLI_DEFINE_STRING_INTERNAL("lstat64") | ||
70 | /// void *malloc(size_t size); | ||
71 | @@ -1055,6 +1070,9 @@ TLI_DEFINE_STRING_INTERNAL("sscanf") | ||
72 | TLI_DEFINE_ENUM_INTERNAL(stat) | ||
73 | TLI_DEFINE_STRING_INTERNAL("stat") | ||
74 | /// int stat64(const char *path, struct stat64 *buf); | ||
75 | +#ifdef stat64 | ||
76 | +#undef stat64 | ||
77 | +#endif | ||
78 | TLI_DEFINE_ENUM_INTERNAL(stat64) | ||
79 | TLI_DEFINE_STRING_INTERNAL("stat64") | ||
80 | /// int statvfs(const char *path, struct statvfs *buf); | ||
81 | @@ -1184,6 +1202,9 @@ TLI_DEFINE_STRING_INTERNAL("times") | ||
82 | TLI_DEFINE_ENUM_INTERNAL(tmpfile) | ||
83 | TLI_DEFINE_STRING_INTERNAL("tmpfile") | ||
84 | /// FILE *tmpfile64(void) | ||
85 | +#ifdef tmpfile64 | ||
86 | +#undef tmpfile64 | ||
87 | +#endif | ||
88 | TLI_DEFINE_ENUM_INTERNAL(tmpfile64) | ||
89 | TLI_DEFINE_STRING_INTERNAL("tmpfile64") | ||
90 | /// int toascii(int c); | ||
91 | -- | ||
92 | 2.13.1 | ||
93 | |||
diff --git a/meta/recipes-devtools/llvm/llvm/0002-llvm-allow-env-override-of-exe-path.patch b/meta/recipes-devtools/llvm/llvm/0002-llvm-allow-env-override-of-exe-path.patch new file mode 100644 index 0000000000..832bd729ef --- /dev/null +++ b/meta/recipes-devtools/llvm/llvm/0002-llvm-allow-env-override-of-exe-path.patch | |||
@@ -0,0 +1,39 @@ | |||
1 | From d776487bac17650704614248d19d1e6b35775001 Mon Sep 17 00:00:00 2001 | ||
2 | From: Martin Kelly <mkelly@xevo.com> | ||
3 | Date: Fri, 19 May 2017 00:22:57 -0700 | ||
4 | Subject: [PATCH 2/2] llvm: allow env override of exe path | ||
5 | |||
6 | When using a native llvm-config from inside a sysroot, we need llvm-config to | ||
7 | return the libraries, include directories, etc. from inside the sysroot rather | ||
8 | than from the native sysroot. Thus provide an env override for calling | ||
9 | llvm-config from a target sysroot. | ||
10 | |||
11 | Signed-off-by: Martin Kelly <mkelly@xevo.com> | ||
12 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
13 | --- | ||
14 | Upstream-Status: Pending | ||
15 | |||
16 | tools/llvm-config/llvm-config.cpp | 7 +++++++ | ||
17 | 1 file changed, 7 insertions(+) | ||
18 | |||
19 | diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp | ||
20 | index 08b096afb05..d8d7742744e 100644 | ||
21 | --- a/tools/llvm-config/llvm-config.cpp | ||
22 | +++ b/tools/llvm-config/llvm-config.cpp | ||
23 | @@ -225,6 +225,13 @@ Typical components:\n\ | ||
24 | |||
25 | /// \brief Compute the path to the main executable. | ||
26 | std::string GetExecutablePath(const char *Argv0) { | ||
27 | + // Hack for Yocto: we need to override the root path when we are using | ||
28 | + // llvm-config from within a target sysroot. | ||
29 | + const char *Sysroot = std::getenv("YOCTO_ALTERNATE_EXE_PATH"); | ||
30 | + if (Sysroot != nullptr) { | ||
31 | + return Sysroot; | ||
32 | + } | ||
33 | + | ||
34 | // This just needs to be some symbol in the binary; C++ doesn't | ||
35 | // allow taking the address of ::main however. | ||
36 | void *P = (void *)(intptr_t)GetExecutablePath; | ||
37 | -- | ||
38 | 2.13.1 | ||
39 | |||