[NFCI][llvm-jitlink] Return 1 instead of exit(1) on entry point error (#228311)
In main(), if EntryPoint lookup fails, llvm-jitlink was calling
exit(1). Because exit() is noreturn, the stack is not unwound and
destructors for Session S and its associated objects are not run.
LSan detects these in-flight allocations (such as dlsym buffers
in InProcessDylibManager) as memory leaks at atexit, causing
ExecutionEngine/JITLink/x86-64/COFF_directive_alternatename_fail.s
to fail on ASan/LSan buildbots.
Returning 1 from main() allows S and other local variables to be cleanly
destructed before process termination.
For https://github.com/llvm/llvm-project/issues/186534
Fixes https://lab.llvm.org/buildbot/#/builders/169/builds/27104
Log:
https://lab.llvm.org/buildbot/#/builders/169/builds/27104/steps/11/logs/stdio
Assisted-by: Gemini