|
| 1 | +//// |
| 2 | +Copyright (c) 2000, 2025 Contributors to the Eclipse Foundation |
| 3 | +This program and the accompanying materials |
| 4 | +are made available under the terms of the Eclipse Public License 2.0 |
| 5 | +which accompanies this distribution, and is available at |
| 6 | +https://www.eclipse.org/legal/epl-2.0/ |
| 7 | + |
| 8 | +SPDX-License-Identifier: EPL-2.0 |
| 9 | +//// |
| 10 | + |
| 11 | +// pull in shared headers, footers, etc |
| 12 | +:docinfo: shared |
| 13 | + |
| 14 | +// support image rendering and table of contents within GitHub |
| 15 | +ifdef::env-github[] |
| 16 | +:imagesdir: ../../images |
| 17 | +:toc: |
| 18 | +:toc-placement!: |
| 19 | +endif::[] |
| 20 | + |
| 21 | +// enable support for button, menu and keyboard macros |
| 22 | +:experimental: |
| 23 | + |
| 24 | +// Until ENDOFHEADER the content must match adoc-headers.txt for consistency, |
| 25 | +// this is checked by the build in do_generate_asciidoc.sh, which also ensures |
| 26 | +// that the checked in html is up to date. |
| 27 | +// do_generate_asciidoc.sh can also be used to apply this header to all the |
| 28 | +// adoc files. |
| 29 | +// ENDOFHEADER |
| 30 | + |
| 31 | +== LLVM Specific Information |
| 32 | + |
| 33 | +=== Project types |
| 34 | + |
| 35 | +==== [#executables]#Executables# |
| 36 | + |
| 37 | +At the moment the executables built with the default settings of a LLVM |
| 38 | +with Clang project are native binaries and can be run and debugged as |
| 39 | +such. However LLVM does also support compiling programs to LLVM bitcode, |
| 40 | +which in turn can be run with lli, which is the LLVM toolchain's |
| 41 | +interpreter/JIT compiler. Unfortunately programs run with lli can not be |
| 42 | +efficiently debugged, since the only (usable) debugging information that |
| 43 | +you can get from them is the backtrace. You can, however, compile the |
| 44 | +bitcode versions of your programs, if you will (TODO: even though |
| 45 | +running them from Eclipse doesn't work at the moment). |
| 46 | + |
| 47 | +===== Compiling to LLVM bitcode instead of native binary |
| 48 | + |
| 49 | +You can compile your programs to LLVM bitcode instead of native binaries |
| 50 | +by unchecking the "Create native binary (-native)" checkbox in your |
| 51 | +project's properties in Properties → C/{cpp} Build → Settings → LLVM |
| 52 | +Linker → General LLVM options. After this Eclipse will not give the |
| 53 | +-native flag to llvm-ld, so the product of linking is just linked |
| 54 | +bitcode files (.bc) and a Bash script file with the name of the wanted |
| 55 | +executable. The Bash script will simply run the compiled LLVM bitcode |
| 56 | +file with lli. |
| 57 | + |
| 58 | +==== [#libraries]#Shared and static libraries# |
| 59 | + |
| 60 | +The shared and static libraries generated with LLVM plugin are (TODO: |
| 61 | +for now) only LLVM bitcode files linked into one file and therefore |
| 62 | +cannot be used with gcc unless compiled to object code first. These |
| 63 | +libraries can naturally be used when working with the LLVM toolchain and |
| 64 | +on the other hand llvm-ld can use libraries that are object code. |
0 commit comments