perl-5.36.0-fix-configure-for-clang.patch 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. From 40db21129c0ba08ea457b6e40e7357e86ea1404b Mon Sep 17 00:00:00 2001
  2. From: Raul E Rangel <rrangel@chromium.org>
  3. Date: Fri, 28 Jul 2023 15:50:49 -0600
  4. Subject: [PATCH] hints/linux: Add additional expression when matching clang
  5. Newer versions of clang actually print the distro before `clang` when
  6. calling `$CC --version`. This changes fixes the regex so it can match
  7. this new pattern.
  8. i.e.,
  9. $ clang --version
  10. Debian clang version 14.0.6
  11. $ x86_64-pc-linux-gnu-clang --version
  12. Chromium OS 17.0_pre496208_p20230501-r1 clang version 17.0.0
  13. Fixes #21099
  14. BUG=b:283275881
  15. See: https://github.com/Perl/perl5/issues/21099
  16. ---
  17. hints/linux.sh | 2 +-
  18. 1 file changed, 1 insertion(+), 1 deletion(-)
  19. diff --git a/hints/linux.sh b/hints/linux.sh
  20. index e1508c7509..5202b28b09 100644
  21. --- a/hints/linux.sh
  22. +++ b/hints/linux.sh
  23. @@ -166,7 +166,7 @@ esac
  24. if [ -x /usr/bin/gcc ] ; then
  25. gcc=/usr/bin/gcc
  26. # clang also provides -print-search-dirs
  27. -elif ${cc:-cc} --version 2>/dev/null | grep -q '^clang ' ; then
  28. +elif ${cc:-cc} --version 2>/dev/null | grep -q -e '^clang version' -e ' clang version'; then
  29. gcc=${cc:-cc}
  30. else
  31. gcc=gcc
  32. --
  33. 2.41.0.585.gd2178a4bd4-goog