Enable BCJ fiter support in xz-embedded.

BCJ (branch/call/jump) filters in XZ will convert relative jumps into
absolute addresses to increase the redundancy. Since binary code has
plenty of relative jumps, this often improves compression ratio of .xz.
Preliminary test shows an improvement of 2% in the compression ratio
when compressing ELF files, which is already around 25% compression
ratio when using xz.

This patch enables the BCJ for x86, arm and thumb code filters (the
actual data being compressed, not the supported architectures where
the filter can run). This increases the size of the .a in ~12 KiB.

Bug: 27817327
TEST=Used xz-embedded to decompress a file compressed with `xz --x86 --lzma2`

(cherry picked from commit 20e8a04716ec9eca8ea5aa4788f0cbf69a7f6842)

Change-Id: Icbfc05b711675ce26b4362218026abdcc22f368f
diff --git a/xz-embedded/Android.mk b/xz-embedded/Android.mk
index 6782b24..20dd88f 100644
--- a/xz-embedded/Android.mk
+++ b/xz-embedded/Android.mk
@@ -2,14 +2,20 @@
 #
 LOCAL_PATH := $(call my-dir)
 
+xz_embedded_sources := \
+    xz_crc32.c \
+    xz_dec_bcj.c \
+    xz_dec_lzma2.c \
+    xz_dec_stream.c
+
 include $(CLEAR_VARS)
 LOCAL_MODULE := libxz
-LOCAL_SRC_FILES := xz_crc32.c xz_dec_lzma2.c xz_dec_stream.c
+LOCAL_SRC_FILES := $(xz_embedded_sources)
 LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
 include $(BUILD_STATIC_LIBRARY)
 
 include $(CLEAR_VARS)
 LOCAL_MODULE := libxz-host
-LOCAL_SRC_FILES := xz_crc32.c xz_dec_lzma2.c xz_dec_stream.c
+LOCAL_SRC_FILES := $(xz_embedded_sources)
 LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
 include $(BUILD_HOST_STATIC_LIBRARY)
diff --git a/xz-embedded/xz_config.h b/xz-embedded/xz_config.h
index eb9dac1..8b88c52 100644
--- a/xz-embedded/xz_config.h
+++ b/xz-embedded/xz_config.h
@@ -14,11 +14,11 @@
 /* #define XZ_USE_CRC64 */
 
 /* Uncomment as needed to enable BCJ filter decoders. */
-/* #define XZ_DEC_X86 */
+#define XZ_DEC_X86
 /* #define XZ_DEC_POWERPC */
 /* #define XZ_DEC_IA64 */
-/* #define XZ_DEC_ARM */
-/* #define XZ_DEC_ARMTHUMB */
+#define XZ_DEC_ARM
+#define XZ_DEC_ARMTHUMB
 /* #define XZ_DEC_SPARC */
 
 /*