[libc-commits] [PATCH] D112104: [libc] add malloc funcs as external entrypoints

Siva Chandra via Phabricator via libc-commits libc-commits at lists.llvm.org
Wed Oct 20 22:23:18 PDT 2021

sivachandra added a comment.

While this is OK logically, I would like to take a step back and design the external entrypoint concept in a more cleaner fashion. With this change as is, there will be an external entrypoint rule and there is also an `EXT_DEPS` option to `add_entrypoint_library`. We should unify these. What I mean is the following steps:

1. Make `add_external_entrypoint` have a `DEPENDS` option which captures the external deps. We should move the SCUDO related logic from `lib/CMakeLists.txt` to `src/stdlib/CMakeLists.txt` and list the SCUDO entrypoints there with the appropriate `DEPENDS` list..
2. Remove `EXT_DEPS` option to `add_entrypoint_library` and list the external entrypoint deps as part of the normal `DEPENDS` option.
3. `add_entrypoint_library` should recognize that a DEPENDS entry is an external entrypoint and get the objects appropriately.
4. We will not need any special handling in `libc/CMakeLists.txt` as in being done in this change. Also, the external entrypoints can be listed like any other entrypoint in the `entrypoints.txt` files.

Comment at: libc/src/stdlib/CMakeLists.txt:184
+  malloc
I think these targets should be added conditionally like this:


  rG LLVM Github Monorepo



More information about the libc-commits mailing list