OSDN Git Service

Reorder static libs to appease ld.gold linker
authorPirama Arumuga Nainar <pirama@google.com>
Tue, 7 Aug 2018 21:43:20 +0000 (14:43 -0700)
committerPirama Arumuga Nainar <pirama@google.com>
Tue, 7 Aug 2018 22:35:56 +0000 (22:35 +0000)
commit9f8b1301adf1cdf5aaca946b491374580c12a0df
tree1e526e656ba83d67e6bab77964826b8fe87c4cee
parent187c80870b0c21506b92ce01e0fb38ace2095cb2
Reorder static libs to appease ld.gold linker

Bug: http://b/112277682
Bug: http://b/79419131

Lld, which is the default linker for the platform, is able to resolve
symbols across libraries irrespective of the order they appear in the
command line.  This was not the case for ld.gold and other linkers.
Unfortunately, there are some targets that still rely on ld.gold
(pgo-taimen-config1 in internal release branch being one of
them).

With http://aosp/721652, libbt-stack should be added before libbt-common
so MessageLoopThread::~MessageLoopThread is resolved correctly.  If not,
the following error is reported by gold:

system/bt/stack/btu/btu_init.cc:41: error: undefined reference to
'bluetooth::common::MessageLoopThread::MessageLoopThread(std::__1::basic_string<char,
std::__1::char_traits<char>, std::__1::allocator<char> > const&)'

Test: m USE_CLANG_LLD=false
Change-Id: I9c8208218ffb4bb027ad75b51bcd484e9bb37368
stack/Android.bp