diff options
Diffstat (limited to 'recipes-devtools/clang/clang/0034-llvm-Add-libunwind.pc.in-and-llvm-config-scripts.patch')
-rw-r--r-- | recipes-devtools/clang/clang/0034-llvm-Add-libunwind.pc.in-and-llvm-config-scripts.patch | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/recipes-devtools/clang/clang/0034-llvm-Add-libunwind.pc.in-and-llvm-config-scripts.patch b/recipes-devtools/clang/clang/0034-llvm-Add-libunwind.pc.in-and-llvm-config-scripts.patch new file mode 100644 index 0000000..9f70bf2 --- /dev/null +++ b/recipes-devtools/clang/clang/0034-llvm-Add-libunwind.pc.in-and-llvm-config-scripts.patch | |||
@@ -0,0 +1,90 @@ | |||
1 | From 1532564c3d7c025432caefc17480cf89eed696b8 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Tue, 14 May 2024 22:04:43 -0700 | ||
4 | Subject: [PATCH] llvm: Add libunwind.pc.in and llvm-config scripts | ||
5 | |||
6 | These are added by OE project | ||
7 | |||
8 | Upstream-Status: Inappropriate [ OE-Specific ] | ||
9 | |||
10 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
11 | --- | ||
12 | libunwind/libunwind.pc.in | 9 ++++++ | ||
13 | llvm/tools/llvm-config/llvm-config | 52 ++++++++++++++++++++++++++++++ | ||
14 | 2 files changed, 61 insertions(+) | ||
15 | create mode 100644 libunwind/libunwind.pc.in | ||
16 | create mode 100644 llvm/tools/llvm-config/llvm-config | ||
17 | |||
18 | diff --git a/libunwind/libunwind.pc.in b/libunwind/libunwind.pc.in | ||
19 | new file mode 100644 | ||
20 | index 000000000000..a93d676604f9 | ||
21 | --- /dev/null | ||
22 | +++ b/libunwind/libunwind.pc.in | ||
23 | @@ -0,0 +1,9 @@ | ||
24 | +prefix=/usr | ||
25 | +exec_prefix=/usr | ||
26 | +libdir=@LIBDIR@ | ||
27 | +includedir=/usr/include | ||
28 | + | ||
29 | +Name: libunwind | ||
30 | +Description: libunwind base library | ||
31 | +Version: @VERSION@ | ||
32 | +Libs: -lunwind | ||
33 | diff --git a/llvm/tools/llvm-config/llvm-config b/llvm/tools/llvm-config/llvm-config | ||
34 | new file mode 100644 | ||
35 | index 000000000000..6a0dd54b8eab | ||
36 | --- /dev/null | ||
37 | +++ b/llvm/tools/llvm-config/llvm-config | ||
38 | @@ -0,0 +1,52 @@ | ||
39 | +#!/bin/bash | ||
40 | +# | ||
41 | +# Wrapper script for llvm-config. Supplies the right environment variables | ||
42 | +# for the target and delegates to the native llvm-config for anything else. This | ||
43 | +# is needed because arguments like --ldflags, --cxxflags, etc. are set by the | ||
44 | +# native compile rather than the target compile. | ||
45 | +# | ||
46 | +SCRIPT_DIR="$(dirname "$(readlink -f "$0")")" | ||
47 | +NEXT_LLVM_CONFIG="$(which -a llvm-config | sed -n 2p)" | ||
48 | +export YOCTO_ALTERNATE_EXE_PATH="${YOCTO_ALTERNATE_EXE_PATH:="$(readlink -f "$SCRIPT_DIR/../llvm-config")"}" | ||
49 | +if [ -n "$( echo $base_libdir | sed -n '/lib64/p')" ]; then | ||
50 | + export YOCTO_ALTERNATE_LIBDIR="${YOCTO_ALTERNATE_LIBDIR:="/lib64"}" | ||
51 | +else | ||
52 | + export YOCTO_ALTERNATE_LIBDIR="${YOCTO_ALTERNATE_LIBDIR:="/lib"}" | ||
53 | +fi | ||
54 | +if [[ $# == 0 ]]; then | ||
55 | + exec "$NEXT_LLVM_CONFIG" | ||
56 | +fi | ||
57 | + | ||
58 | +remain="" | ||
59 | +output="" | ||
60 | +for arg in "$@"; do | ||
61 | + case "$arg" in | ||
62 | + --cppflags) | ||
63 | + output="${output} ${CPPFLAGS}" | ||
64 | + ;; | ||
65 | + --cflags) | ||
66 | + output="${output} ${CFLAGS}" | ||
67 | + ;; | ||
68 | + --cxxflags) | ||
69 | + output="${output} ${CXXFLAGS}" | ||
70 | + ;; | ||
71 | + --ldflags) | ||
72 | + output="${output} ${LDFLAGS}" | ||
73 | + ;; | ||
74 | + --shared-mode) | ||
75 | + output="${output} shared" | ||
76 | + ;; | ||
77 | + --link-shared) | ||
78 | + break | ||
79 | + ;; | ||
80 | + *) | ||
81 | + remain="${remain} ${arg}" | ||
82 | + ;; | ||
83 | + esac | ||
84 | +done | ||
85 | + | ||
86 | +if [ "${remain}" != "" ]; then | ||
87 | + output="${output} "$("$NEXT_LLVM_CONFIG" ${remain}) | ||
88 | +fi | ||
89 | + | ||
90 | +echo "${output}" | ||