[libc-commits] [PATCH] D137090: [libc] Add example programs and their CMake build and instructions.

Jeff Bailey via Phabricator via libc-commits libc-commits at lists.llvm.org
Tue Nov 1 23:08:38 PDT 2022


jeffbailey added a comment.

I'm not sure that the repeated description of sysroot is necessary, but I'm not sure that it's not.  I always worry about duplicated info.



================
Comment at: libc/examples/README.md:3
+========
+This directory contains few example programs which illustrate how one can set up
+their own projects to use LLVM's libc, either as an overlay or as the only
----------------
"a few" means about three.
"few" means very little, and is often used in a negative context.


================
Comment at: libc/examples/README.md:15
+
+```
+$> cd <example> # example $> cd hello_world
----------------
+.. code-block:: sh  ?  (Here and below)


================
Comment at: libc/examples/README.md:16
+```
+$> cd <example> # example $> cd hello_world
+$> mkdir build
----------------
Newline?


================
Comment at: libc/examples/README.md:16
+```
+$> cd <example> # example $> cd hello_world
+$> mkdir build
----------------
jeffbailey wrote:
> Newline?
What does this comment mean?


================
Comment at: libc/examples/README.md:31
+Before you can link an example against the overlay libc, you will have to
+install it. See [this](https://libc.llvm.org/overlay_mode.html) to learn how to
+install the libc's overlay static archive name `libllvmlibc.a`. Once installed,
----------------
s,this,the documentation on the overlay,


================
Comment at: libc/examples/README.md:32
+install it. See [this](https://libc.llvm.org/overlay_mode.html) to learn how to
+install the libc's overlay static archive name `libllvmlibc.a`. Once installed,
+to build an example against it, you have specify the directory in which the
----------------
Part of me wishes that the library were called liblvmlibc.a so that the command line argument was -llvmlibc, similar to libiberty.


================
Comment at: libc/examples/README.md:41
+
+`<GEN>` in the generator of your choice, typically `Unix Makefiles` or `Ninja` on Linux
+like platforms. Once configured with `cmake` as above, you can build the example
----------------
I wouldn't do multiple choice here.  Pick one path to show it and stick with that, and I'd stick with whatever the default one is for LLVM is possible.  If someone doesn't know what generators are supported and how they work, this isn't the place to learn about them.

You might make a note "We test with Makefile and Ninja generators here, but are showing $GENERATOR here for simplicity"


================
Comment at: libc/examples/README.md:80
+linking full executables against shared libraries. We have to use this as LLVM's
+libc does not yet have support for a shared libraries and dynamic linking and
+loading. After the `cmake` command, you can build the example as follows:
----------------
s,a ,,


================
Comment at: libc/examples/README.md:80-81
+linking full executables against shared libraries. We have to use this as LLVM's
+libc does not yet have support for a shared libraries and dynamic linking and
+loading. After the `cmake` command, you can build the example as follows:
+
----------------
jeffbailey wrote:
> s,a ,,
s,and loading,,


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D137090/new/

https://reviews.llvm.org/D137090



More information about the libc-commits mailing list