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)
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

index ebe294c..af18966 100644 (file)
@@ -213,8 +213,8 @@ cc_test {
     ],
     static_libs: [
         "libbt-bta",
-        "libbt-common",
         "libbt-stack",
+        "libbt-common",
         "libbt-sbc-decoder",
         "libbt-sbc-encoder",
         "libFraunhoferAAC",