BUILD_SHARED_LIBS build

Khilan Gudka Khilan.Gudka at cl.cam.ac.uk
Mon Nov 24 02:24:21 PST 2014


Hi Rafael

I'm also experiencing this with FreeBSD's linker (10.0-RELEASE-p12).
Applying your patch resolves the issue. Would it make sense to commit the
patch?

Thanks

--
Khilan Gudka
Research Associate
Security Group
Computer Laboratory
University of Cambridge
http://www.cl.cam.ac.uk/~kg365/

On 5 November 2014 at 17:41, Rafael EspĂ­ndola <rafael.espindola at gmail.com>
wrote:

> > The reduced testcase is attached. Build it with
> >
> > gcc test3.c -fPIC -shared -o test3.so
> > gcc test2.c -fPIC -shared -o test2.so test3.so
> > gcc test.c -o test test2.so -fuse-ld=gold # works
> > gcc test.c -o test test2.so -fuse-ld=bfd #fails
> >
> > Maybe we should just require a non-broken linker for BUILD_SHARED_LIBS?
>
> Good news is that bfd ld has a command line option to enable the sane
> behavior, so we should be able to just use the attached patch. With it
> we get fewer bogus dependencies. For example, we go from
>
> build
> lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/AggressiveAntiDepBreaker.cpp.o:
> CXX_COMPILER
> /home/espindola/llvm/llvm/lib/CodeGen/AggressiveAntiDepBreaker.cpp
> || include/llvm/IR/intrinsics_gen lib/libLLVMSupport.so
> lib/libLLVMCore.so lib/libLLVMBitReader.so
> lib/libLLVMTransformUtils.so lib/libLLVMInstCombine.so
> lib/libLLVMScalarOpts.so lib/libLLVMipa.so lib/libLLVMAnalysis.so
> lib/libLLVMMCParser.so lib/libLLVMMC.so lib/libLLVMObject.so
> lib/libLLVMTarget.so lib/libLLVMProfileData.so
>
> to
>
> build
> lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/AggressiveAntiDepBreaker.cpp.o:
> CXX_COMPILER
> /home/espindola/llvm/llvm/lib/CodeGen/AggressiveAntiDepBreaker.cpp
> || include/llvm/IR/intrinsics_gen lib/libLLVMSupport.so
> lib/libLLVMCore.so lib/libLLVMTransformUtils.so
> lib/libLLVMScalarOpts.so lib/libLLVMAnalysis.so lib/libLLVMMC.so
> lib/libLLVMTarget.so
>
> Cheers,
> Rafael
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141124/ece15ea2/attachment.html>


More information about the llvm-commits mailing list