Lines Matching +full:libunwind +full:- +full:build

1 .. llvm-libgcc:
4 llvm-libgcc
10 **Note that these instructions assume a Linux and bash-friendly environment.
11 YMMV if you’re on a non Linux-based platform.**
18 Enabling libunwind as a replacement for libgcc on Linux has proven to be
23 _Unwind_Backtrace][1]. Since libgcc_{eh.a,s.so} and libunwind have the same ABI,
24 but different implementations, the two libraries end up [cross-talking, which
27 To solve this problem, libunwind needs libgcc "front" that is, link the
28 necessary functions from compiler-rt and libunwind into an archive and shared
31 in memory. Fortunately for us, compiler-rt and libunwind use the same ABI as the
32 libgcc family, so the problem is solvable at the llvm-project configuration
34 distro manager to configure their LLVM build with a flag that indicates they
35 want to archive compiler-rt/unwind as libgcc. We achieve this by compiling
36 libunwind with all the symbols necessary for compiler-rt to emulate the libgcc
38 corresponding libunwind counterparts.
47 compiler-rt/libunwind can point to these libraries at the config stage instead.
49 binaries that are built using libgcc will still end up having cross-talk between
57 llvm-libgcc is not for the casual LLVM user. It is intended to be used by distro
58 managers who want to replace libgcc with compiler-rt and libunwind, but cannot
61 llvm-libgcc.
72 Since llvm-libgcc is such a fundamental, low-level component, we have made it
73 difficult to accidentally build, by requiring you to set an opt-in flag.
75 .. _Building llvm-libgcc
77 Building llvm-libgcc
78 --------------------
80 The first build tree is a mostly conventional build tree and gets you a Clang
81 build with these compiler-rt symbols exposed.
83 .. code-block:: bash
84 # Assumes $(PWD) is /path/to/llvm-project
85 $ cmake -GNinja -S llvm -B build-primary \
86 -DCMAKE_BUILD_TYPE=Release \
87 -DCMAKE_CROSSCOMPILING=On \
88 -DCMAKE_INSTALL_PREFIX=/tmp/aarch64-unknown-linux-gnu \
89 -DLLVM_ENABLE_PROJECTS='clang' \
90 -DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;llvm-libgcc" \
91 -DLLVM_TARGETS_TO_BUILD=AArch64 \
92 -DLLVM_DEFAULT_TARGET_TRIPLE=aarch64-unknown-linux-gnu \
93 -DLLVM_LIBGCC_EXPLICIT_OPT_IN=Yes
94 $ ninja -C build-primary install
96 It's very important to notice that neither ``compiler-rt``, nor ``libunwind``,
97 are listed in ``LLVM_ENABLE_RUNTIMES``. llvm-libgcc makes these subprojects, and
99 targets. As such, configuring the runtimes build will reject explicitly mentioning
100 either project with ``llvm-libgcc``.
102 To avoid issues when building with ``-DLLVM_ENABLE_RUNTIMES=all``, ``llvm-libgcc``
107 This gets you a copy of libunwind with the libgcc symbols. You can verify this
110 .. code-block:: bash
112 $ llvm-readelf -W --dyn-syms "${LLVM_LIBGCC_SYSROOT}/lib/libunwind.so" | grep FUNC | grep GCC_3.0
125 llvm-libgcc currently supports the following target triples:
127 * ``aarch64-*-*-*``
128 * ``armv7a-*-*-gnueabihf``
129 * ``i386-*-*-*``
130 * ``x86_64-*-*-*``
132 If you would like to support another triple (e.g. ``powerpc64-*-*-*``), you'll
138 -------------------------------
141 exist in the set (``clang-builtins.a`` ∪ ``libunwind.a``) ∩ ``libgcc_s.so.1``.
144 llvm-libgcc).
149 .. code-block:: bash
151 /path/to/llvm-project
153 $ llvm/tools/llvm-libgcc/generate_version_script.py \
154 --compiler_rt=/path/to/libclang_rt.builtins-${ARCH}.a \
155 --libunwind=/path/to/libunwind.a \
156 --libgcc_s=/path/to/libgcc_s.so.1 \
157 --output=${ARCH}
160 ``/path/to/llvm-project/llvm/tools/llvm-libgcc/gcc_s-${ARCH}.ver``, which we use
166 -------------------------
183 * ``ARM_GNUEABIHF``, which targets exactly ``arm-*-*-gnueabihf``.
186 * ``GLOBAL_32BIT``, which is be used to target 32-bit platforms.
187 * ``GLOBAL_64BIT``, which is be used to target 64-bit platforms.