[PATCH] gcc-4.8.1 -flto, error for visibility of LLVMX86CompilationCallback2?

Thanks, now it links.

If nobody objects, I will commit the following patch:

diff --git a/lib/Target/X86/X86JITInfo.cpp b/lib/Target/X86/X86JITInfo.cpp
index 44d8cce..8acc220 100644
--- a/lib/Target/X86/X86JITInfo.cpp
+++ b/lib/Target/X86/X86JITInfo.cpp
@@ -339,6 +339,8 @@ extern "C" {
/// must locate the start of the stub or call site and pass it into the JIT
/// compiler function.
extern "C" {
+LLVM_ATTRIBUTE_USED // Fix gcc -flto builds. gcc's LTO (as of 4.8.1) don't sees
+ // references from inline asm.
LLVM_LIBRARY_VISIBILITY void LLVMX86CompilationCallback2(intptr_t *StackPtr,
                                                          intptr_t RetAddr) {
   intptr_t *RetAddrLoc = &StackPtr[1];

(However, I still can't link unittest programs, because of the use of anchor methods in CommandLine. I will take a look at it shortly.)

/Patrik Hägglund

Hi Patrik,

Thanks. Commited as r183824.

/Patrik Hägglund