niobe/prebuilts/lite/sysroot
houpengfei 396aa09915 init 2021-09-22 21:52:48 +08:00
..
build init 2021-09-22 21:52:48 +08:00
.gitignore init 2021-09-22 21:52:48 +08:00
BUILD.gn init 2021-09-22 21:52:48 +08:00
COPYRIGHT init 2021-09-22 21:52:48 +08:00
LICENSE init 2021-09-22 21:52:48 +08:00
README.md init 2021-09-22 21:52:48 +08:00
README_zh.md init 2021-09-22 21:52:48 +08:00

README.md

sysroot

Introduction

sysroot is a root directory used by the Clang compiler to search for standard libraries and header files. The libc library is generated from the open-source musl library by compilation.

Directory Structure

/prebuilts/lite/sysroot
├── build                   # Toolchain building (including build scripts)
├── usr                     # C library and header files exposed externally
│   ├── include             # Header files exposed externally
│   │  └── arm-liteos       # Chip architecture for the toolchain
│   └── lib                 # C library exposed externally
│       └── arm-liteos      # Chip architecture for the toolchain

Constraints

sysroot applies only to the OpenHarmony kernel.

Compilation and Building

When bugs in the musl library are fixed or the version is updated, you need to compile and build a new libc library by executing make in the build directory, respectively. The new libc library will be stored in the /prebuilts/lite/sysroot/usr directory.

Usage

clang -o helloworld helloworld.c -target arm-liteos --sysroot=/my_ohos_root_path/prebuilts/lite/sysroot/

The compiler directory is ~/llvm.

Repositories Involved

Kernel subsystem

prebuilts_lite_sysroot