|
1 |
| -# The LLVM Compiler Infrastructure |
| 1 | +## 1. Project Introduction |
2 | 2 |
|
3 |
| -[](https://securityscorecards.dev/viewer/?uri=github.com/llvm/llvm-project) |
4 |
| -[](https://www.bestpractices.dev/projects/8273) |
5 |
| -[](https://github.com/llvm/llvm-project/actions/workflows/libcxx-build-and-test.yaml?query=event%3Aschedule) |
| 3 | +Welcome to the LLVM project in the openEuler community! This warehouse is the downstream warehouse of [llvm-project](https://github.com/llvm/llvm-project). |
6 | 4 |
|
7 |
| -Welcome to the LLVM project! |
| 5 | +This repository contains the source code for LLVM, a toolkit for the construction of highly optimized compilers, optimizers, and run-time environments. |
8 | 6 |
|
9 |
| -This repository contains the source code for LLVM, a toolkit for the |
10 |
| -construction of highly optimized compilers, optimizers, and run-time |
11 |
| -environments. |
| 7 | +The LLVM project has multiple components. The core of the project is itself called "LLVM". This contains all of the tools, libraries, and header files needed to process intermediate representations and convert them into object files. Tools include an assembler, disassembler, bitcode analyzer, and bitcode optimizer. |
12 | 8 |
|
13 |
| -The LLVM project has multiple components. The core of the project is |
14 |
| -itself called "LLVM". This contains all of the tools, libraries, and header |
15 |
| -files needed to process intermediate representations and convert them into |
16 |
| -object files. Tools include an assembler, disassembler, bitcode analyzer, and |
17 |
| -bitcode optimizer. |
| 9 | +C-like languages use the [Clang](https://clang.llvm.org/) frontend. This component compiles C, C++, Objective-C, and Objective-C++ code into LLVM bitcode -- and from there into object files, using LLVM. |
18 | 10 |
|
19 |
| -C-like languages use the [Clang](https://clang.llvm.org/) frontend. This |
20 |
| -component compiles C, C++, Objective-C, and Objective-C++ code into LLVM bitcode |
21 |
| --- and from there into object files, using LLVM. |
| 11 | +Other components include: the [libc++ C++ standard library](https://libcxx.llvm.org/), the [LLD linker](https://lld.llvm.org/), and more. |
22 | 12 |
|
23 |
| -Other components include: |
24 |
| -the [libc++ C++ standard library](https://libcxx.llvm.org), |
25 |
| -the [LLD linker](https://lld.llvm.org), and more. |
| 13 | +## 2. Construction Guide |
26 | 14 |
|
27 |
| -## Getting the Source Code and Building LLVM |
| 15 | +You can use `git` to download the source code, and then use the `build.sh` script to build the LLVM in one-click mode. There are two build modes: `build with command line` and `build with container`. |
28 | 16 |
|
29 |
| -Consult the |
30 |
| -[Getting Started with LLVM](https://llvm.org/docs/GettingStarted.html#getting-the-source-code-and-building-llvm) |
31 |
| -page for information on building and running LLVM. |
| 17 | +### 2.1. Build with command line directly |
32 | 18 |
|
33 |
| -For information on how to contribute to the LLVM project, please take a look at |
34 |
| -the [Contributing to LLVM](https://llvm.org/docs/Contributing.html) guide. |
| 19 | +You are advised to use the `openEuler` for building. If you use other operating systems, you are advised to use the containerized building mode. |
35 | 20 |
|
36 |
| -## Getting in touch |
| 21 | +Ensure that the dependency software packages are installed. You can run the following command to install the software packages: |
37 | 22 |
|
38 |
| -Join the [LLVM Discourse forums](https://discourse.llvm.org/), [Discord |
39 |
| -chat](https://discord.gg/xS7Z362), |
40 |
| -[LLVM Office Hours](https://llvm.org/docs/GettingInvolved.html#office-hours) or |
41 |
| -[Regular sync-ups](https://llvm.org/docs/GettingInvolved.html#online-sync-ups). |
| 23 | +` ` ` |
| 24 | +yum install -y gcc g++ make cmake openssl-devel python3 \ |
| 25 | +python3-setuptools python-wheel texinfo binutils-devel libatomic |
| 26 | +` ` ` |
42 | 27 |
|
43 |
| -The LLVM project has adopted a [code of conduct](https://llvm.org/docs/CodeOfConduct.html) for |
44 |
| -participants to all modes of communication within the project. |
| 28 | +You can run the `./build.sh -h` command to view the build options supported by the current project. Run the following command to perform a one-click build: |
| 29 | + |
| 30 | +` ` ` |
| 31 | +./build.sh -r -b release -X X86 -j 8 |
| 32 | +` ` ` |
| 33 | + |
| 34 | +### 2.2 Build with container |
| 35 | + |
| 36 | +The openEuler LLVM project provides a containerized building mode to solve the problems of build failures and binary differences of build products caused by development environment differences. Thanks to the [openEuler container image project](https://gitee.com/openeuler/openeuler-docker-images), the [llvm-build-deps container image](https://gitee.com/openeuler/openeuler-docker-images/tree/master/llvm-build-deps) is created in advance. Developers can enable containerized builds using the `-C` option of the `build.sh` script. For example: |
| 37 | + |
| 38 | +` ` ` |
| 39 | +./build.sh -C -r -b release -X X86 -j 8 // added -C option |
| 40 | +` ` ` |
| 41 | + |
| 42 | +Dependency: |
| 43 | +* The Docker application must be correctly installed in the development environment. |
| 44 | +* The user is added to the docker user group so that the `sudo` command is not required when the `build.sh` script executes the docker command. You can run the following command to add the current user to the docker user group: |
| 45 | + |
| 46 | +` ` ` |
| 47 | +sudo usermod -aG docker ${USER} |
| 48 | +` ` ` |
| 49 | + |
| 50 | +Note: When you perform a containerized build for the first time, the script automatically pulls the `llvm-build-deps container image` from the image repository. |
| 51 | + |
| 52 | +## 3. Contribution guidance |
| 53 | + |
| 54 | +1. Fork This Warehouse |
| 55 | +2. Create the Feat_xxx branch. |
| 56 | +3. Submit the code. |
| 57 | +4. Create a Pull Request. |
| 58 | + |
| 59 | +## 4. Discussion and help-seeking |
| 60 | + |
| 61 | +### 4.1 Upstream Community |
| 62 | +* Join the [Discourse Forum](https://discourse.llvm.org/) . |
| 63 | + |
| 64 | +* [Code of Conduct](https://llvm.org/docs/CodeOfConduct.html) for Community Participants. |
| 65 | + |
| 66 | +### 4.1. Compiler SIG of the openEuler community |
| 67 | +There are several ways: |
| 68 | +* Subscribe to the [Compiler SIG mailing list ](https://mailweb.openeuler.org/postorius/lists/[email protected]/) |
| 69 | +* Post a discussion at the [openEuler forum](https://forum.openeuler.org/?locale=zh_CN). |
| 70 | +* WeChat communication group: Please add the WeChat name `Compiler_Assistant` first. |
0 commit comments