Package: libantlr4-runtime-dev
Version: 4.9+dfsg-1
Severity: important
Tags: patch
Control: affects -1 src:mysql-workbench
Control: block 937102 by -1

The source of antlr4-cpp-runtime defines two different ABIs,
one for C++ < 17 and one for C++ >= 17.

The library is always built for the C++ < 17 ABI with
https://sources.debian.org/src/antlr4-cpp-runtime/4.9+dfsg-1/CMakeLists.txt/#L79

Programs trying to use ANTLRInputStream.h with C++ >= 17
(like mysql-workbench) fail to link since the header exposed
a different ABI than what the library provided.

The attached patch removes the problematic part from the header,
a proper fix is in the upstream versin 4.9.2.

It would be good to have that fixed in bullseye,
and I can do an NMU if necessary.
Description: Revert change that broke using libantlr4-runtime4.9 with C++17
 Upstream commit 254b144b creeated a different ABI for C++-17,
 but it is not even possible to build antlr4-cpp-runtime
 for this ABI.
 .
 The proper fix would be upgrading to 4.9.2 where two commits
 in March 2021 fixed this issue:
  
https://github.com/antlr/antlr4/commits/master/runtime/Cpp/runtime/src/ANTLRInputStream.h
 .
 The upstream fix changes ABI, so go for the simple fix that does
 not offer a different ABI the library cannot even be built for.
Author: Adrian Bunk <b...@debian.org>

--- antlr4-cpp-runtime-4.9+dfsg.orig/runtime/src/ANTLRInputStream.h
+++ antlr4-cpp-runtime-4.9+dfsg/runtime/src/ANTLRInputStream.h
@@ -25,19 +25,11 @@ namespace antlr4 {
     /// What is name or source of this char stream?
     std::string name;
 
-#if __cplusplus >= 201703L
-    ANTLRInputStream(std::string_view input = "");
-#else
     ANTLRInputStream(const std::string &input = "");
-#endif
     ANTLRInputStream(const char data_[], size_t numberOfActualCharsInArray);
     ANTLRInputStream(std::istream &stream);
 
-#if __cplusplus >= 201703L
-    virtual void load(std::string_view input);
-#else
     virtual void load(const std::string &input);
-#endif
     virtual void load(std::istream &stream);
 
     /// Reset the stream so that it's in the same state it was

Reply via email to