Implements a non-modifying GNU basename() function for libunwindstack

This function is added in compat.h, which provides functions that are
available within libunwindstack's normal build environment but
unavailable within its Chromium build environment. We call the
function "compat_basename".

This function isn't available in Android NDK version 16 (it was first
made available in 23, as per https://bit.ly/31Gkyl9). Although there's a
POSIX basename() available via <libgen.h>, this function has different
behavior with regards to trailing slashes and can also modify its
argument under some circumstances.

Bug: 991960
Change-Id: I876d13d8e3c1797705c34c6d85ad663e2848f410
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/third_party/libunwindstack/+/1875324
Reviewed-by: Mike Wittman <wittman@chromium.org>
7 files changed
tree: 607b96d29012fe889766f7c8e46875f275d486e2
  1. .clang-format
  2. BUILD.gn
  3. LICENSE
  4. OWNERS
  5. README.chromium
  6. patches/
  7. src/
  8. tools/