<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">One of the buildbot failed with this commit:<div>The Buildbot has detected a new failure on builder sanitizer-x86_64-linux while building llvm.<br>Full details are available at:<br><a href="http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/builds/5539">http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/builds/5539</a><br><br>Buildbot URL: <a href="http://lab.llvm.org:8011/">http://lab.llvm.org:8011/</a><br><br>Buildslave for this Build: sanitizer-buildbot1<br><br>Build Reason: scheduler<br>Build Source Stamp: [branch trunk] 199338<br>Blamelist: qcolombet<br><br>BUILD FAILED: failed annotate failed build 64-bit llvm using clang<br><br>sincerely,<br>-The Buildbot</div><div><br></div><div>The error is:</div><div><pre style="font-family: 'Courier New', courier, monotype, monospace; font-size: medium;"><span class="stdout">Linking CXX shared library ../../lib/libLTO.so
</span><span class="stderr" style="color: red;">/usr/bin/ld:/home/dtoolsbot/build/sanitizer-x86_64-linux/build/llvm_build64/tools/lto/LTO.exports:41: syntax error in VERSION script
clang-3.5: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [lib/libLTO.so] Error 1
make[1]: *** [tools/lto/CMakeFiles/LTO.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
</span><span class="stdout">[100%] Built target llvm-lto</span></pre><div><br></div></div><div><div>I am looking into it.</div><div><br><div apple-content-edited="true">
<div style="color: rgb(0, 0, 0); font-family: Helvetica;  font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">-Quentin</div>

</div>
<br><div><div>On Jan 15, 2014, at 2:04 PM, Quentin Colombet <<a href="mailto:qcolombet@apple.com">qcolombet@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Author: qcolombet<br>Date: Wed Jan 15 16:04:35 2014<br>New Revision: 199338<br><br>URL: <a href="http://llvm.org/viewvc/llvm-project?rev=199338&view=rev">http://llvm.org/viewvc/llvm-project?rev=199338&view=rev</a><br>Log:<br>[LTO] Add a hook to map LLVM diagnostics into the clients of LTO.<br><br>Add a hook in the C API of LTO so that clients of the code generator can set<br>their own handler for the LLVM diagnostics.<br>The handler is defined like this:<br>typedef void (*lto_diagnostic_handler_t)(lto_codegen_diagnostic_severity_t<br>severity, const char *diag, void *ctxt)<br>- severity says how bad this is.<br>- diag is a string that contains the diagnostic message.<br>- ctxt is the registered context for this handler.<br><br>This hook is more general than the lto_get_error_message, since this function<br>keeps only the latest message and can only be queried when something went wrong<br>(no warning for instance).<br><br><<a href="rdar://problem/15517596">rdar://problem/15517596</a>><br><br>Modified:<br>    llvm/trunk/include/llvm-c/lto.h<br>    llvm/trunk/include/llvm/LTO/LTOCodeGenerator.h<br>    llvm/trunk/lib/LTO/LTOCodeGenerator.cpp<br>    llvm/trunk/tools/lto/lto.cpp<br>    llvm/trunk/tools/lto/lto.exports<br><br>Modified: llvm/trunk/include/llvm-c/lto.h<br>URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm-c/lto.h?rev=199338&r1=199337&r2=199338&view=diff">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm-c/lto.h?rev=199338&r1=199337&r2=199338&view=diff</a><br>==============================================================================<br>--- llvm/trunk/include/llvm-c/lto.h (original)<br>+++ llvm/trunk/include/llvm-c/lto.h Wed Jan 15 16:04:35 2014<br>@@ -40,7 +40,7 @@ typedef bool lto_bool_t;<br>  * @{<br>  */<br><br>-#define LTO_API_VERSION 6<br>+#define LTO_API_VERSION 7<br><br> typedef enum {<br>     LTO_SYMBOL_ALIGNMENT_MASK              = 0x0000001F, /* log2 of alignment */<br>@@ -204,6 +204,33 @@ lto_module_get_symbol_name(lto_module_t<br> extern lto_symbol_attributes<br> lto_module_get_symbol_attribute(lto_module_t mod, unsigned int index);<br><br>+/**<br>+ * Diagnostic severity.<br>+ */<br>+typedef enum {<br>+  LTO_DS_ERROR,<br>+  LTO_DS_WARNING,<br>+  LTO_DS_NOTE<br>+} lto_codegen_diagnostic_severity_t;<br>+<br>+/**<br>+ * Diagnostic handler type.<br>+ * \p severity defines the severity.<br>+ * \p diag is the actual diagnostic.<br>+ * The diagnostic is not prefixed by any of severity keyword, e.g., 'error: '.<br>+ * \p ctxt is used to pass the context set with the diagnostic handler.<br>+ */<br>+typedef void (*lto_diagnostic_handler_t)(<br>+    lto_codegen_diagnostic_severity_t severity, const char *diag, void *ctxt);<br>+<br>+/**<br>+ * Set a diagnostic handler and the related context (void *).<br>+ * This is more general than lto_get_error_message, as the diagnostic handler<br>+ * can be called at anytime within lto.<br>+ */<br>+extern void lto_codegen_set_diagnostic_handler(lto_code_gen_t,<br>+                                               lto_diagnostic_handler_t,<br>+                                               void *);<br><br> /**<br>  * Instantiates a code generator.<br><br>Modified: llvm/trunk/include/llvm/LTO/LTOCodeGenerator.h<br>URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/LTO/LTOCodeGenerator.h?rev=199338&r1=199337&r2=199338&view=diff">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/LTO/LTOCodeGenerator.h?rev=199338&r1=199337&r2=199338&view=diff</a><br>==============================================================================<br>--- llvm/trunk/include/llvm/LTO/LTOCodeGenerator.h (original)<br>+++ llvm/trunk/include/llvm/LTO/LTOCodeGenerator.h Wed Jan 15 16:04:35 2014<br>@@ -46,6 +46,7 @@<br><br> namespace llvm {<br>   class LLVMContext;<br>+  class DiagnosticInfo;<br>   class GlobalValue;<br>   class Mangler;<br>   class MemoryBuffer;<br>@@ -115,6 +116,8 @@ struct LTOCodeGenerator {<br>                       bool disableGVNLoadPRE,<br>                       std::string &errMsg);<br><br>+  void setDiagnosticHandler(lto_diagnostic_handler_t, void *);<br>+<br>   bool shouldInternalize() const {<br>     return InternalizeStrategy != LTO_INTERNALIZE_NONE;<br>   }<br>@@ -139,6 +142,10 @@ private:<br>                         llvm::Mangler &Mangler);<br>   bool determineTarget(std::string &errMsg);<br><br>+  static void DiagnosticHandler(const llvm::DiagnosticInfo &DI, void *Context);<br>+<br>+  void DiagnosticHandler2(const llvm::DiagnosticInfo &DI);<br>+<br>   typedef llvm::StringMap<uint8_t> StringSet;<br><br>   llvm::LLVMContext &Context;<br>@@ -155,6 +162,8 @@ private:<br>   std::string MCpu;<br>   std::string NativeObjectPath;<br>   llvm::TargetOptions Options;<br>+  lto_diagnostic_handler_t DiagHandler;<br>+  void *DiagContext;<br> };<br><br> #endif // LTO_CODE_GENERATOR_H<br><br>Modified: llvm/trunk/lib/LTO/LTOCodeGenerator.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/LTO/LTOCodeGenerator.cpp?rev=199338&r1=199337&r2=199338&view=diff">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/LTO/LTOCodeGenerator.cpp?rev=199338&r1=199337&r2=199338&view=diff</a><br>==============================================================================<br>--- llvm/trunk/lib/LTO/LTOCodeGenerator.cpp (original)<br>+++ llvm/trunk/lib/LTO/LTOCodeGenerator.cpp Wed Jan 15 16:04:35 2014<br>@@ -21,6 +21,8 @@<br> #include "llvm/IR/Constants.h"<br> #include "llvm/IR/DataLayout.h"<br> #include "llvm/IR/DerivedTypes.h"<br>+#include "llvm/IR/DiagnosticInfo.h"<br>+#include "llvm/IR/DiagnosticPrinter.h"<br> #include "llvm/IR/LLVMContext.h"<br> #include "llvm/IR/Mangler.h"<br> #include "llvm/IR/Module.h"<br>@@ -37,6 +39,7 @@<br> #include "llvm/Support/FormattedStream.h"<br> #include "llvm/Support/Host.h"<br> #include "llvm/Support/MemoryBuffer.h"<br>+#include "llvm/Support/raw_ostream.h"<br> #include "llvm/Support/Signals.h"<br> #include "llvm/Support/TargetRegistry.h"<br> #include "llvm/Support/TargetSelect.h"<br>@@ -63,7 +66,8 @@ LTOCodeGenerator::LTOCodeGenerator()<br>     : Context(getGlobalContext()), Linker(new Module("ld-temp.o", Context)),<br>       TargetMach(NULL), EmitDwarfDebugInfo(false), ScopeRestrictionsDone(false),<br>       CodeModel(LTO_CODEGEN_PIC_MODEL_DYNAMIC),<br>-      InternalizeStrategy(LTO_INTERNALIZE_FULL), NativeObjectFile(NULL) {<br>+      InternalizeStrategy(LTO_INTERNALIZE_FULL), NativeObjectFile(NULL),<br>+      DiagHandler(NULL), DiagContext(NULL) {<br>   initializeLTOPasses();<br> }<br><br>@@ -536,3 +540,47 @@ void LTOCodeGenerator::parseCodeGenDebug<br>     cl::ParseCommandLineOptions(CodegenOptions.size(),<br>                                 const_cast<char **>(&CodegenOptions[0]));<br> }<br>+<br>+void LTOCodeGenerator::DiagnosticHandler(const DiagnosticInfo &DI,<br>+                                         void *Context) {<br>+  ((LTOCodeGenerator *)Context)->DiagnosticHandler2(DI);<br>+}<br>+<br>+void LTOCodeGenerator::DiagnosticHandler2(const DiagnosticInfo &DI) {<br>+  // Map the LLVM internal diagnostic severity to the LTO diagnostic severity.<br>+  lto_codegen_diagnostic_severity_t Severity;<br>+  switch (DI.getSeverity()) {<br>+  case DS_Error:<br>+    Severity = LTO_DS_ERROR;<br>+    break;<br>+  case DS_Warning:<br>+    Severity = LTO_DS_WARNING;<br>+    break;<br>+  case DS_Note:<br>+    Severity = LTO_DS_NOTE;<br>+    break;<br>+  }<br>+  // Create the string that will be reported to the external diagnostic handler.<br>+  std::string MsgStorage;<br>+  raw_string_ostream Stream(MsgStorage);<br>+  DiagnosticPrinterRawOStream DP(Stream);<br>+  DI.print(DP);<br>+  Stream.flush();<br>+<br>+  // If this method has been called it means someone has set up an external<br>+  // diagnostic handler. Assert on that.<br>+  assert(DiagHandler && "Invalid diagnostic handler");<br>+  (*DiagHandler)(Severity, MsgStorage.c_str(), DiagContext);<br>+}<br>+<br>+void<br>+LTOCodeGenerator::setDiagnosticHandler(lto_diagnostic_handler_t DiagHandler,<br>+                                       void *Ctxt) {<br>+  this->DiagHandler = DiagHandler;<br>+  this->DiagContext = Ctxt;<br>+  if (!DiagHandler)<br>+    return Context.setDiagnosticHandler(NULL, NULL);<br>+  // Register the LTOCodeGenerator stub in the LLVMContext to forward the<br>+  // diagnostic to the external DiagHandler.<br>+  Context.setDiagnosticHandler(LTOCodeGenerator::DiagnosticHandler, this);<br>+}<br><br>Modified: llvm/trunk/tools/lto/lto.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/lto/lto.cpp?rev=199338&r1=199337&r2=199338&view=diff">http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/lto/lto.cpp?rev=199338&r1=199337&r2=199338&view=diff</a><br>==============================================================================<br>--- llvm/trunk/tools/lto/lto.cpp (original)<br>+++ llvm/trunk/tools/lto/lto.cpp Wed Jan 15 16:04:35 2014<br>@@ -193,6 +193,13 @@ lto_symbol_attributes lto_module_get_sym<br>   return mod->getSymbolAttributes(index);<br> }<br><br>+/// Set a diagnostic handler.<br>+void lto_codegen_set_diagnostic_handler(lto_code_gen_t cg,<br>+                                        lto_diagnostic_handler_t diag_handler,<br>+                                        void *ctxt) {<br>+  cg->setDiagnosticHandler(diag_handler, ctxt);<br>+}<br>+<br> /// lto_codegen_create - Instantiates a code generator. Returns NULL if there<br> /// is an error.<br> lto_code_gen_t lto_codegen_create(void) {<br><br>Modified: llvm/trunk/tools/lto/lto.exports<br>URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/lto/lto.exports?rev=199338&r1=199337&r2=199338&view=diff">http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/lto/lto.exports?rev=199338&r1=199337&r2=199338&view=diff</a><br>==============================================================================<br>--- llvm/trunk/tools/lto/lto.exports (original)<br>+++ llvm/trunk/tools/lto/lto.exports Wed Jan 15 16:04:35 2014<br>@@ -15,6 +15,7 @@ lto_module_is_object_file_for_target<br> lto_module_is_object_file_in_memory<br> lto_module_is_object_file_in_memory_for_target<br> lto_module_dispose<br>+lto_codegen_set_diagnostic_handler<br> lto_codegen_add_module<br> lto_codegen_add_must_preserve_symbol<br> lto_codegen_compile<br><br><br>_______________________________________________<br>llvm-commits mailing list<br><a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits<br></blockquote></div><br></div></div></body></html>