Figure out the right lib(64) path in a more principled way.

The old approach would copy the TARGET_ARCH libraries to both 32 and 64
bit directories if both exist in the TARGET_OUT tree. That may not lead
to observable bugs because only the directory corresponding to
TARGET_ARCH will actually be used later, but that's not a safe
assumption, and it's still confusing if nothing else.

Test: lunch armv8-eng; m build-art-target-golem
      lunch arm_krait-eng; m build-art-target-golem
  Check contents of $(TARGET_OUT)/system/{lib,lib64} directories
  after both builds
Test: Golem run:
  https://golem.corp.goog/Revision?repository=art&revision=18681&patch=17310
Bug: 243935575
Change-Id: I763644feccea7f95b4ea7bde87ac3e048178a51d
diff --git a/Android.mk b/Android.mk
index 0bdf741..f199f5a 100644
--- a/Android.mk
+++ b/Android.mk
@@ -669,16 +669,11 @@
 	# Also, platform libraries are installed in prebuilts, so copy them over.
 	$(call extract-from-apex,$(RUNTIME_APEX),\
 	  $(PRIVATE_RUNTIME_APEX_DEPENDENCY_FILES)) && \
-	  for libdir in $(TARGET_OUT)/lib $(TARGET_OUT)/lib64; do \
-	    if [ -d $$libdir/bionic ]; then \
-	      mv -f $$libdir/bionic/*.so $$libdir; \
-	    fi || exit 1; \
-	  done && \
-	  for libdir in $(TARGET_OUT)/lib $(TARGET_OUT)/lib64; do \
-	    if [ -d $$libdir ]; then \
-          cp prebuilts/runtime/mainline/platform/impl/$(TARGET_ARCH)/*.so $$libdir; \
-	    fi || exit 1; \
-	  done
+	  libdir=$(TARGET_OUT)/lib$$(expr $(TARGET_ARCH) : '.*\(64\)' || :) && \
+	  if [ -d $$libdir/bionic ]; then \
+	    mv -f $$libdir/bionic/*.so $$libdir; \
+	  fi && \
+	  cp prebuilts/runtime/mainline/platform/impl/$(TARGET_ARCH)/*.so $$libdir
 	$(call extract-from-apex,$(CONSCRYPT_APEX),\
 	  $(PRIVATE_CONSCRYPT_APEX_DEPENDENCY_LIBS))
 	$(call extract-from-apex,$(I18N_APEX),\