Siva Chandra | 4380647 | 2019-10-04 17:30:54 +0000 | [diff] [blame] | 1 | LLVM libc build rules |
| 2 | ===================== |
| 3 | |
| 4 | At the cost of verbosity, we want to keep the build system of LLVM libc |
| 5 | as simple as possible. We also want to be highly modular with our build |
| 6 | targets. This makes picking and choosing desired pieces a straighforward |
| 7 | task. |
| 8 | |
| 9 | Targets for entrypoints |
| 10 | ----------------------- |
| 11 | |
| 12 | Every entrypoint in LLVM-libc has its own build target. This target is listed |
| 13 | using the ``add_entrypoint_object`` rule. This rule generates a single object |
| 14 | file containing the implementation of the entrypoint. |
| 15 | |
Siva Chandra Reddy | 9364107 | 2019-10-15 13:25:36 -0700 | [diff] [blame] | 16 | Targets for redirecting entrypoints are also listed using the |
| 17 | ``add_entrypoint_object`` rule. However, one will have to additionally specify |
| 18 | the ``REDIRECTED`` option with the rule. |
| 19 | |
Siva Chandra | 4380647 | 2019-10-04 17:30:54 +0000 | [diff] [blame] | 20 | Targets for entrypoint libraries |
| 21 | -------------------------------- |
| 22 | |
| 23 | Standards like POSIX require that a libc provide certain library files like |
| 24 | ``libc.a``, ``libm.a``, etc. The targets for such library files are listed in |
| 25 | the ``lib`` directory as ``add_entrypoint_library`` targets. An |
| 26 | ``add_entrypoint_library`` target takes a list of ``add_entrypoint_object`` |
| 27 | targets and produces a static library containing the object files corresponding |
| 28 | to the ``add_entrypoint_targets``. |
Siva Chandra Reddy | 9364107 | 2019-10-15 13:25:36 -0700 | [diff] [blame] | 29 | |
| 30 | Targets for redirectors |
| 31 | ----------------------- |
| 32 | |
| 33 | Similar to how every entrypoint in LLVM-libc has its own build target, every |
| 34 | redirector function also has its own build target. This target is listed using |
| 35 | the ``add_redirector_object`` rule. This rule generates a single object file |
| 36 | which can be packaged along with other redirector objects into shared library |
| 37 | of redirectors (see below). |
| 38 | |
| 39 | Targets for library of redirectors |
| 40 | ---------------------------------- |
| 41 | |
| 42 | Targets for shared libraries of redirectors are listed using the |
| 43 | ``add_redirector_library`` rule. |