Check the ability to link library during setup.

Checking at the right place fixes the missing functions when we were
trying to link the function later on.

Change-Id: I4ebae8a3cb6d31988510d09552215f4ff0ab0078
diff --git a/lib/ExecutionEngine/Compiler.cpp b/lib/ExecutionEngine/Compiler.cpp
index 45958dc..ed2130b 100644
--- a/lib/ExecutionEngine/Compiler.cpp
+++ b/lib/ExecutionEngine/Compiler.cpp
@@ -285,7 +285,7 @@
 
 int Compiler::linkModule(llvm::Module *moduleWith) {
   if (llvm::Linker::LinkModules(mModule, moduleWith,
-                                llvm::Linker::DestroySource,
+                                llvm::Linker::PreserveSource,
                                 &mError) != 0) {
     return hasError();
   }