1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-18 13:45:45 +02:00

Convert LLVM managed build help pages to AsciiDoc

This commit is contained in:
John Dallaway 2025-08-11 13:00:14 +01:00
parent 2a38be3704
commit 59e80dd22b
16 changed files with 218 additions and 80 deletions

View file

@ -2,4 +2,5 @@
/concepts/docinfo-footer.htm /concepts/docinfo-footer.htm
/concepts/docinfo-header.htm /concepts/docinfo-header.htm
/getting_started/ /getting_started/
/llvm/
/example/ /example/

View file

@ -26,11 +26,13 @@ bin.includes = about.html,\
helpadoc.css,\ helpadoc.css,\
font-awesome/,\ font-awesome/,\
images/,\ images/,\
llvm/,\
plugin.properties,\ plugin.properties,\
plugin.xml,\ plugin.xml,\
reference/,\ reference/,\
tasks/,\ tasks/,\
toc.xml,\ toc.xml,\
toc_LLVM.xml,\
topics_Concepts.xml,\ topics_Concepts.xml,\
topics_Getting_Started.xml,\ topics_Getting_Started.xml,\
topics_Reference.xml,\ topics_Reference.xml,\

View file

@ -14,6 +14,10 @@
file="toc.xml" file="toc.xml"
primary="true"> primary="true">
</toc> </toc>
<toc
file="toc_LLVM.xml"
primary="true">
</toc>
<index path="index"/> <index path="index"/>
</extension> </extension>

View file

@ -0,0 +1 @@
.asciidoctorconfig.adoc

View file

@ -0,0 +1,44 @@
////
Copyright (c) 2000, 2025 Contributors to the Eclipse Foundation
This program and the accompanying materials
are made available under the terms of the Eclipse Public License 2.0
which accompanies this distribution, and is available at
https://www.eclipse.org/legal/epl-2.0/
SPDX-License-Identifier: EPL-2.0
////
// pull in shared headers, footers, etc
:docinfo: shared
// support image rendering and table of contents within GitHub
ifdef::env-github[]
:imagesdir: ../../images
:toc:
:toc-placement!:
endif::[]
// enable support for button, menu and keyboard macros
:experimental:
// Until ENDOFHEADER the content must match adoc-headers.txt for consistency,
// this is checked by the build in do_generate_asciidoc.sh, which also ensures
// that the checked in html is up to date.
// do_generate_asciidoc.sh can also be used to apply this header to all the
// adoc files.
// ENDOFHEADER
== General information
LLVM with Clang/GCC for Eclipse CDT plug-in provides LLVM toolchain with
Clang or llvm-gcc compiler to compile C/(cpp} programs.
http://www.llvm.org[LLVM] is a rather modern toolchain that supports the
compilation of C/(cpp} code (among others) to LLVM virtual machine's
_bitcode_, which in turn can be compiled to each platform's native
binary.
The plug-in includes the following tools from the LLVM toolchain:
Clang/Clang{plus}{plus}/llvm-gcc/llvm-g{plus}{plus} (C/(cpp} compilers), llvm-ld (linker),
llvm-ar (archiver), llvm-as (assembler), llc (static compiler) and lli
(JIT/Interpreter).

View file

@ -0,0 +1,53 @@
////
Copyright (c) 2000, 2025 Contributors to the Eclipse Foundation
This program and the accompanying materials
are made available under the terms of the Eclipse Public License 2.0
which accompanies this distribution, and is available at
https://www.eclipse.org/legal/epl-2.0/
SPDX-License-Identifier: EPL-2.0
////
// pull in shared headers, footers, etc
:docinfo: shared
// support image rendering and table of contents within GitHub
ifdef::env-github[]
:imagesdir: ../../images
:toc:
:toc-placement!:
endif::[]
// enable support for button, menu and keyboard macros
:experimental:
// Until ENDOFHEADER the content must match adoc-headers.txt for consistency,
// this is checked by the build in do_generate_asciidoc.sh, which also ensures
// that the checked in html is up to date.
// do_generate_asciidoc.sh can also be used to apply this header to all the
// adoc files.
// ENDOFHEADER
== Initial configuration
When you launch an Eclipse workspace with LLVM plug-in for the first
time, you may need to set paths to LLVM binaries, headers and libraries.
This is done in Eclipse by navigating to Window -> Preferences -> LLVM.
Set LLVM installation folder to point where your LLVM binaries are,
include directory to point where your Clang includes are and library
path to the directory where your LLVM libraries reside.
If your paths in Preferences and LLVM are correctly set and the plug-in
is able to find your LLVM binaries, you should have the option to use
"LLVM with Clang (Linux/MacOSX/Windows)" toolchain and "LLVM with GCC
(Linux/MacOSX/Windows) toolchain". The toolchains are available in
project types of 'executable', 'static library' and 'dynamic library' in
both C and {cpp}.
An alternative way is to set the LLVM binary path to PATH system
environment variable.
You may also have to include the path to
Standard {cpp} Library in order to compile {cpp} programs by adding the
path in LLVM Preferences or appending it to LD_LIBRARY_PATH system
environment variable.

View file

@ -0,0 +1,64 @@
////
Copyright (c) 2000, 2025 Contributors to the Eclipse Foundation
This program and the accompanying materials
are made available under the terms of the Eclipse Public License 2.0
which accompanies this distribution, and is available at
https://www.eclipse.org/legal/epl-2.0/
SPDX-License-Identifier: EPL-2.0
////
// pull in shared headers, footers, etc
:docinfo: shared
// support image rendering and table of contents within GitHub
ifdef::env-github[]
:imagesdir: ../../images
:toc:
:toc-placement!:
endif::[]
// enable support for button, menu and keyboard macros
:experimental:
// Until ENDOFHEADER the content must match adoc-headers.txt for consistency,
// this is checked by the build in do_generate_asciidoc.sh, which also ensures
// that the checked in html is up to date.
// do_generate_asciidoc.sh can also be used to apply this header to all the
// adoc files.
// ENDOFHEADER
== LLVM Specific Information
=== Project types
==== [#executables]#Executables#
At the moment the executables built with the default settings of a LLVM
with Clang project are native binaries and can be run and debugged as
such. However LLVM does also support compiling programs to LLVM bitcode,
which in turn can be run with lli, which is the LLVM toolchain's
interpreter/JIT compiler. Unfortunately programs run with lli can not be
efficiently debugged, since the only (usable) debugging information that
you can get from them is the backtrace. You can, however, compile the
bitcode versions of your programs, if you will (TODO: even though
running them from Eclipse doesn't work at the moment).
===== Compiling to LLVM bitcode instead of native binary
You can compile your programs to LLVM bitcode instead of native binaries
by unchecking the "Create native binary (-native)" checkbox in your
project's properties in Properties → C/{cpp} Build → Settings → LLVM
Linker → General LLVM options. After this Eclipse will not give the
-native flag to llvm-ld, so the product of linking is just linked
bitcode files (.bc) and a Bash script file with the name of the wanted
executable. The Bash script will simply run the compiled LLVM bitcode
file with lli.
==== [#libraries]#Shared and static libraries#
The shared and static libraries generated with LLVM plugin are (TODO:
for now) only LLVM bitcode files linked into one file and therefore
cannot be used with gcc unless compiled to object code first. These
libraries can naturally be used when working with the LLVM toolchain and
on the other hand llvm-ld can use libraries that are object code.

View file

@ -0,0 +1,39 @@
////
Copyright (c) 2000, 2025 Contributors to the Eclipse Foundation
This program and the accompanying materials
are made available under the terms of the Eclipse Public License 2.0
which accompanies this distribution, and is available at
https://www.eclipse.org/legal/epl-2.0/
SPDX-License-Identifier: EPL-2.0
////
// pull in shared headers, footers, etc
:docinfo: shared
// support image rendering and table of contents within GitHub
ifdef::env-github[]
:imagesdir: ../../images
:toc:
:toc-placement!:
endif::[]
// enable support for button, menu and keyboard macros
:experimental:
// Until ENDOFHEADER the content must match adoc-headers.txt for consistency,
// this is checked by the build in do_generate_asciidoc.sh, which also ensures
// that the checked in html is up to date.
// do_generate_asciidoc.sh can also be used to apply this header to all the
// adoc files.
// ENDOFHEADER
== LLVM with Clang/GCC for Eclipse CDT
This guide is intended for the users of the LLVM with Clang/GCC for
Eclipse CDT plugin. It describes the initial configuration, general
information and some special cases about the plugin.
* xref:general.adoc[General information]
* xref:initial_configuration.adoc[Initial configuration]
* xref:llvm_specific.adoc[LLVM specific information and options]

View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<toc label="LLVM plug-in for Eclipse CDT">
<topic label="User manual" href="llvm/user_manual.htm">
<topic label="General information about the plugin" href="llvm/general.htm"/>
<topic label="Initial configuration" href="llvm/initial_configuration.htm"/>
<topic label="LLVM specific information and options" href="llvm/llvm_specific.htm">
</topic>
</topic>
</toc>

View file

@ -8,8 +8,6 @@ bin.includes = plugin.xml,\
about.ini,\ about.ini,\
about.mappings,\ about.mappings,\
about.properties,\ about.properties,\
cdt_logo_icon32.png,\ cdt_logo_icon32.png
help/
src.includes = patches/,\ src.includes = patches/,\
help/,\
about.html about.html

View file

@ -1,13 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>General information</title>
</head>
<body>
<h2>General information</h2>
<p>LLVM with Clang/GCC for Eclipse CDT plug-in provides LLVM toolchain with Clang or llvm-gcc compiler to compile C/C++ programs.</p>
<p><a href="http://www.llvm.org">LLVM</a> is a rather modern toolchain that supports the compilation of C/C++ code (among others) to LLVM virtual machine's <i>bitcode</i>, which in turn can be compiled to each platform's native binary.</p>
<p>The plug-in includes the following tools from the LLVM toolchain: Clang/Clang++/llvm-gcc/llvm-g++ (C/C++ compilers), llvm-ld (linker), llvm-ar (archiver), llvm-as (assembler), llc (static compiler) and lli (JIT/Interpreter).
</body>
</html>

View file

@ -1,14 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Initial configuration</title>
</head>
<body>
<h2>Initial configuration</h2>
<p>When you launch an Eclipse workspace with LLVM plug-in for the first time, you may need to set paths to LLVM binaries, headers and libraries. This is done in Eclipse by navigating to Window -> Preferences -> LLVM. Set LLVM installation folder to point where your LLVM binaries are, include directory to point where your Clang includes are and library path to the directory where your LLVM libraries reside.</p>
<p>If your paths in Preferences and LLVM are correctly set and the plug-in is able to find your LLVM binaries, you should have the option to use "LLVM with Clang (Linux/MacOSX/Windows)" toolchain and "LLVM with GCC (Linux/MacOSX/Windows) toolchain". The toolchains are available in project types of 'executable', 'static library' and 'dynamic library' in both C and C++.</p>
<p>An alternative way is to set the LLVM binary path to PATH system environment variable.</p>
<p>You may also have to <a href="../help/adding_c++_standard_library.html">include the path to Standard C++ Library</a> in order to compile C++ programs by adding the path in LLVM Preferences or appending it to LD_LIBRARY_PATH system environment variable.</p>
</body>
</html>

View file

@ -1,17 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>LLVM Specific Information</title>
</head>
<body>
<h1>LLVM Specific Information</h1>
<h2>Project types</h2>
<h3><a name="executables">Executables</a></h3>
<p>At the moment the executables built with the default settings of a LLVM with Clang project are native binaries and can be run and debugged as such. However LLVM does also support compiling programs to LLVM bitcode, which in turn can be run with lli, which is the LLVM toolchain's interpreter/JIT compiler. Unfortunately programs run with lli can not be efficiently debugged, since the only (usable) debugging information that you can get from them is the backtrace. You can, however, compile the bitcode versions of your programs, if you will (TODO: even though running them from Eclipse doesn't work at the moment).</p>
<h4>Compiling to LLVM bitcode instead of native binary</h4>
<p>You can compile your programs to LLVM bitcode instead of native binaries by unchecking the "Create native binary (-native)" checkbox in your project's properties in Properties &rarr; C/C++ Build &rarr; Settings &rarr; LLVM Linker &rarr; General LLVM options. After this Eclipse will not give the -native flag to llvm-ld, so the product of linking is just linked bitcode files (.bc) and a Bash script file with the name of the wanted executable. The Bash script will simply run the compiled LLVM bitcode file with lli.</p>
<h3><a name="libraries">Shared and static libraries</a></h3>
<p>The shared and static libraries generated with LLVM plugin are (TODO: for now) only LLVM bitcode files linked into one file and therefore cannot be used with gcc unless compiled to object code first. These libraries can naturally be used when working with the LLVM toolchain and on the other hand llvm-ld can use libraries that are object code.</p>
</body>
</html>

View file

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<toc label="LLVM plug-in for Eclipse CDT">
<topic label="User manual" href="help/user_manual.html">
<topic label="General information about the plugin" href="help/general.html"/>
<topic label="Initial configuration" href="help/initial_configuration.html"/>
<topic label="LLVM specific information and options" href="help/llvm_specific.html">
</topic>
</topic>
</toc>

View file

@ -1,17 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>User manual - LLVM with Clang/GCC for Eclipse CDT</title>
</head>
<body>
<h1>LLVM with Clang/GCC for Eclipse CDT</h1>
<p>This guide is intended for the users of the LLVM with Clang/GCC for Eclipse CDT plugin. It describes the initial configuration, general information and some special cases about the plugin.</p>
<ul>
<li><a href="general.html">General information</a></li>
<li><a href="initial_configuration.html">Initial configuration</a></li>
<li><a href="llvm_specific.html">LLVM specific information and options</a></li>
<li><a href="adding_c++_standard_library.html">Adding C++ Standard Library</a></li>
</ul>
</body>
</html>

View file

@ -5483,13 +5483,6 @@ Contributors:
</toolChain> </toolChain>
</template> </template>
</extension> </extension>
<extension
point="org.eclipse.help.toc">
<toc
file="help/toc.xml"
primary="true">
</toc>
</extension>
<extension <extension
id="llvmNature" id="llvmNature"
name="%extension.name.2" name="%extension.name.2"