allow_undefined_symbols to link libelf-tls-library

* Since Android does not have __tls_get_addr yet,
  -fno-emulated-tls is only a test of compiler.
  Lld is correct to reject this at link time.
  But if the purpose of this test is to check at run-time,
  allow_undefined-symbols is the trick to get the linked library.

Bug: http://b/74361956
Test: build and compare linked file
Change-Id: Ibcdc8b50aeeaec9d7d308b66df2a6997ce3c1a4f
This commit is contained in:
Chih-Hung Hsieh 2018-04-12 13:40:54 -07:00 committed by Chih-hung Hsieh
parent 48227e6602
commit d6b56c921f

View file

@ -47,6 +47,7 @@ cc_test_library {
defaults: ["bionic_testlib_defaults"],
srcs: ["elf_tls_test_library.cpp"],
cflags: ["-fno-emulated-tls"],
allow_undefined_symbols: true, // __tls_get_addr is undefined.
}
// -----------------------------------------------------------------------------