For the new ar --plugin libLLVMgold.so to work we need libLTO linked with
authorTorok Edwin <edwintorok@gmail.com>
Tue, 26 May 2009 19:11:47 +0000 (19:11 +0000)
committerTorok Edwin <edwintorok@gmail.com>
Tue, 26 May 2009 19:11:47 +0000 (19:11 +0000)
pthreads, otherwise ar complains of unresolved references to pthread_mutex_*.
LTO doesn't actually use pthreads, but ManagedStatic does.

Fix this by linking in LIBS (that contains pthreads) for LTO and gold.
For now this links in more libs than needed (libffi for example), we can figure
out later how to link in those libs per-tool later.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72430 91177308-0d34-0410-b5e6-96231b3b80d8

Makefile.rules

index 23ffe3ea9609f9fdb9112bf20b9576290eb08a77..caa3335aa35982432bb1dee961b9b7785727d2fa 100644 (file)
@@ -948,7 +948,7 @@ $(LibName.SO): $(ObjectsO) $(ProjLibsPaths) $(LLVMLibsPaths) $(LibDir)/.dir
        $(Echo) Linking $(BuildMode) $(SharedLibKindMessage) \
          $(LIBRARYNAME)$(SHLIBEXT)
        $(Verb) $(Link) $(SharedLinkOptions) -o $@ $(ObjectsO) \
-         $(ProjLibsOptions) $(LLVMLibsOptions)
+         $(ProjLibsOptions) $(LLVMLibsOptions) $(LIBS)
 else
 $(LibName.SO): $(ObjectsO) $(LibDir)/.dir
        $(Echo) Linking $(BuildMode) Shared Library $(LIBRARYNAME)$(SHLIBEXT)