This is an archive of the discontinued LLVM Phabricator instance.

[lldb/CMake] Auto-generate the Initialize and Terminate calls for plugin
ClosedPublic

Authored by JDevlieghere on Jan 20 2020, 4:03 PM.

Details

Summary

This patch changes the way we initialize and terminate the plugins in the system initializer. It uses a similar approach as LLVM's TARGETS_TO_BUILD with a def file that enumerates the configured plugins. To make this work I had to rename some of the plugins. I went for the solution with the least churn, but we should probably clean this up in the future as separate patches.

Diff Detail

Event Timeline

JDevlieghere created this revision.Jan 20 2020, 4:03 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 20 2020, 4:03 PM
JDevlieghere marked an inline comment as done.Jan 20 2020, 4:07 PM
JDevlieghere added inline comments.
lldb/source/API/SystemInitializerFull.cpp
28

I used the namespaces to limit the churn, but I would prefer to just remove them altogether form the plugins, or at least have the main entry point live under lldb_private.

Do we need to worry about ordering of the plugins?

lldb/source/Plugins/Platform/CMakeLists.txt
9 ↗(On Diff #239206)

I would use STREQUAL rather than MATCHES.

JDevlieghere retitled this revision from [lldb/CMake] Auto-generate the Initialize and Terminate calls for plugins to [lldb/CMake] Auto-generate the Initialize and Terminate calls for plugins (WIP).Jan 20 2020, 4:35 PM
JDevlieghere updated this revision to Diff 239217.EditedJan 20 2020, 5:14 PM

Do we need to worry about ordering of the plugins?

Yes, it appears to matter... I'm still seeing test failures which I need to debug. I'm not sure yet if they're because of missing initializers (that don't have a corresponding CMake plugin) or because of the ordering.

Overall, I like this, but I have a lot of comments:

  • I actually very much like the plugin namespace idea -- it makes it harder to use plugin code from non-plugin code, and allows plugins of the same category (e.g. ProcessLinux and ProcessNetBSD) to define similar concepts without fear of name clashes. I do see how that gets in the way of auto-generation though, so putting the initialization endpoints into a more predictable place seems like a good compromise. I wouldn't put the entire main class into the lldb_private namespace though, as that is also something that should not be accessed by generic code. Ideally, I'd just take the Initialize and Terminate (TBH, I don't think we really need the terminate function, but that may be more refactoring than you're ready for right now), and put it into a completely separate, predictibly-named file (void lldb_private::InitializeProcessLinux() in Plugins/Process/Linux/Initialization.h ?). That way the "main" file could be free to include anything it wants, without fear of polluting the namespace of anything, and we could get rid of the ScriptInterpreterPythonImpl thingy.
  • it would be nice to auto-generate the #include directives too. Including everything and then not using it sort of works, but it does not feel right. It should be fairly easy to generate an additional .def file with just the includes...
  • The way you disable ScriptInterpreterPython/Lua plugins is pretty hacky. Maybe the .def file should offer a way to exclude entire plugin classes?
#ifdef LLDB_WANT_SCRIPT_INTERPRETERS
ScriptInterpreterPython::Initialize(); // or whatever
#endif
  • some of the things you initialize are definitely not plugins (e.g. Plugins/Process/Utilty, Plugins/Language/ClangCommon). I think that things which don't need to register their entry points anywhere should not need to have the Initialize/Terminate goo... Can we avoid that, perhaps by making the "plugin" special at the cmake level. Since this code is used only by other plugins, it makes sense to have it somewhere under Plugins/, but it is not really a plugin, it does not need to register anything, and we do not need to be able to explicitly disable it (as it will get enabled/disabled automatically when used by the other plugins).
  • Having this as one bit patch is fine for now, but once we agree on the general idea, it should be split off into smaller patches, as some of the changes are not completely trivial (like the bunching of the macos platform plugins for instance)

Do we need to worry about ordering of the plugins?

Yes, it appears to matter... I'm still seeing test failures which I need to debug. I'm not sure yet if they're because of missing initializers (that don't have a corresponding CMake plugin) or because of the ordering.

Order of plugins within a kind should not matter, but it's possible it does. Some of the entry points may need to be changed so that they are less grabby. I'm not sure if order of plugin kinds matters right now, but I don't think it would be wrong if it did (e.g. have symbol files depend on object files). However, it looks like this approach already supports that...

Since the initialization function will have to have predictable names anyway, instead of generating the #include directives, we could just automatically forward declare the needed functions. So, the .def file would expand to something like:

extern lldb_initialize_objectfile_elf();
lldb_initialize_objectfile_elf();
extern lldb_initialize_objectfile_macho();
lldb_initialize_objectfile_macho();
...

That way we would have only one generated file, and we could ditch the Initialization.h file for every plugin (which would contain just the two forward declarations anyway). And this approach would be pretty close to what we'd need to do for dynamically loaded plugins (where instead of an extern declaration we'd have a dlsym lookup).

Complete rewrite based on the external forward declarations.

JDevlieghere retitled this revision from [lldb/CMake] Auto-generate the Initialize and Terminate calls for plugins (WIP) to [lldb/CMake] Auto-generate the Initialize and Terminate calls for plugin.Feb 12 2020, 3:58 PM

This looks like a bad upload -- based on some earlier version of this patch and not master..

Squash commits into single diff

This looks like a bad upload -- based on some earlier version of this patch and not master..

Yup, you're right, forgot to squash the commits.

I think this is great. Just a bit of polishing...

lldb/include/lldb/Core/PluginManager.h
25–29

This macro should forward to the "ADV" (advanced?) one.

lldb/source/API/SystemInitializerFull.cpp
27–29

I don't like this recycling of the name LLDB_PLUGIN. Maybe rename this to LLDB_PLUGIN_OP, or the "other" macro to LLDB_PLUGIN_DEFINE ?

lldb/source/Plugins/ABI/ARC/ABISysV_arc.cpp
58

missing _ADV. You might want to double check that the build with all targets enabled still works.

lldb/source/Plugins/Plugins.def.in
13

Maybe also mention LLDB_SCRIPT_PLUGIN ?

lldb/tools/lldb-test/CMakeLists.txt
27

It looks like you're including the def file as Plugins/Plugins.def in SystemInitializerFull. Can we do the same thing here and avoid this LLDB_PLUGINS_INCLUDES business ?

Address code review feedback

labath accepted this revision.Feb 16 2020, 11:54 PM

This looks good. Thanks for working on this.

lldb/source/Plugins/CMakeLists.txt
45

I guess you don't need to set this now.

This revision is now accepted and ready to land.Feb 16 2020, 11:54 PM
This revision was automatically updated to reflect the committed changes.

Autogeneration of the code puts extra burden on us for tracking what is defined where and for repackaging LLDB with custom build rules (we need plain Makefile in the distribution). I presume the same problem is for gn users, for FreeBSD etc.

The NetBSD buildbot is now broken:

FAILED: lib/liblldb.so.11.0.0git 
: && /home/motus/netbsd8/netbsd8/wrappers/clang++ -fPIC -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wstring-conversion -fdiagnostics-color -ffunction-sections -fdata-sections -Wno-deprecated-declarations -Wno-unknown-pragmas -Wno-strict-aliasing -Wno-deprecated-register -Wno-vla-extension -O3 -DNDEBUG  -Wl,-z,defs -Wl,--color-diagnostics   -Wl,-O3 -Wl,--gc-sections  -Wl,--version-script,"/home/motus/netbsd8/netbsd8/build-stage2/tools/lldb/source/API/liblldb.exports" -shared -Wl,-soname,liblldb.so.11git -o lib/liblldb.so.11.0.0git tools/lldb/source/API/CMakeFiles/liblldb.dir/SBAddress.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBAttachInfo.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBBlock.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBBreakpoint.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBBreakpointLocation.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBBreakpointName.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBBreakpointOptionCommon.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBBroadcaster.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBCommandInterpreter.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBCommandReturnObject.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBCommunication.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBCompileUnit.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBData.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBDebugger.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBDeclaration.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBError.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBEvent.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBExecutionContext.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBExpressionOptions.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBFileSpec.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBFile.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBFileSpecList.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBFrame.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBFunction.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBHostOS.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBInstruction.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBInstructionList.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBLanguageRuntime.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBLaunchInfo.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBLineEntry.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBListener.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBMemoryRegionInfo.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBMemoryRegionInfoList.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBModule.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBModuleSpec.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBPlatform.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBProcess.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBProcessInfo.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBQueue.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBQueueItem.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBReproducer.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBSection.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBSourceManager.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBStream.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBStringList.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBStructuredData.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBSymbol.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBSymbolContext.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBSymbolContextList.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBTarget.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBThread.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBThreadCollection.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBThreadPlan.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBTrace.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBTraceOptions.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBType.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBTypeCategory.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBTypeEnumMember.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBTypeFilter.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBTypeFormat.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBTypeNameSpecifier.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBTypeSummary.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBTypeSynthetic.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBValue.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBValueList.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBVariablesOptions.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBWatchpoint.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBUnixSignals.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SystemInitializerFull.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/__/__/bindings/LLDBWrapPython.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/__/__/bindings/LLDBWrapLua.cpp.o  -Wl,-rpath,/home/motus/netbsd8/netbsd8/build-stage2/lib:/usr/pkg/lib: lib/liblldbBase.a lib/liblldbBreakpoint.a lib/liblldbCore.a lib/liblldbDataFormatters.a lib/liblldbExpression.a lib/liblldbHost.a lib/liblldbInitialization.a lib/liblldbInterpreter.a lib/liblldbSymbol.a lib/liblldbTarget.a lib/liblldbUtility.a lib/liblldbPluginABIAArch64.a lib/liblldbPluginABIARM.a lib/liblldbPluginABIHexagon.a lib/liblldbPluginABIMips.a lib/liblldbPluginABIPowerPC.a lib/liblldbPluginABISystemZ.a lib/liblldbPluginABIX86.a lib/liblldbPluginArchitectureArm.a lib/liblldbPluginArchitectureMips.a lib/liblldbPluginArchitecturePPC64.a lib/liblldbPluginDisassemblerLLVMC.a lib/liblldbPluginDynamicLoaderDarwinKernel.a lib/liblldbPluginDynamicLoaderMacOSXDYLD.a lib/liblldbPluginDynamicLoaderPosixDYLD.a lib/liblldbPluginDynamicLoaderStatic.a lib/liblldbPluginDynamicLoaderHexagonDYLD.a lib/liblldbPluginDynamicLoaderWindowsDYLD.a lib/liblldbPluginDynamicLoaderWasmDYLD.a lib/liblldbPluginInstructionARM.a lib/liblldbPluginInstructionARM64.a lib/liblldbPluginInstructionMIPS.a lib/liblldbPluginInstructionMIPS64.a lib/liblldbPluginInstructionPPC64.a lib/liblldbPluginInstrumentationRuntimeASan.a lib/liblldbPluginInstrumentationRuntimeMainThreadChecker.a lib/liblldbPluginInstrumentationRuntimeTSan.a lib/liblldbPluginInstrumentationRuntimeUBSan.a lib/liblldbPluginJITLoaderGDB.a lib/liblldbPluginCPlusPlusLanguage.a lib/liblldbPluginObjCLanguage.a lib/liblldbPluginObjCPlusPlusLanguage.a lib/liblldbPluginCXXItaniumABI.a lib/liblldbPluginAppleObjCRuntime.a lib/liblldbPluginRenderScriptRuntime.a lib/liblldbPluginMemoryHistoryASan.a lib/liblldbPluginObjectContainerBSDArchive.a lib/liblldbPluginObjectContainerMachOArchive.a lib/liblldbPluginObjectFileBreakpad.a lib/liblldbPluginObjectFileELF.a lib/liblldbPluginObjectFileMachO.a lib/liblldbPluginObjectFilePECOFF.a lib/liblldbPluginObjectFileJIT.a lib/liblldbPluginObjectFileWasm.a lib/liblldbPluginOperatingSystemPython.a lib/liblldbPluginPlatformLinux.a lib/liblldbPluginPlatformFreeBSD.a lib/liblldbPluginPlatformNetBSD.a lib/liblldbPluginPlatformOpenBSD.a lib/liblldbPluginPlatformMacOSX.a lib/liblldbPluginPlatformWindows.a lib/liblldbPluginPlatformGDB.a lib/liblldbPluginPlatformAndroid.a lib/liblldbPluginProcessNetBSD.a lib/liblldbPluginProcessGDBRemote.a lib/liblldbPluginProcessElfCore.a lib/liblldbPluginProcessMachCore.a lib/liblldbPluginProcessMinidump.a lib/liblldbPluginScriptInterpreterNone.a lib/liblldbPluginScriptInterpreterPython.a lib/liblldbPluginScriptInterpreterLua.a lib/liblldbPluginStructuredDataDarwinLog.a lib/liblldbPluginSymbolFileBreakpad.a lib/liblldbPluginSymbolFileDWARF.a lib/liblldbPluginSymbolFileSymtab.a lib/liblldbPluginSymbolFilePDB.a lib/liblldbPluginSystemRuntimeMacOSX.a lib/liblldbPluginSymbolVendorELF.a lib/liblldbPluginSymbolVendorWasm.a lib/liblldbPluginTypeSystemClang.a lib/liblldbPluginUnwindAssemblyInstEmulation.a lib/liblldbPluginUnwindAssemblyX86.a lib/libLLVMSupport.a lib/libLLVMAArch64CodeGen.a lib/libLLVMAArch64AsmParser.a lib/libLLVMAArch64Disassembler.a lib/libLLVMAArch64Desc.a lib/libLLVMAArch64Info.a lib/libLLVMAArch64Utils.a lib/libLLVMAMDGPUCodeGen.a lib/libLLVMMIRParser.a lib/libLLVMAMDGPUAsmParser.a lib/libLLVMAMDGPUDisassembler.a lib/libLLVMAMDGPUDesc.a lib/libLLVMAMDGPUInfo.a lib/libLLVMAMDGPUUtils.a lib/libLLVMARMCodeGen.a lib/libLLVMARMAsmParser.a lib/libLLVMARMDisassembler.a lib/libLLVMARMDesc.a lib/libLLVMARMInfo.a lib/libLLVMARMUtils.a lib/libLLVMBPFCodeGen.a lib/libLLVMBPFAsmParser.a lib/libLLVMBPFDesc.a lib/libLLVMBPFDisassembler.a lib/libLLVMBPFInfo.a lib/libLLVMHexagonCodeGen.a lib/libLLVMHexagonAsmParser.a lib/libLLVMHexagonDisassembler.a lib/libLLVMHexagonDesc.a lib/libLLVMHexagonInfo.a lib/libLLVMLanaiCodeGen.a lib/libLLVMLanaiAsmParser.a lib/libLLVMLanaiDisassembler.a lib/libLLVMLanaiDesc.a lib/libLLVMLanaiInfo.a lib/libLLVMMSP430CodeGen.a lib/libLLVMMSP430AsmParser.a lib/libLLVMMSP430Desc.a lib/libLLVMMSP430Disassembler.a lib/libLLVMMSP430Info.a lib/libLLVMNVPTXCodeGen.a lib/libLLVMNVPTXDesc.a lib/libLLVMNVPTXInfo.a lib/libLLVMPowerPCCodeGen.a lib/libLLVMPowerPCAsmParser.a lib/libLLVMPowerPCDesc.a lib/libLLVMPowerPCDisassembler.a lib/libLLVMPowerPCInfo.a lib/libLLVMRISCVCodeGen.a lib/libLLVMRISCVAsmParser.a lib/libLLVMRISCVDesc.a lib/libLLVMRISCVDisassembler.a lib/libLLVMRISCVInfo.a lib/libLLVMRISCVUtils.a lib/libLLVMSparcCodeGen.a lib/libLLVMSparcAsmParser.a lib/libLLVMSparcDesc.a lib/libLLVMSparcDisassembler.a lib/libLLVMSparcInfo.a lib/libLLVMSystemZCodeGen.a lib/libLLVMSystemZAsmParser.a lib/libLLVMSystemZDisassembler.a lib/libLLVMSystemZDesc.a lib/libLLVMSystemZInfo.a lib/libLLVMWebAssemblyCodeGen.a lib/libLLVMWebAssemblyAsmParser.a lib/libLLVMWebAssemblyDisassembler.a lib/libLLVMWebAssemblyDesc.a lib/libLLVMWebAssemblyInfo.a lib/libLLVMX86CodeGen.a lib/libLLVMCFGuard.a lib/libLLVMX86AsmParser.a lib/libLLVMX86Desc.a lib/libLLVMX86Disassembler.a lib/libLLVMX86Info.a lib/libLLVMX86Utils.a lib/libLLVMXCoreCodeGen.a lib/libLLVMXCoreDesc.a lib/libLLVMXCoreDisassembler.a lib/libLLVMXCoreInfo.a lib/libLLVMMipsCodeGen.a lib/libLLVMAsmPrinter.a lib/libLLVMGlobalISel.a lib/libLLVMSelectionDAG.a lib/libLLVMMipsAsmParser.a lib/libLLVMMipsDesc.a lib/libLLVMMipsDisassembler.a lib/libLLVMMipsInfo.a lib/liblldbPluginPlatformLinux.a lib/liblldbPluginPlatformGDB.a lib/liblldbPluginProcessPOSIX.a -lutil lib/liblldbPluginDynamicLoaderDarwinKernel.a lib/liblldbPluginPlatformMacOSX.a lib/liblldbPluginPlatformPOSIX.a lib/liblldbPluginDynamicLoaderMacOSXDYLD.a lib/liblldbPluginObjectFileMachO.a lib/liblldbPluginDynamicLoaderPosixDYLD.a lib/liblldbPluginProcessElfCore.a lib/liblldbPluginDynamicLoaderPosixDYLD.a lib/liblldbPluginProcessElfCore.a /usr/pkg/lib/libpython2.7.so /usr/lib/liblua.so /usr/lib/libm.so lib/liblldbPluginObjectFileBreakpad.a lib/liblldbPluginObjectFileELF.a lib/liblldbPluginObjectFileWasm.a lib/liblldbBreakpoint.a lib/liblldbCore.a lib/liblldbDataFormatters.a lib/liblldbExpression.a lib/liblldbInterpreter.a lib/liblldbSymbol.a lib/liblldbTarget.a lib/liblldbPluginCPlusPlusLanguage.a lib/liblldbPluginObjCLanguage.a lib/liblldbPluginAppleObjCRuntime.a lib/liblldbPluginRenderScriptRuntime.a lib/liblldbPluginObjectFileJIT.a lib/liblldbPluginSymbolFileDWARF.a lib/liblldbPluginSymbolFilePDB.a lib/liblldbPluginTypeSystemClang.a lib/liblldbCommands.a lib/liblldbPluginExpressionParserClang.a lib/liblldbPluginProcessUtility.a lib/liblldbPluginClangCommon.a lib/liblldbPluginCPPRuntime.a lib/liblldbPluginSymbolFileNativePDB.a lib/liblldbPluginObjCRuntime.a lib/liblldbBreakpoint.a lib/liblldbCore.a lib/liblldbDataFormatters.a lib/liblldbExpression.a lib/liblldbInterpreter.a lib/liblldbSymbol.a lib/liblldbTarget.a lib/liblldbPluginCPlusPlusLanguage.a lib/liblldbPluginObjCLanguage.a lib/liblldbPluginAppleObjCRuntime.a lib/liblldbPluginRenderScriptRuntime.a lib/liblldbPluginObjectFileJIT.a lib/liblldbPluginSymbolFileDWARF.a lib/liblldbPluginSymbolFilePDB.a lib/liblldbPluginTypeSystemClang.a lib/liblldbCommands.a lib/liblldbPluginExpressionParserClang.a lib/liblldbPluginProcessUtility.a lib/liblldbPluginClangCommon.a lib/liblldbPluginCPPRuntime.a lib/liblldbPluginSymbolFileNativePDB.a lib/liblldbPluginObjCRuntime.a lib/liblldbBreakpoint.a lib/liblldbCore.a lib/liblldbDataFormatters.a lib/liblldbExpression.a lib/liblldbInterpreter.a lib/liblldbSymbol.a lib/liblldbTarget.a lib/liblldbPluginCPlusPlusLanguage.a lib/liblldbPluginObjCLanguage.a lib/liblldbPluginAppleObjCRuntime.a lib/liblldbPluginRenderScriptRuntime.a lib/liblldbPluginObjectFileJIT.a lib/liblldbPluginSymbolFileDWARF.a lib/liblldbPluginSymbolFilePDB.a lib/liblldbPluginTypeSystemClang.a lib/liblldbCommands.a lib/liblldbPluginExpressionParserClang.a lib/liblldbPluginProcessUtility.a lib/liblldbPluginClangCommon.a lib/liblldbPluginCPPRuntime.a lib/liblldbPluginSymbolFileNativePDB.a lib/liblldbPluginObjCRuntime.a lib/liblldbBreakpoint.a lib/liblldbCore.a lib/liblldbDataFormatters.a lib/liblldbExpression.a lib/liblldbInterpreter.a lib/liblldbSymbol.a lib/liblldbTarget.a lib/liblldbPluginCPlusPlusLanguage.a lib/liblldbPluginObjCLanguage.a lib/liblldbPluginAppleObjCRuntime.a lib/liblldbPluginRenderScriptRuntime.a lib/liblldbPluginObjectFileJIT.a lib/liblldbPluginSymbolFileDWARF.a lib/liblldbPluginSymbolFilePDB.a lib/liblldbPluginTypeSystemClang.a lib/liblldbCommands.a lib/liblldbPluginExpressionParserClang.a lib/liblldbPluginProcessUtility.a lib/liblldbPluginClangCommon.a lib/liblldbPluginCPPRuntime.a lib/liblldbPluginSymbolFileNativePDB.a lib/liblldbPluginObjCRuntime.a lib/liblldbBreakpoint.a lib/liblldbCore.a lib/liblldbDataFormatters.a lib/liblldbExpression.a lib/liblldbInterpreter.a lib/liblldbSymbol.a lib/liblldbTarget.a lib/liblldbPluginCPlusPlusLanguage.a lib/liblldbPluginObjCLanguage.a lib/liblldbPluginAppleObjCRuntime.a lib/liblldbPluginRenderScriptRuntime.a lib/liblldbPluginObjectFileJIT.a lib/liblldbPluginSymbolFileDWARF.a lib/liblldbPluginSymbolFilePDB.a lib/liblldbPluginTypeSystemClang.a lib/liblldbCommands.a lib/liblldbPluginExpressionParserClang.a lib/liblldbPluginProcessUtility.a lib/liblldbPluginClangCommon.a lib/liblldbPluginCPPRuntime.a lib/liblldbPluginSymbolFileNativePDB.a lib/liblldbPluginObjCRuntime.a /usr/lib/libcurses.so /usr/lib/libform.so /usr/lib/libpanel.so lib/libLLVMDebugInfoDWARF.a lib/liblldbBase.a lib/libLLVMMCJIT.a lib/libLLVMExecutionEngine.a lib/libLLVMRuntimeDyld.a lib/libclangCodeGen.a lib/libLLVMCoverage.a lib/libLLVMLTO.a lib/libLLVMObjCARCOpts.a lib/libLLVMPasses.a lib/libLLVMCodeGen.a lib/libLLVMTarget.a lib/libLLVMCoroutines.a lib/libLLVMipo.a lib/libLLVMIRReader.a lib/libLLVMAsmParser.a lib/libLLVMVectorize.a lib/libLLVMBitWriter.a lib/libLLVMInstrumentation.a lib/libLLVMLinker.a lib/libLLVMScalarOpts.a lib/libLLVMAggressiveInstCombine.a lib/libLLVMInstCombine.a lib/libclangRewriteFrontend.a lib/libclangFrontend.a lib/libclangDriver.a lib/libLLVMOption.a lib/libclangParse.a lib/libclangRewrite.a lib/libclangSerialization.a lib/libclangSema.a lib/libclangEdit.a lib/libclangAnalysis.a lib/libclangASTMatchers.a lib/liblldbHost.a -lkvm /usr/lib/liblzma.so /usr/lib/libedit.so lib/libclangAST.a lib/libLLVMFrontendOpenMP.a lib/libLLVMTransformUtils.a lib/libLLVMAnalysis.a lib/libLLVMProfileData.a lib/libLLVMDebugInfoPDB.a lib/libLLVMObject.a lib/libLLVMBitReader.a lib/libLLVMMCParser.a lib/libLLVMTextAPI.a lib/libclangLex.a lib/libclangBasic.a lib/libLLVMCore.a lib/libLLVMRemarks.a lib/libLLVMBitstreamReader.a lib/liblldbUtility.a /usr/pkg/lib/libxml2.so lib/libLLVMMCDisassembler.a lib/libLLVMMC.a lib/libLLVMBinaryFormat.a lib/libLLVMDebugInfoCodeView.a lib/libLLVMDebugInfoMSF.a lib/libLLVMSupport.a lib/libLLVMDemangle.a /usr/lib/libz.so -lrt -lexecinfo -lterminfo -lpthread -lm && :
ld.lld: error: undefined symbol: lldb_private::lldb_initialize_ProcessNetBSD()
>>> referenced by SystemInitializerFull.cpp
>>>               tools/lldb/source/API/CMakeFiles/liblldb.dir/SystemInitializerFull.cpp.o:(lldb_private::SystemInitializerFull::Initialize())

ld.lld: error: undefined symbol: lldb_private::lldb_terminate_ProcessNetBSD()
>>> referenced by SystemInitializerFull.cpp
>>>               tools/lldb/source/API/CMakeFiles/liblldb.dir/SystemInitializerFull.cpp.o:(lldb_private::SystemInitializerFull::Terminate())

http://lab.llvm.org:8014/builders/netbsd-amd64/builds/1325/steps/ninja%20build%20local/logs/stdio

Please fix.

Autogeneration of the code puts extra burden on us for tracking what is defined where and for repackaging LLDB with custom build rules (we need plain Makefile in the distribution). I presume the same problem is for gn users, for FreeBSD etc.

The NetBSD buildbot is now broken:

FAILED: lib/liblldb.so.11.0.0git 
: && /home/motus/netbsd8/netbsd8/wrappers/clang++ -fPIC -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wstring-conversion -fdiagnostics-color -ffunction-sections -fdata-sections -Wno-deprecated-declarations -Wno-unknown-pragmas -Wno-strict-aliasing -Wno-deprecated-register -Wno-vla-extension -O3 -DNDEBUG  -Wl,-z,defs -Wl,--color-diagnostics   -Wl,-O3 -Wl,--gc-sections  -Wl,--version-script,"/home/motus/netbsd8/netbsd8/build-stage2/tools/lldb/source/API/liblldb.exports" -shared -Wl,-soname,liblldb.so.11git -o lib/liblldb.so.11.0.0git tools/lldb/source/API/CMakeFiles/liblldb.dir/SBAddress.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBAttachInfo.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBBlock.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBBreakpoint.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBBreakpointLocation.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBBreakpointName.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBBreakpointOptionCommon.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBBroadcaster.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBCommandInterpreter.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBCommandReturnObject.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBCommunication.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBCompileUnit.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBData.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBDebugger.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBDeclaration.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBError.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBEvent.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBExecutionContext.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBExpressionOptions.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBFileSpec.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBFile.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBFileSpecList.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBFrame.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBFunction.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBHostOS.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBInstruction.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBInstructionList.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBLanguageRuntime.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBLaunchInfo.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBLineEntry.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBListener.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBMemoryRegionInfo.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBMemoryRegionInfoList.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBModule.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBModuleSpec.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBPlatform.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBProcess.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBProcessInfo.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBQueue.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBQueueItem.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBReproducer.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBSection.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBSourceManager.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBStream.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBStringList.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBStructuredData.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBSymbol.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBSymbolContext.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBSymbolContextList.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBTarget.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBThread.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBThreadCollection.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBThreadPlan.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBTrace.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBTraceOptions.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBType.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBTypeCategory.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBTypeEnumMember.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBTypeFilter.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBTypeFormat.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBTypeNameSpecifier.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBTypeSummary.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBTypeSynthetic.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBValue.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBValueList.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBVariablesOptions.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBWatchpoint.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SBUnixSignals.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/SystemInitializerFull.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/__/__/bindings/LLDBWrapPython.cpp.o tools/lldb/source/API/CMakeFiles/liblldb.dir/__/__/bindings/LLDBWrapLua.cpp.o  -Wl,-rpath,/home/motus/netbsd8/netbsd8/build-stage2/lib:/usr/pkg/lib: lib/liblldbBase.a lib/liblldbBreakpoint.a lib/liblldbCore.a lib/liblldbDataFormatters.a lib/liblldbExpression.a lib/liblldbHost.a lib/liblldbInitialization.a lib/liblldbInterpreter.a lib/liblldbSymbol.a lib/liblldbTarget.a lib/liblldbUtility.a lib/liblldbPluginABIAArch64.a lib/liblldbPluginABIARM.a lib/liblldbPluginABIHexagon.a lib/liblldbPluginABIMips.a lib/liblldbPluginABIPowerPC.a lib/liblldbPluginABISystemZ.a lib/liblldbPluginABIX86.a lib/liblldbPluginArchitectureArm.a lib/liblldbPluginArchitectureMips.a lib/liblldbPluginArchitecturePPC64.a lib/liblldbPluginDisassemblerLLVMC.a lib/liblldbPluginDynamicLoaderDarwinKernel.a lib/liblldbPluginDynamicLoaderMacOSXDYLD.a lib/liblldbPluginDynamicLoaderPosixDYLD.a lib/liblldbPluginDynamicLoaderStatic.a lib/liblldbPluginDynamicLoaderHexagonDYLD.a lib/liblldbPluginDynamicLoaderWindowsDYLD.a lib/liblldbPluginDynamicLoaderWasmDYLD.a lib/liblldbPluginInstructionARM.a lib/liblldbPluginInstructionARM64.a lib/liblldbPluginInstructionMIPS.a lib/liblldbPluginInstructionMIPS64.a lib/liblldbPluginInstructionPPC64.a lib/liblldbPluginInstrumentationRuntimeASan.a lib/liblldbPluginInstrumentationRuntimeMainThreadChecker.a lib/liblldbPluginInstrumentationRuntimeTSan.a lib/liblldbPluginInstrumentationRuntimeUBSan.a lib/liblldbPluginJITLoaderGDB.a lib/liblldbPluginCPlusPlusLanguage.a lib/liblldbPluginObjCLanguage.a lib/liblldbPluginObjCPlusPlusLanguage.a lib/liblldbPluginCXXItaniumABI.a lib/liblldbPluginAppleObjCRuntime.a lib/liblldbPluginRenderScriptRuntime.a lib/liblldbPluginMemoryHistoryASan.a lib/liblldbPluginObjectContainerBSDArchive.a lib/liblldbPluginObjectContainerMachOArchive.a lib/liblldbPluginObjectFileBreakpad.a lib/liblldbPluginObjectFileELF.a lib/liblldbPluginObjectFileMachO.a lib/liblldbPluginObjectFilePECOFF.a lib/liblldbPluginObjectFileJIT.a lib/liblldbPluginObjectFileWasm.a lib/liblldbPluginOperatingSystemPython.a lib/liblldbPluginPlatformLinux.a lib/liblldbPluginPlatformFreeBSD.a lib/liblldbPluginPlatformNetBSD.a lib/liblldbPluginPlatformOpenBSD.a lib/liblldbPluginPlatformMacOSX.a lib/liblldbPluginPlatformWindows.a lib/liblldbPluginPlatformGDB.a lib/liblldbPluginPlatformAndroid.a lib/liblldbPluginProcessNetBSD.a lib/liblldbPluginProcessGDBRemote.a lib/liblldbPluginProcessElfCore.a lib/liblldbPluginProcessMachCore.a lib/liblldbPluginProcessMinidump.a lib/liblldbPluginScriptInterpreterNone.a lib/liblldbPluginScriptInterpreterPython.a lib/liblldbPluginScriptInterpreterLua.a lib/liblldbPluginStructuredDataDarwinLog.a lib/liblldbPluginSymbolFileBreakpad.a lib/liblldbPluginSymbolFileDWARF.a lib/liblldbPluginSymbolFileSymtab.a lib/liblldbPluginSymbolFilePDB.a lib/liblldbPluginSystemRuntimeMacOSX.a lib/liblldbPluginSymbolVendorELF.a lib/liblldbPluginSymbolVendorWasm.a lib/liblldbPluginTypeSystemClang.a lib/liblldbPluginUnwindAssemblyInstEmulation.a lib/liblldbPluginUnwindAssemblyX86.a lib/libLLVMSupport.a lib/libLLVMAArch64CodeGen.a lib/libLLVMAArch64AsmParser.a lib/libLLVMAArch64Disassembler.a lib/libLLVMAArch64Desc.a lib/libLLVMAArch64Info.a lib/libLLVMAArch64Utils.a lib/libLLVMAMDGPUCodeGen.a lib/libLLVMMIRParser.a lib/libLLVMAMDGPUAsmParser.a lib/libLLVMAMDGPUDisassembler.a lib/libLLVMAMDGPUDesc.a lib/libLLVMAMDGPUInfo.a lib/libLLVMAMDGPUUtils.a lib/libLLVMARMCodeGen.a lib/libLLVMARMAsmParser.a lib/libLLVMARMDisassembler.a lib/libLLVMARMDesc.a lib/libLLVMARMInfo.a lib/libLLVMARMUtils.a lib/libLLVMBPFCodeGen.a lib/libLLVMBPFAsmParser.a lib/libLLVMBPFDesc.a lib/libLLVMBPFDisassembler.a lib/libLLVMBPFInfo.a lib/libLLVMHexagonCodeGen.a lib/libLLVMHexagonAsmParser.a lib/libLLVMHexagonDisassembler.a lib/libLLVMHexagonDesc.a lib/libLLVMHexagonInfo.a lib/libLLVMLanaiCodeGen.a lib/libLLVMLanaiAsmParser.a lib/libLLVMLanaiDisassembler.a lib/libLLVMLanaiDesc.a lib/libLLVMLanaiInfo.a lib/libLLVMMSP430CodeGen.a lib/libLLVMMSP430AsmParser.a lib/libLLVMMSP430Desc.a lib/libLLVMMSP430Disassembler.a lib/libLLVMMSP430Info.a lib/libLLVMNVPTXCodeGen.a lib/libLLVMNVPTXDesc.a lib/libLLVMNVPTXInfo.a lib/libLLVMPowerPCCodeGen.a lib/libLLVMPowerPCAsmParser.a lib/libLLVMPowerPCDesc.a lib/libLLVMPowerPCDisassembler.a lib/libLLVMPowerPCInfo.a lib/libLLVMRISCVCodeGen.a lib/libLLVMRISCVAsmParser.a lib/libLLVMRISCVDesc.a lib/libLLVMRISCVDisassembler.a lib/libLLVMRISCVInfo.a lib/libLLVMRISCVUtils.a lib/libLLVMSparcCodeGen.a lib/libLLVMSparcAsmParser.a lib/libLLVMSparcDesc.a lib/libLLVMSparcDisassembler.a lib/libLLVMSparcInfo.a lib/libLLVMSystemZCodeGen.a lib/libLLVMSystemZAsmParser.a lib/libLLVMSystemZDisassembler.a lib/libLLVMSystemZDesc.a lib/libLLVMSystemZInfo.a lib/libLLVMWebAssemblyCodeGen.a lib/libLLVMWebAssemblyAsmParser.a lib/libLLVMWebAssemblyDisassembler.a lib/libLLVMWebAssemblyDesc.a lib/libLLVMWebAssemblyInfo.a lib/libLLVMX86CodeGen.a lib/libLLVMCFGuard.a lib/libLLVMX86AsmParser.a lib/libLLVMX86Desc.a lib/libLLVMX86Disassembler.a lib/libLLVMX86Info.a lib/libLLVMX86Utils.a lib/libLLVMXCoreCodeGen.a lib/libLLVMXCoreDesc.a lib/libLLVMXCoreDisassembler.a lib/libLLVMXCoreInfo.a lib/libLLVMMipsCodeGen.a lib/libLLVMAsmPrinter.a lib/libLLVMGlobalISel.a lib/libLLVMSelectionDAG.a lib/libLLVMMipsAsmParser.a lib/libLLVMMipsDesc.a lib/libLLVMMipsDisassembler.a lib/libLLVMMipsInfo.a lib/liblldbPluginPlatformLinux.a lib/liblldbPluginPlatformGDB.a lib/liblldbPluginProcessPOSIX.a -lutil lib/liblldbPluginDynamicLoaderDarwinKernel.a lib/liblldbPluginPlatformMacOSX.a lib/liblldbPluginPlatformPOSIX.a lib/liblldbPluginDynamicLoaderMacOSXDYLD.a lib/liblldbPluginObjectFileMachO.a lib/liblldbPluginDynamicLoaderPosixDYLD.a lib/liblldbPluginProcessElfCore.a lib/liblldbPluginDynamicLoaderPosixDYLD.a lib/liblldbPluginProcessElfCore.a /usr/pkg/lib/libpython2.7.so /usr/lib/liblua.so /usr/lib/libm.so lib/liblldbPluginObjectFileBreakpad.a lib/liblldbPluginObjectFileELF.a lib/liblldbPluginObjectFileWasm.a lib/liblldbBreakpoint.a lib/liblldbCore.a lib/liblldbDataFormatters.a lib/liblldbExpression.a lib/liblldbInterpreter.a lib/liblldbSymbol.a lib/liblldbTarget.a lib/liblldbPluginCPlusPlusLanguage.a lib/liblldbPluginObjCLanguage.a lib/liblldbPluginAppleObjCRuntime.a lib/liblldbPluginRenderScriptRuntime.a lib/liblldbPluginObjectFileJIT.a lib/liblldbPluginSymbolFileDWARF.a lib/liblldbPluginSymbolFilePDB.a lib/liblldbPluginTypeSystemClang.a lib/liblldbCommands.a lib/liblldbPluginExpressionParserClang.a lib/liblldbPluginProcessUtility.a lib/liblldbPluginClangCommon.a lib/liblldbPluginCPPRuntime.a lib/liblldbPluginSymbolFileNativePDB.a lib/liblldbPluginObjCRuntime.a lib/liblldbBreakpoint.a lib/liblldbCore.a lib/liblldbDataFormatters.a lib/liblldbExpression.a lib/liblldbInterpreter.a lib/liblldbSymbol.a lib/liblldbTarget.a lib/liblldbPluginCPlusPlusLanguage.a lib/liblldbPluginObjCLanguage.a lib/liblldbPluginAppleObjCRuntime.a lib/liblldbPluginRenderScriptRuntime.a lib/liblldbPluginObjectFileJIT.a lib/liblldbPluginSymbolFileDWARF.a lib/liblldbPluginSymbolFilePDB.a lib/liblldbPluginTypeSystemClang.a lib/liblldbCommands.a lib/liblldbPluginExpressionParserClang.a lib/liblldbPluginProcessUtility.a lib/liblldbPluginClangCommon.a lib/liblldbPluginCPPRuntime.a lib/liblldbPluginSymbolFileNativePDB.a lib/liblldbPluginObjCRuntime.a lib/liblldbBreakpoint.a lib/liblldbCore.a lib/liblldbDataFormatters.a lib/liblldbExpression.a lib/liblldbInterpreter.a lib/liblldbSymbol.a lib/liblldbTarget.a lib/liblldbPluginCPlusPlusLanguage.a lib/liblldbPluginObjCLanguage.a lib/liblldbPluginAppleObjCRuntime.a lib/liblldbPluginRenderScriptRuntime.a lib/liblldbPluginObjectFileJIT.a lib/liblldbPluginSymbolFileDWARF.a lib/liblldbPluginSymbolFilePDB.a lib/liblldbPluginTypeSystemClang.a lib/liblldbCommands.a lib/liblldbPluginExpressionParserClang.a lib/liblldbPluginProcessUtility.a lib/liblldbPluginClangCommon.a lib/liblldbPluginCPPRuntime.a lib/liblldbPluginSymbolFileNativePDB.a lib/liblldbPluginObjCRuntime.a lib/liblldbBreakpoint.a lib/liblldbCore.a lib/liblldbDataFormatters.a lib/liblldbExpression.a lib/liblldbInterpreter.a lib/liblldbSymbol.a lib/liblldbTarget.a lib/liblldbPluginCPlusPlusLanguage.a lib/liblldbPluginObjCLanguage.a lib/liblldbPluginAppleObjCRuntime.a lib/liblldbPluginRenderScriptRuntime.a lib/liblldbPluginObjectFileJIT.a lib/liblldbPluginSymbolFileDWARF.a lib/liblldbPluginSymbolFilePDB.a lib/liblldbPluginTypeSystemClang.a lib/liblldbCommands.a lib/liblldbPluginExpressionParserClang.a lib/liblldbPluginProcessUtility.a lib/liblldbPluginClangCommon.a lib/liblldbPluginCPPRuntime.a lib/liblldbPluginSymbolFileNativePDB.a lib/liblldbPluginObjCRuntime.a lib/liblldbBreakpoint.a lib/liblldbCore.a lib/liblldbDataFormatters.a lib/liblldbExpression.a lib/liblldbInterpreter.a lib/liblldbSymbol.a lib/liblldbTarget.a lib/liblldbPluginCPlusPlusLanguage.a lib/liblldbPluginObjCLanguage.a lib/liblldbPluginAppleObjCRuntime.a lib/liblldbPluginRenderScriptRuntime.a lib/liblldbPluginObjectFileJIT.a lib/liblldbPluginSymbolFileDWARF.a lib/liblldbPluginSymbolFilePDB.a lib/liblldbPluginTypeSystemClang.a lib/liblldbCommands.a lib/liblldbPluginExpressionParserClang.a lib/liblldbPluginProcessUtility.a lib/liblldbPluginClangCommon.a lib/liblldbPluginCPPRuntime.a lib/liblldbPluginSymbolFileNativePDB.a lib/liblldbPluginObjCRuntime.a /usr/lib/libcurses.so /usr/lib/libform.so /usr/lib/libpanel.so lib/libLLVMDebugInfoDWARF.a lib/liblldbBase.a lib/libLLVMMCJIT.a lib/libLLVMExecutionEngine.a lib/libLLVMRuntimeDyld.a lib/libclangCodeGen.a lib/libLLVMCoverage.a lib/libLLVMLTO.a lib/libLLVMObjCARCOpts.a lib/libLLVMPasses.a lib/libLLVMCodeGen.a lib/libLLVMTarget.a lib/libLLVMCoroutines.a lib/libLLVMipo.a lib/libLLVMIRReader.a lib/libLLVMAsmParser.a lib/libLLVMVectorize.a lib/libLLVMBitWriter.a lib/libLLVMInstrumentation.a lib/libLLVMLinker.a lib/libLLVMScalarOpts.a lib/libLLVMAggressiveInstCombine.a lib/libLLVMInstCombine.a lib/libclangRewriteFrontend.a lib/libclangFrontend.a lib/libclangDriver.a lib/libLLVMOption.a lib/libclangParse.a lib/libclangRewrite.a lib/libclangSerialization.a lib/libclangSema.a lib/libclangEdit.a lib/libclangAnalysis.a lib/libclangASTMatchers.a lib/liblldbHost.a -lkvm /usr/lib/liblzma.so /usr/lib/libedit.so lib/libclangAST.a lib/libLLVMFrontendOpenMP.a lib/libLLVMTransformUtils.a lib/libLLVMAnalysis.a lib/libLLVMProfileData.a lib/libLLVMDebugInfoPDB.a lib/libLLVMObject.a lib/libLLVMBitReader.a lib/libLLVMMCParser.a lib/libLLVMTextAPI.a lib/libclangLex.a lib/libclangBasic.a lib/libLLVMCore.a lib/libLLVMRemarks.a lib/libLLVMBitstreamReader.a lib/liblldbUtility.a /usr/pkg/lib/libxml2.so lib/libLLVMMCDisassembler.a lib/libLLVMMC.a lib/libLLVMBinaryFormat.a lib/libLLVMDebugInfoCodeView.a lib/libLLVMDebugInfoMSF.a lib/libLLVMSupport.a lib/libLLVMDemangle.a /usr/lib/libz.so -lrt -lexecinfo -lterminfo -lpthread -lm && :
ld.lld: error: undefined symbol: lldb_private::lldb_initialize_ProcessNetBSD()
>>> referenced by SystemInitializerFull.cpp
>>>               tools/lldb/source/API/CMakeFiles/liblldb.dir/SystemInitializerFull.cpp.o:(lldb_private::SystemInitializerFull::Initialize())

ld.lld: error: undefined symbol: lldb_private::lldb_terminate_ProcessNetBSD()
>>> referenced by SystemInitializerFull.cpp
>>>               tools/lldb/source/API/CMakeFiles/liblldb.dir/SystemInitializerFull.cpp.o:(lldb_private::SystemInitializerFull::Terminate())

http://lab.llvm.org:8014/builders/netbsd-amd64/builds/1325/steps/ninja%20build%20local/logs/stdio

Please fix.

Should be fixed by 3ee281082737d18585abff3b482a7ab86af73b5a.

Autogeneration of the code puts extra burden on us for tracking what is defined where and for repackaging LLDB with custom build rules (we need plain Makefile in the distribution). I presume the same problem is for gn users, for FreeBSD etc.

LLVM has a policy to not consider downstream issues when making changes, so you won't achieve much from that angle (you can check out the current camel case thread on llvm-dev to see how deeply some feel about this policy). And even though we ourselves had to do some build system gymnastics to merge this change, I do think this change does make sense for llvm/lldb.

However, ignoring all downstream considerations, I am still not a fan of code generation, and if you have a idea how to achieve something similar without it, I would be very happy to hear it out.