From a99aba9e48b104d5754ff54cfdf8c1ca5255ccb6 Mon Sep 17 00:00:00 2001 From: Avi Kivity Date: Sat, 3 Oct 2020 19:45:58 +0300 Subject: [PATCH] idl-compiler: generate views after serializers Clang eagerly instantiates templates, so if it needs a template function for which it has a declaration but not a definition, it will not instantiate the definition when it sees it. This causes link errors. In this case, the views use the serializer implementations, but are generated before them. Fix by generating the view implementations after the serializer implementations that they use. --- idl-compiler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/idl-compiler.py b/idl-compiler.py index eae8bc9100..3570167795 100755 --- a/idl-compiler.py +++ b/idl-compiler.py @@ -1037,9 +1037,9 @@ def load_file(name): data = parse_file(name) if data: handle_types(data) - add_visitors(cout) if data: handle_objects(data, hout, cout) + add_visitors(cout) if config.ns != '': fprintln(cout, "}") cout.close()