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& newAtoms, std::vector& additionalUndefines); +#if LTO_API_VERSION >= 18 static thinlto_code_gen_t init_thinlto_codegen(const std::vector& files, const std::vector& allAtoms, ld::Internal& state, const OptimizeOptions& options, CStringToAtom& deadllvmAtoms, CStringToAtom& llvmAtoms); +#endif static std::vector _s_files; static bool _s_llvmOptionsProcessed; @@ -1035,6 +1037,7 @@ bool Parser::optimizeLTO(const std::vector files, return true; } +#if LTO_API_VERSION >= 18 // Create the ThinLTO codegenerator thinlto_code_gen_t Parser::init_thinlto_codegen(const std::vector& files, const std::vector& allAtoms, @@ -1185,6 +1188,7 @@ thinlto_code_gen_t Parser::init_thinlto_codegen(const std::vector& return thingenerator; } +#endif // Full LTO processing bool Parser::optimizeThinLTO(const std::vector& files, -- 2.11.0