diff options
Diffstat (limited to 'meta/recipes-devtools/llvm/llvm')
4 files changed, 91 insertions, 99 deletions
diff --git a/meta/recipes-devtools/llvm/llvm/0001-AsmMatcherEmitter-sort-ClassInfo-lists-by-name-as-we.patch b/meta/recipes-devtools/llvm/llvm/0001-AsmMatcherEmitter-sort-ClassInfo-lists-by-name-as-we.patch new file mode 100644 index 0000000000..a5c53b6657 --- /dev/null +++ b/meta/recipes-devtools/llvm/llvm/0001-AsmMatcherEmitter-sort-ClassInfo-lists-by-name-as-we.patch @@ -0,0 +1,31 @@ +From 3b30a9bda88374e8f03bf96e972aee5bd214b98b Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin <alex.kanavin@gmail.com> +Date: Fri, 27 Nov 2020 10:11:08 +0000 +Subject: [PATCH] AsmMatcherEmitter: sort ClassInfo lists by name as well + +Otherwise, there are instances which are identical in +every other field and therefore sort non-reproducibly +(which breaks binary and source reproducibiliy). + +Upstream-Status: Submitted [https://reviews.llvm.org/D97477] +Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> +--- + llvm/utils/TableGen/AsmMatcherEmitter.cpp | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/llvm/utils/TableGen/AsmMatcherEmitter.cpp b/llvm/utils/TableGen/AsmMatcherEmitter.cpp +index 73724e662f9e..1ca9c73415db 100644 +--- a/llvm/utils/TableGen/AsmMatcherEmitter.cpp ++++ b/llvm/utils/TableGen/AsmMatcherEmitter.cpp +@@ -361,7 +361,10 @@ public: + // name of a class shouldn't be significant. However, some of the backends + // accidentally rely on this behaviour, so it will have to stay like this + // until they are fixed. +- return ValueName < RHS.ValueName; ++ if (ValueName != RHS.ValueName) ++ return ValueName < RHS.ValueName; ++ // All else being equal, we should sort by name, for source and binary reproducibility ++ return Name < RHS.Name; + } + }; + diff --git a/meta/recipes-devtools/llvm/llvm/0006-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch b/meta/recipes-devtools/llvm/llvm/0006-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch deleted file mode 100644 index d02b7ba6ab..0000000000 --- a/meta/recipes-devtools/llvm/llvm/0006-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch +++ /dev/null @@ -1,90 +0,0 @@ -Upstream-Status: Pending -Signed-off-by: Khem Raj <raj.khem@gmail.com> - -From dbeecdb307be8b783b42cbc89dcb9c5e7f528989 Mon Sep 17 00:00:00 2001 -From: Khem Raj <raj.khem@gmail.com> -Date: Sat, 21 May 2016 00:33:20 +0000 -Subject: [PATCH] llvm: TargetLibraryInfo: Undefine libc functions if they are macros - -musl defines some functions as macros and not inline functions -if this is the case then make sure to undefine them - -Signed-off-by: Khem Raj <raj.khem@gmail.com> ---- - .../llvm/Analysis/TargetLibraryInfo.def | 21 +++++++++++++++++++ - 1 file changed, 21 insertions(+) - -diff --git a/llvm/include/llvm/Analysis/TargetLibraryInfo.def b/llvm/include/llvm/Analysis/TargetLibraryInfo.def -index afed404f04c..876888656f2 100644 ---- a/llvm/include/llvm/Analysis/TargetLibraryInfo.def -+++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.def -@@ -782,6 +782,9 @@ TLI_DEFINE_STRING_INTERNAL("fmodl") - TLI_DEFINE_ENUM_INTERNAL(fopen) - TLI_DEFINE_STRING_INTERNAL("fopen") - /// FILE *fopen64(const char *filename, const char *opentype) -+#ifdef fopen64 -+#undef fopen64 -+#endif - TLI_DEFINE_ENUM_INTERNAL(fopen64) - TLI_DEFINE_STRING_INTERNAL("fopen64") - /// int fork(); -@@ -829,6 +832,9 @@ TLI_DEFINE_STRING_INTERNAL("fseek") - /// int fseeko(FILE *stream, off_t offset, int whence); - TLI_DEFINE_ENUM_INTERNAL(fseeko) - TLI_DEFINE_STRING_INTERNAL("fseeko") -+#ifdef fseeko64 -+#undef fseeko64 -+#endif - /// int fseeko64(FILE *stream, off64_t offset, int whence) - TLI_DEFINE_ENUM_INTERNAL(fseeko64) - TLI_DEFINE_STRING_INTERNAL("fseeko64") -@@ -839,6 +845,9 @@ TLI_DEFINE_STRING_INTERNAL("fsetpos") - TLI_DEFINE_ENUM_INTERNAL(fstat) - TLI_DEFINE_STRING_INTERNAL("fstat") - /// int fstat64(int filedes, struct stat64 *buf) -+#ifdef fstat64 -+#undef fstat64 -+#endif - TLI_DEFINE_ENUM_INTERNAL(fstat64) - TLI_DEFINE_STRING_INTERNAL("fstat64") - /// int fstatvfs(int fildes, struct statvfs *buf); -@@ -854,6 +863,9 @@ TLI_DEFINE_STRING_INTERNAL("ftell") - TLI_DEFINE_ENUM_INTERNAL(ftello) - TLI_DEFINE_STRING_INTERNAL("ftello") - /// off64_t ftello64(FILE *stream) -+#ifdef ftello64 -+#undef ftello64 -+#endif - TLI_DEFINE_ENUM_INTERNAL(ftello64) - TLI_DEFINE_STRING_INTERNAL("ftello64") - /// int ftrylockfile(FILE *file); -@@ -980,6 +992,9 @@ TLI_DEFINE_STRING_INTERNAL("logl") - TLI_DEFINE_ENUM_INTERNAL(lstat) - TLI_DEFINE_STRING_INTERNAL("lstat") - /// int lstat64(const char *path, struct stat64 *buf); -+#ifdef lstat64 -+#undef lstat64 -+#endif - TLI_DEFINE_ENUM_INTERNAL(lstat64) - TLI_DEFINE_STRING_INTERNAL("lstat64") - /// void *malloc(size_t size); -@@ -1205,6 +1220,9 @@ TLI_DEFINE_STRING_INTERNAL("sscanf") - TLI_DEFINE_ENUM_INTERNAL(stat) - TLI_DEFINE_STRING_INTERNAL("stat") - /// int stat64(const char *path, struct stat64 *buf); -+#ifdef stat64 -+#undef stat64 -+#endif - TLI_DEFINE_ENUM_INTERNAL(stat64) - TLI_DEFINE_STRING_INTERNAL("stat64") - /// int statvfs(const char *path, struct statvfs *buf); -@@ -1340,6 +1358,9 @@ TLI_DEFINE_STRING_INTERNAL("times") - TLI_DEFINE_ENUM_INTERNAL(tmpfile) - TLI_DEFINE_STRING_INTERNAL("tmpfile") - /// FILE *tmpfile64(void) -+#ifdef tmpfile64 -+#undef tmpfile64 -+#endif - TLI_DEFINE_ENUM_INTERNAL(tmpfile64) - TLI_DEFINE_STRING_INTERNAL("tmpfile64") - /// int toascii(int c); diff --git a/meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch b/meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch index b01b8647c9..add38b3bb4 100644 --- a/meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch +++ b/meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch @@ -1,27 +1,26 @@ -Upstream-Status: Pending -Signed-off-by: Khem Raj <raj.khem@gmail.com> - -From 61b00e1e051e367f5483d7b5253b6c85a9e8a90f Mon Sep 17 00:00:00 2001 +From 588a8694c6540e31140c7e242bfb5e279d6ca08c Mon Sep 17 00:00:00 2001 From: Martin Kelly <mkelly@xevo.com> Date: Fri, 19 May 2017 00:22:57 -0700 -Subject: [PATCH] llvm: allow env override of exe path +Subject: [PATCH] llvm: allow env override of exe and libdir path When using a native llvm-config from inside a sysroot, we need llvm-config to return the libraries, include directories, etc. from inside the sysroot rather than from the native sysroot. Thus provide an env override for calling llvm-config from a target sysroot. +Upstream-Status: Inappropriate [OE-specific] + Signed-off-by: Martin Kelly <mkelly@xevo.com> Signed-off-by: Khem Raj <raj.khem@gmail.com> --- - llvm/tools/llvm-config/llvm-config.cpp | 7 +++++++ - 1 file changed, 7 insertions(+) + llvm/tools/llvm-config/llvm-config.cpp | 25 +++++++++++++++++++------ + 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/llvm/tools/llvm-config/llvm-config.cpp b/llvm/tools/llvm-config/llvm-config.cpp -index 7ef7c46a262..a4f7ed82c7b 100644 +index e86eb2b44b10..7b2abf318dbe 100644 --- a/llvm/tools/llvm-config/llvm-config.cpp +++ b/llvm/tools/llvm-config/llvm-config.cpp -@@ -225,6 +225,13 @@ Typical components:\n\ +@@ -246,6 +246,13 @@ Typical components:\n\ /// Compute the path to the main executable. std::string GetExecutablePath(const char *Argv0) { @@ -35,3 +34,4 @@ index 7ef7c46a262..a4f7ed82c7b 100644 // This just needs to be some symbol in the binary; C++ doesn't // allow taking the address of ::main however. void *P = (void *)(intptr_t)GetExecutablePath; + diff --git a/meta/recipes-devtools/llvm/llvm/llvm-config b/meta/recipes-devtools/llvm/llvm/llvm-config new file mode 100644 index 0000000000..5e4ded2da5 --- /dev/null +++ b/meta/recipes-devtools/llvm/llvm/llvm-config @@ -0,0 +1,51 @@ +#!/bin/bash +# +# Copyright OpenEmbedded Contributors +# +# SPDX-License-Identifier: MIT +# +# Wrap llvm-config since the native llvm-config will remap some values correctly +# if placed in the target sysroot but for flags, it would provide the native ones. +# Provide ours from the environment instead. + +NEXT_LLVM_CONFIG="$(which -a llvm-config | sed -n 2p)" +if [[ $# == 0 ]]; then + exec "$NEXT_LLVM_CONFIG" +fi + +remain="" +output="" +for arg in "$@"; do + case "$arg" in + --cppflags) + output="${output} ${CPPFLAGS}" + ;; + --cflags) + output="${output} ${CFLAGS}" + ;; + --cxxflags) + output="${output} ${CXXFLAGS}" + ;; + --ldflags) + output="${output} ${LDFLAGS}" + ;; + --shared-mode) + output="${output} shared" + ;; + --libs) + output="${output} -lLLVM" + ;; + --link-shared) + break + ;; + *) + remain="${remain} ${arg}" + ;; + esac +done + +if [ "${remain}" != "" ]; then + output="${output} "$("$NEXT_LLVM_CONFIG" ${remain}) +fi + +echo "${output}" |