Create libgcc_stripped with llvm-objcopy

llvm-objcopy now implements '--regex' option, which allows it to replace
GNU objcopy for creating libgcc_stripped archieve.

Test: build
Bug: 131631155
Change-Id: Ie1733ac8e9b3765f7652a562406dcedb4735cc1a
diff --git a/Android.bp b/Android.bp
index d63921a..537b58b 100644
--- a/Android.bp
+++ b/Android.bp
@@ -602,7 +602,6 @@
                     "__gnu_unwind_execute",
                     "__gnu_unwind_frame",
                 ],
-                use_gnu_strip: true,
             },
         },
         arm64: {
@@ -650,7 +649,6 @@
             "__register_frame_info_table_bases",
             "__register_frame_table",
         ],
-        use_gnu_strip: true,
     },
 }
 
diff --git a/scripts/strip.sh b/scripts/strip.sh
index 4a1ed3f..4362746 100755
--- a/scripts/strip.sh
+++ b/scripts/strip.sh
@@ -84,17 +84,17 @@
 }
 
 do_strip_keep_symbol_list() {
-    if [ -z "${use_gnu_strip}" ]; then
-        echo "do_strip_keep_symbol_list does not work with llvm-objcopy"
-        echo "http://b/131631155"
-        usage
-    fi
-
     echo "${symbols_to_keep}" | tr ',' '\n' > "${outfile}.symbolList"
-    KEEP_SYMBOLS="-w --strip-unneeded-symbol=* --keep-symbols="
-    KEEP_SYMBOLS+="${outfile}.symbolList"
 
-    "${CROSS_COMPILE}objcopy" "${infile}" "${outfile}.tmp" ${KEEP_SYMBOLS}
+    if [ -z "${use_gnu_strip}" ]; then
+        KEEP_SYMBOLS="--strip-unneeded-symbol=.* --keep-symbols="
+        KEEP_SYMBOLS+="${outfile}.symbolList"
+        "${CLANG_BIN}/llvm-objcopy" --regex "${infile}" "${outfile}.tmp" ${KEEP_SYMBOLS}
+    else
+        KEEP_SYMBOLS="--strip-unneeded-symbol=* --keep-symbols="
+        KEEP_SYMBOLS+="${outfile}.symbolList"
+        "${CROSS_COMPILE}objcopy" -w "${infile}" "${outfile}.tmp" ${KEEP_SYMBOLS}
+    fi
 }
 
 do_strip_keep_mini_debug_info() {