<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">guard usage of thinlto_code_gen_t behind an appropriate API version check

--- src/ld/parsers/lto_file.cpp
+++ src/ld/parsers/lto_file.cpp
@@ -292,12 +292,14 @@ private:
 								std::vector&lt;const ld::Atom*&gt;&amp;		newAtoms,
 								std::vector&lt;const char*&gt;&amp;			additionalUndefines);
 
+#if LTO_API_VERSION &gt;= 18
 	static thinlto_code_gen_t init_thinlto_codegen(const std::vector&lt;File*&gt;&amp;           files,
 												   const std::vector&lt;const ld::Atom*&gt;&amp; allAtoms,
 												   ld::Internal&amp;				       state,
 												   const OptimizeOptions&amp;			   options,
 												   CStringToAtom&amp;                      deadllvmAtoms,
 												   CStringToAtom&amp;                      llvmAtoms);
+#endif
 
 	static std::vector&lt;File*&gt;		_s_files;
 	static bool						_s_llvmOptionsProcessed;
@@ -1035,6 +1037,7 @@ bool Parser::optimizeLTO(const std::vector&lt;File*&gt;				files,
 	return true;
 }
 
+#if LTO_API_VERSION &gt;= 18
 // Create the ThinLTO codegenerator
 thinlto_code_gen_t Parser::init_thinlto_codegen(const std::vector&lt;File*&gt;&amp;           files,
 									            const std::vector&lt;const ld::Atom*&gt;&amp; allAtoms,
@@ -1185,6 +1188,7 @@ thinlto_code_gen_t Parser::init_thinlto_codegen(const std::vector&lt;File*&gt;&amp;
 
 	return thingenerator;
 }
+#endif
 
 // Full LTO processing
 bool Parser::optimizeThinLTO(const std::vector&lt;File*&gt;&amp;              files,
-- 
2.11.0
</pre></body></html>