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

Siva Chandra via Phabricator via libc-commits libc-commits at lists.llvm.org
Tue Nov 1 23:56:57 PDT 2022


sivachandra added inline comments.


================
Comment at: libc/examples/README.md:15
+
+```
+$> cd <example> # example $> cd hello_world
----------------
jeffbailey wrote:
> +.. code-block:: sh  ?  (Here and below)
I think the the `.. code-block::` syntax is for `.rst` files? This is a `.md` file to be rendered like the README.md file here: https://github.com/llvm/llvm-project/tree/main/libc/src/__support/CPP. The idea is that this is a less formal document as opposed to the docs in the `docs` directory which are of a formal nature. I am calling it "less formal" to imply that this will have much more churn than the docs in the `docs` directory.


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


================
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
----------------
jeffbailey wrote:
> Part of me wishes that the library were called liblvmlibc.a so that the command line argument was -llvmlibc, similar to libiberty.
Hmm ... the name is now hard coded in a few places upstream and downstream!


================
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
----------------
jeffbailey wrote:
> 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"
I have removed all discussion about the two types of generators.


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