Support Soong native coverage

Soong (or any other prebuilt) can provide a .gcnodir file using
LOCAL_PREBUILT_COVERAGE_ARCHIVE. Just like today, if one isn't provided
for static libraries, an empty one will be created for Make modules to
use.

Also fixes a problem I noticed including whole static libs having
coverage into static libs. It was trying to write to /WHOLE since
PRIVATE_INTERMEDIATES_DIR was not set.

Bug: 32749731
Test: See build/soong change for soong-side tests
Test: Enabled coverage of a soong static lib, then include it in a make
static lib with LOCAL_WHOLE_STATIC_LIBRARIES and ensure that the any
shared libraries using the make static lib get the embedded coverage
information.
Change-Id: I32762f099c9757074fec922ee4822f819c9ceaf5
diff --git a/core/shared_library_internal.mk b/core/shared_library_internal.mk
index 6b914c9..1ea4cb8 100644
--- a/core/shared_library_internal.mk
+++ b/core/shared_library_internal.mk
@@ -96,6 +96,7 @@
 
 $(intermediates)/$(GCNO_ARCHIVE) : PRIVATE_ALL_OBJECTS := $(strip $(LOCAL_GCNO_FILES))
 $(intermediates)/$(GCNO_ARCHIVE) : PRIVATE_ALL_WHOLE_STATIC_LIBRARIES := $(strip $(built_whole_gcno_libraries)) $(strip $(built_static_gcno_libraries))
+$(intermediates)/$(GCNO_ARCHIVE) : PRIVATE_INTERMEDIATES_DIR := $(intermediates)
 $(intermediates)/$(GCNO_ARCHIVE) : $(LOCAL_GCNO_FILES) $(built_whole_gcno_libraries) $(built_static_gcno_libraries)
 	$(transform-o-to-static-lib)