[libcxx-commits] [PATCH] D75954: Cache uwnind frame headers as they are found.

Sterling Augustine via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Mar 11 11:53:12 PDT 2020

saugustine added a comment.

In D75954#1917512 <https://reviews.llvm.org/D75954#1917512>, @jgorbe wrote:

> I think it looks good now. My only issue is that it seems to rely on a couple of glibc-specific features: glibc modifying the fields `adds` and `subs` in `dl_phdr_info` when loading/unloading libraries (which this patch uses to know when to invalidate the cache), and `dl_iterate_phdr` holding a lock (which the patch relies on to avoid races while accessing the cache). What other libc implementations do we support? Do they share these behaviors we rely on here?

Freebsd has the dlpi_adds and dlpi_subs are both in freebsd since at least 2012, and musl too. I'm pretty sure the provide equal synchronization guarantees, otherwise they wouldn't be compatible with glibc. And looking at the similar libgcc code, it appears that libgcc also relies on such synchronization.

So I do believe we are OK from that perspective. If it comes to it, we could add a configure-time option, but I'm hoping to avoid that.

  rG LLVM Github Monorepo



More information about the libcxx-commits mailing list