[llvm-commits] LLD patch: Fix for Linux link errors

Sidney Manning sidneym at codeaurora.org
Thu Jun 21 12:37:59 PDT 2012


The attached change fixes this linkage error I see when building on Linux:

 

./../../../lib/liblldNative.a(ReaderNative.cpp.o): In function
`lld::make_error_code(lld::native_reader_error)':

ReaderNative.cpp:(.text._ZN3lld15make_error_codeENS_19native_reader_errorE[_
ZN3lld15make_error_codeENS_19native_reader_errorE]+0xd): undefined reference
to `lld::native_reader_category()'

../../../../lib/liblldYAML.a(ReaderYAML.cpp.o): In function
`lld::make_error_code(lld::yaml_reader_error)':

ReaderYAML.cpp:(.text._ZN3lld15make_error_codeENS_17yaml_reader_errorE[_ZN3l
ld15make_error_codeENS_17yaml_reader_errorE]+0xd): undefined reference to
`lld::yaml_reader_category()'

collect2: error: ld returned 1 exit status

make[2]: *** [bin/lld-core] Error 1

make[1]: *** [tools/lld/tools/lld-core/CMakeFiles/lld-core.dir/all] Error 2

make: *** [all] Error 2

 

GNU-ld is pickier about library ordering unless you wrap the libs in
start-group/end-group.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120621/8e4a0d9f/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lld.link-order.diff
Type: application/octet-stream
Size: 393 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120621/8e4a0d9f/attachment.obj>


More information about the llvm-commits mailing list