From 3982e3aca72921f599d7522342216296133729b7 Mon Sep 17 00:00:00 2001 From: Mauro Rossi Date: Mon, 7 Nov 2022 01:57:02 +0100 Subject: [PATCH] r600/sfn: allow building with clang 6 (Android 9) static constexpr const 'value' is replaced by static function in all type_char template specializations to avoid the following building errors happening with clang 6 /home/utente/pie-x86_kernel/prebuilts/clang/host/linux-x86/clang-4691093/bin/ld.lld: error: undefined symbol: r600::type_char::value >>> referenced by sfn_scheduler.cpp >>> sfn_sfn_scheduler.cpp.o:(bool r600::BlockSheduler::collect_ready_type(std::__1::list >&, std::__1::list >&)) in archive src/gallium/drivers/r600/libr600.a ... /home/utente/pie-x86_kernel/prebuilts/clang/host/linux-x86/clang-4691093/bin/ld.lld: error: undefined symbol: r600::type_char::value >>> referenced by sfn_scheduler.cpp >>> sfn_sfn_scheduler.cpp.o:(bool r600::BlockSheduler::collect_ready_type(std::__1::list >&, std::__1::list >&)) in archive src/gallium/drivers/r600/libr600.a clang-6.0: error: linker command failed with exit code 1 (use -v to see invocation) Cc: "22.2" "22.3" mesa-stable Reviewed-by: Gert Wollny Part-of: (cherry picked from commit e74d989a6935ce11d06970a3c98b474b7773c905) --- .pick_status.json | 2 +- .../drivers/r600/sfn/sfn_scheduler.cpp | 22 +++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index d79562e9e25..9267b55c042 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -337,7 +337,7 @@ "description": "r600/sfn: allow building with clang 6 (Android 9)", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null }, diff --git a/src/gallium/drivers/r600/sfn/sfn_scheduler.cpp b/src/gallium/drivers/r600/sfn/sfn_scheduler.cpp index 2afd2b166b0..7ffb8a70419 100644 --- a/src/gallium/drivers/r600/sfn/sfn_scheduler.cpp +++ b/src/gallium/drivers/r600/sfn/sfn_scheduler.cpp @@ -870,43 +870,43 @@ template struct type_char { }; template <> struct type_char { - static constexpr const char value = 'A'; + static const char value() { return 'A';}; }; template <> struct type_char { - static constexpr const char value = 'G'; + static const char value() { return 'G';}; }; template <> struct type_char { - static constexpr const char value = 'E'; + static const char value() { return 'E';}; }; template <> struct type_char { - static constexpr const char value = 'T'; + static const char value() { return 'T';}; }; template <> struct type_char { - static constexpr const char value = 'F'; + static const char value() { return 'F';}; }; template <> struct type_char { - static constexpr const char value = 'M'; + static const char value() { return 'M';}; }; template <> struct type_char { - static constexpr const char value = 'R'; + static const char value() { return 'R';}; }; template <> struct type_char { - static constexpr const char value = 'X'; + static const char value() { return 'X';}; }; template <> struct type_char { - static constexpr const char value = 'S'; + static const char value() { return 'S';}; }; template <> struct type_char { - static constexpr const char value = 'I'; + static const char value() { return 'I';}; }; template @@ -928,7 +928,7 @@ BlockSheduler::collect_ready_type(std::list& ready, std::list& availab } for (auto& i : ready) - sfn_log << SfnLog::schedule << type_char::value << "; " << *i << "\n"; + sfn_log << SfnLog::schedule << type_char::value() << "; " << *i << "\n"; return !ready.empty(); }