0002-configure.ac-fix-grpc-build.patch 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. From d355618813bb8180e460ba45a0ebd3ce5183e267 Mon Sep 17 00:00:00 2001
  2. From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  3. Date: Mon, 22 Jan 2024 22:15:21 +0100
  4. Subject: [PATCH] configure.ac: fix grpc build
  5. abseil and other google tools are now subject to
  6. "Google's Foundational C++ Support Policy" [0][1]. This currently
  7. mandates gcc 7.3.1 and C++14 as minimum versions. So replace -std=c++11
  8. by -std=c++14 to fix following build failure:
  9. checking whether /home/buildroot/autobuild/instance-0/output-1/host/bin/sparc64-linux-g++ accepts -std=c++11
  10. configure:25105: result: yes
  11. configure:25127: checking grpc++/grpc++.h usability
  12. configure:25127: /home/buildroot/autobuild/instance-0/output-1/host/bin/sparc64-linux-g++ -c -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -O1 -g0 -D_FORTIFY_SOURCE=2 -std=c++11 -DNOMINMAX -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 conftest.cpp >&5
  13. In file included from /home/buildroot/autobuild/instance-0/output-1/host/sparc64-buildroot-linux-gnu/sysroot/usr/include/absl/base/config.h:86,
  14. from /home/buildroot/autobuild/instance-0/output-1/host/sparc64-buildroot-linux-gnu/sysroot/usr/include/absl/base/const_init.h:25,
  15. from /home/buildroot/autobuild/instance-0/output-1/host/sparc64-buildroot-linux-gnu/sysroot/usr/include/absl/synchronization/mutex.h:67,
  16. from /home/buildroot/autobuild/instance-0/output-1/host/sparc64-buildroot-linux-gnu/sysroot/usr/include/grpcpp/impl/codegen/sync.h:32,
  17. from /home/buildroot/autobuild/instance-0/output-1/host/sparc64-buildroot-linux-gnu/sysroot/usr/include/grpcpp/completion_queue.h:41,
  18. from /home/buildroot/autobuild/instance-0/output-1/host/sparc64-buildroot-linux-gnu/sysroot/usr/include/grpcpp/channel.h:25,
  19. from /home/buildroot/autobuild/instance-0/output-1/host/sparc64-buildroot-linux-gnu/sysroot/usr/include/grpcpp/grpcpp.h:52,
  20. from /home/buildroot/autobuild/instance-0/output-1/host/sparc64-buildroot-linux-gnu/sysroot/usr/include/grpc++/grpc++.h:26,
  21. from conftest.cpp:167:
  22. /home/buildroot/autobuild/instance-0/output-1/host/sparc64-buildroot-linux-gnu/sysroot/usr/include/absl/base/policy_checks.h:79:2: error: #error "C++ versions less than C++14 are not supported."
  23. 79 | #error "C++ versions less than C++14 are not supported."
  24. | ^~~~~
  25. [0] https://github.com/abseil/abseil-cpp/releases/tag/20230125.0
  26. [1] https://github.com/google/oss-policies-info/blob/b842c39db88e6569dfe2cf98be434b03507cb503/foundational-cxx-support-matrix.md
  27. Fixes:
  28. - http://autobuild.buildroot.org/results/e2cf909ab3c356f1881fd18cfa039e87faa10d7d
  29. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  30. Upstream: https://github.com/collectd/collectd/commit/d355618813bb8180e460ba45a0ebd3ce5183e267
  31. ---
  32. configure.ac | 16 ++++++++--------
  33. 1 file changed, 8 insertions(+), 8 deletions(-)
  34. diff --git a/configure.ac b/configure.ac
  35. index c816d3dbbc..dad27f53b0 100644
  36. --- a/configure.ac
  37. +++ b/configure.ac
  38. @@ -2853,20 +2853,20 @@ PKG_CHECK_MODULES([GRPCPP], [grpc++],
  39. fi
  40. if test "x$withval" != "xno"; then
  41. - AC_MSG_CHECKING([whether $CXX accepts -std=c++11])
  42. - if test_cxx_flags -std=c++11; then
  43. + AC_MSG_CHECKING([whether $CXX accepts -std=c++14])
  44. + if test_cxx_flags -std=c++14; then
  45. AC_MSG_RESULT([yes])
  46. else
  47. AC_MSG_RESULT([no])
  48. - with_libgrpcpp="no (requires C++11 support)"
  49. - with_libprotobuf="no (<google/protobuf/util/time_util.h> requires C++11 support)"
  50. + with_libgrpcpp="no (requires C++14 support)"
  51. + with_libprotobuf="no (<absl/base/policy_checks.h> requires C++14 support)"
  52. fi
  53. fi
  54. if test "x$with_libgrpcpp" = "xyes"; then
  55. AC_LANG_PUSH(C++)
  56. SAVE_CPPFLAGS="$CPPFLAGS"
  57. - CPPFLAGS="-std=c++11 $with_libgrpcpp_cppflags $GRPCPP_CFLAGS $CPPFLAGS"
  58. + CPPFLAGS="-std=c++14 $with_libgrpcpp_cppflags $GRPCPP_CFLAGS $CPPFLAGS"
  59. AC_CHECK_HEADERS([grpc++/grpc++.h],
  60. [with_libgrpcpp="yes"],
  61. [with_libgrpcpp="no (<grpc++/grpc++.h> not found)"]
  62. @@ -2880,7 +2880,7 @@ if test "x$with_libgrpcpp" = "xyes"; then
  63. SAVE_CPPFLAGS="$CPPFLAGS"
  64. SAVE_LDFLAGS="$LDFLAGS"
  65. SAVE_LIBS="$LIBS"
  66. - CPPFLAGS="-std=c++11 $with_libgrpcpp_cppflags $GRPCPP_CFLAGS $CPPFLAGS"
  67. + CPPFLAGS="-std=c++14 $with_libgrpcpp_cppflags $GRPCPP_CFLAGS $CPPFLAGS"
  68. LDFLAGS="$with_libgrpcpp_ldflags"
  69. if test "x$GRPCPP_LIBS" = "x"; then
  70. LIBS="-lgrpc++"
  71. @@ -2908,7 +2908,7 @@ if test "x$with_libgrpcpp" = "xyes"; then
  72. AC_LANG_POP(C++)
  73. fi
  74. -BUILD_WITH_LIBGRPCPP_CPPFLAGS="-std=c++11 $with_libgrpcpp_cppflags $GRPCPP_CFLAGS"
  75. +BUILD_WITH_LIBGRPCPP_CPPFLAGS="-std=c++14 $with_libgrpcpp_cppflags $GRPCPP_CFLAGS"
  76. BUILD_WITH_LIBGRPCPP_LDFLAGS="$with_libgrpcpp_ldflags"
  77. BUILD_WITH_LIBGRPCPP_LIBS="$GRPCPP_LIBS"
  78. AC_SUBST([BUILD_WITH_LIBGRPCPP_CPPFLAGS])
  79. @@ -4852,7 +4852,7 @@ if test "x$withval" != "xno"; then
  80. AC_CHECK_LIB([protobuf], [main],
  81. [
  82. SAVE_CPPFLAGS="$CPPFLAGS"
  83. - CPPFLAGS="-std=c++11 $with_libprotobuf_cppflags $PROTOBUF_CFLAGS"
  84. + CPPFLAGS="-std=c++14 $with_libprotobuf_cppflags $PROTOBUF_CFLAGS"
  85. if test "x$PROTOBUF_LIBS" = "x"
  86. then
  87. PROTOBUF_LIBS="-lprotobuf"