[libcxx-commits] [PATCH] D88188: [libc++] Use runtime rather then compile-time glibc version check

Petr Hosek via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Sep 29 14:22:17 PDT 2020


phosek added a comment.

In D88188#2293911 <https://reviews.llvm.org/D88188#2293911>, @phosek wrote:

> In D88188#2291752 <https://reviews.llvm.org/D88188#2291752>, @phosek wrote:
>
>> In D88188#2291289 <https://reviews.llvm.org/D88188#2291289>, @ldionne wrote:
>>
>>> I think the correct way of handling this would be to define a Lit feature that expresses the fact that we're running on a newer system but we compiled on an older system. Like the reverse of what we do for back-deployment on macOS. I know this isn't what we did in D56702 <https://reviews.llvm.org/D56702>, but that strikes me as the wrong approach. It seems to me like this is something we want to tackle at the test driver level, not inside the test per-se. Am I missing something?
>>
>> We could do it in lit but I'm not sure if it's going to be simpler or cleaner. We would need to find out the location of glibc which can vary across distributions and then parse the output of `libc.so.6 --version` which is more work than what we're doing in `glibc_version_less_than`. If the test is being executed on a remote system, this needs to be done over remote protocol which may complicate things even more. Then we need to pass that version to each test where the logic is likely going to be very similar what I've done in this patch.
>
> I checked with @mcgrathr and pointed out that we could use `getconf GNU_LIBC_VERSION` to get glibc version which is a command-line equivalent of `confstr` invocation used by `glibc_version_less_than`. I still think that the current implementation is simpler, but I can try to rewrite it in lit if you prefer.

@ldionne do you have any preference?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D88188



More information about the libcxx-commits mailing list