Follow-up to -no-integrated-as change
The original change didn't follow the README. This must be added to the
makefile generation script.
Bug: 17820427
Change-Id: I25853ccbfe6cf87580bf5601b5d8834ea7b154c9
diff --git a/Apps-config-host.mk b/Apps-config-host.mk
index 5c1604e..4af5a76 100644
--- a/Apps-config-host.mk
+++ b/Apps-config-host.mk
@@ -74,30 +74,40 @@
external/openssl/. \
external/openssl/include \
+arm_clang_asflags :=
+
arm_cflags :=
arm_src_files :=
arm_exclude_files :=
+arm64_clang_asflags :=
+
arm64_cflags :=
arm64_src_files :=
arm64_exclude_files :=
+x86_clang_asflags :=
+
x86_cflags :=
x86_src_files :=
x86_exclude_files :=
+x86_64_clang_asflags :=
+
x86_64_cflags :=
x86_64_src_files :=
x86_64_exclude_files :=
+mips_clang_asflags :=
+
mips_cflags :=
mips_src_files :=
diff --git a/Apps-config-target.mk b/Apps-config-target.mk
index 0c567d4..697e56d 100644
--- a/Apps-config-target.mk
+++ b/Apps-config-target.mk
@@ -74,30 +74,40 @@
external/openssl/. \
external/openssl/include \
+arm_clang_asflags :=
+
arm_cflags :=
arm_src_files :=
arm_exclude_files :=
+arm64_clang_asflags :=
+
arm64_cflags :=
arm64_src_files :=
arm64_exclude_files :=
+x86_clang_asflags :=
+
x86_cflags :=
x86_src_files :=
x86_exclude_files :=
+x86_64_clang_asflags :=
+
x86_64_cflags :=
x86_64_src_files :=
x86_64_exclude_files :=
+mips_clang_asflags :=
+
mips_cflags :=
mips_src_files :=
@@ -110,15 +120,20 @@
LOCAL_SRC_FILES_arm += $(filter-out $(arm_exclude_files),$(common_src_files) $(arm_src_files))
LOCAL_CFLAGS_arm += $(arm_cflags)
+LOCAL_CLANG_ASFLAGS_arm += $(arm_clang_asflags)
LOCAL_SRC_FILES_arm64 += $(filter-out $(arm64_exclude_files),$(common_src_files) $(arm64_src_files))
LOCAL_CFLAGS_arm64 += $(arm64_cflags)
+LOCAL_CLANG_ASFLAGS_arm64 += $(arm64_clang_asflags)
LOCAL_SRC_FILES_x86 += $(filter-out $(x86_exclude_files),$(common_src_files) $(x86_src_files))
LOCAL_CFLAGS_x86 += $(x86_cflags)
+LOCAL_CLANG_ASFLAGS_x86 += $(x86_clang_asflags)
LOCAL_SRC_FILES_x86_64 += $(filter-out $(x86_64_exclude_files),$(common_src_files) $(x86_64_src_files))
LOCAL_CFLAGS_x86_64 += $(x86_64_cflags)
+LOCAL_CLANG_ASFLAGS_x86_64 += $(x86_64_clang_asflags)
LOCAL_SRC_FILES_mips += $(filter-out $(mips_exclude_files),$(common_src_files) $(mips_src_files))
LOCAL_CFLAGS_mips += $(mips_cflags)
+LOCAL_CLANG_ASFLAGS_mips += $(mips_clang_asflags)
diff --git a/Crypto-config-host.mk b/Crypto-config-host.mk
index 5b64379..0c4876e 100644
--- a/Crypto-config-host.mk
+++ b/Crypto-config-host.mk
@@ -540,6 +540,9 @@
external/openssl/include \
external/openssl/include/openssl \
+arm_clang_asflags := \
+ -no-integrated-as \
+
arm_cflags := \
-DAES_ASM \
-DBSAES_ASM \
@@ -570,6 +573,9 @@
crypto/aes/aes_core.c \
crypto/mem_clr.c \
+arm64_clang_asflags := \
+ -no-integrated-as \
+
arm64_cflags := \
-DDES_UNROLL \
-DOPENSSL_CPUID_OBJ \
@@ -588,6 +594,8 @@
arm64_exclude_files :=
+x86_clang_asflags :=
+
x86_cflags := \
-DAES_ASM \
-DDES_PTR \
@@ -634,6 +642,8 @@
crypto/des/fcrypt_b.c \
crypto/mem_clr.c \
+x86_64_clang_asflags :=
+
x86_64_cflags := \
-DAES_ASM \
-DBSAES_ASM \
@@ -678,6 +688,8 @@
crypto/rc4/rc4_enc.c \
crypto/rc4/rc4_skey.c \
+mips_clang_asflags :=
+
mips_cflags := \
-DAES_ASM \
-DOPENSSL_BN_ASM_MONT \
diff --git a/Crypto-config-target.mk b/Crypto-config-target.mk
index 2dbfd37..9b38956 100644
--- a/Crypto-config-target.mk
+++ b/Crypto-config-target.mk
@@ -540,6 +540,9 @@
external/openssl/include \
external/openssl/include/openssl \
+arm_clang_asflags := \
+ -no-integrated-as \
+
arm_cflags := \
-DAES_ASM \
-DBSAES_ASM \
@@ -570,6 +573,9 @@
crypto/aes/aes_core.c \
crypto/mem_clr.c \
+arm64_clang_asflags := \
+ -no-integrated-as \
+
arm64_cflags := \
-DDES_UNROLL \
-DOPENSSL_CPUID_OBJ \
@@ -588,6 +594,8 @@
arm64_exclude_files :=
+x86_clang_asflags :=
+
x86_cflags := \
-DAES_ASM \
-DDES_PTR \
@@ -634,6 +642,8 @@
crypto/des/fcrypt_b.c \
crypto/mem_clr.c \
+x86_64_clang_asflags :=
+
x86_64_cflags := \
-DAES_ASM \
-DBSAES_ASM \
@@ -678,6 +688,8 @@
crypto/rc4/rc4_enc.c \
crypto/rc4/rc4_skey.c \
+mips_clang_asflags :=
+
mips_cflags := \
-DAES_ASM \
-DOPENSSL_BN_ASM_MONT \
@@ -695,25 +707,26 @@
crypto/aes/aes_core.c \
crypto/bn/bn_asm.c \
-# At least crypto/aes/asm/bsaes-armv7.S does not compile with Clang
-LOCAL_CLANG_ASFLAGS_arm += -no-integrated-as
-# crypto/aes/asm/aesv8-armx-64.S failed to compile.
-LOCAL_CLANG_ASFLAGS_arm64 += -no-integrated-as
LOCAL_CFLAGS += $(common_cflags)
LOCAL_C_INCLUDES += $(common_c_includes)
LOCAL_SRC_FILES_arm += $(filter-out $(arm_exclude_files),$(common_src_files) $(arm_src_files))
LOCAL_CFLAGS_arm += $(arm_cflags)
+LOCAL_CLANG_ASFLAGS_arm += $(arm_clang_asflags)
LOCAL_SRC_FILES_arm64 += $(filter-out $(arm64_exclude_files),$(common_src_files) $(arm64_src_files))
LOCAL_CFLAGS_arm64 += $(arm64_cflags)
+LOCAL_CLANG_ASFLAGS_arm64 += $(arm64_clang_asflags)
LOCAL_SRC_FILES_x86 += $(filter-out $(x86_exclude_files),$(common_src_files) $(x86_src_files))
LOCAL_CFLAGS_x86 += $(x86_cflags)
+LOCAL_CLANG_ASFLAGS_x86 += $(x86_clang_asflags)
LOCAL_SRC_FILES_x86_64 += $(filter-out $(x86_64_exclude_files),$(common_src_files) $(x86_64_src_files))
LOCAL_CFLAGS_x86_64 += $(x86_64_cflags)
+LOCAL_CLANG_ASFLAGS_x86_64 += $(x86_64_clang_asflags)
LOCAL_SRC_FILES_mips += $(filter-out $(mips_exclude_files),$(common_src_files) $(mips_src_files))
LOCAL_CFLAGS_mips += $(mips_cflags)
+LOCAL_CLANG_ASFLAGS_mips += $(mips_clang_asflags)
diff --git a/Crypto-config-trusty.mk b/Crypto-config-trusty.mk
index 5991598..82f73bd 100644
--- a/Crypto-config-trusty.mk
+++ b/Crypto-config-trusty.mk
@@ -199,6 +199,8 @@
external/openssl/include \
external/openssl/include/openssl \
+arm_clang_asflags :=
+
arm_cflags := \
-DAES_ASM \
-DGHASH_ASM \
@@ -218,24 +220,32 @@
arm_exclude_files :=
+arm64_clang_asflags :=
+
arm64_cflags :=
arm64_src_files :=
arm64_exclude_files :=
+x86_clang_asflags :=
+
x86_cflags :=
x86_src_files :=
x86_exclude_files :=
+x86_64_clang_asflags :=
+
x86_64_cflags :=
x86_64_src_files :=
x86_64_exclude_files :=
+mips_clang_asflags :=
+
mips_cflags :=
mips_src_files :=
@@ -248,15 +258,20 @@
LOCAL_SRC_FILES_arm += $(filter-out $(arm_exclude_files),$(common_src_files) $(arm_src_files))
LOCAL_CFLAGS_arm += $(arm_cflags)
+LOCAL_CLANG_ASFLAGS_arm += $(arm_clang_asflags)
LOCAL_SRC_FILES_arm64 += $(filter-out $(arm64_exclude_files),$(common_src_files) $(arm64_src_files))
LOCAL_CFLAGS_arm64 += $(arm64_cflags)
+LOCAL_CLANG_ASFLAGS_arm64 += $(arm64_clang_asflags)
LOCAL_SRC_FILES_x86 += $(filter-out $(x86_exclude_files),$(common_src_files) $(x86_src_files))
LOCAL_CFLAGS_x86 += $(x86_cflags)
+LOCAL_CLANG_ASFLAGS_x86 += $(x86_clang_asflags)
LOCAL_SRC_FILES_x86_64 += $(filter-out $(x86_64_exclude_files),$(common_src_files) $(x86_64_src_files))
LOCAL_CFLAGS_x86_64 += $(x86_64_cflags)
+LOCAL_CLANG_ASFLAGS_x86_64 += $(x86_64_clang_asflags)
LOCAL_SRC_FILES_mips += $(filter-out $(mips_exclude_files),$(common_src_files) $(mips_src_files))
LOCAL_CFLAGS_mips += $(mips_cflags)
+LOCAL_CLANG_ASFLAGS_mips += $(mips_clang_asflags)
diff --git a/Ssl-config-host.mk b/Ssl-config-host.mk
index 57ea377..e6b8221 100644
--- a/Ssl-config-host.mk
+++ b/Ssl-config-host.mk
@@ -68,30 +68,40 @@
external/openssl/crypto \
external/openssl/include \
+arm_clang_asflags :=
+
arm_cflags :=
arm_src_files :=
arm_exclude_files :=
+arm64_clang_asflags :=
+
arm64_cflags :=
arm64_src_files :=
arm64_exclude_files :=
+x86_clang_asflags :=
+
x86_cflags :=
x86_src_files :=
x86_exclude_files :=
+x86_64_clang_asflags :=
+
x86_64_cflags :=
x86_64_src_files :=
x86_64_exclude_files :=
+mips_clang_asflags :=
+
mips_cflags :=
mips_src_files :=
diff --git a/Ssl-config-target.mk b/Ssl-config-target.mk
index b39e329..4afe096 100644
--- a/Ssl-config-target.mk
+++ b/Ssl-config-target.mk
@@ -68,30 +68,40 @@
external/openssl/crypto \
external/openssl/include \
+arm_clang_asflags :=
+
arm_cflags :=
arm_src_files :=
arm_exclude_files :=
+arm64_clang_asflags :=
+
arm64_cflags :=
arm64_src_files :=
arm64_exclude_files :=
+x86_clang_asflags :=
+
x86_cflags :=
x86_src_files :=
x86_exclude_files :=
+x86_64_clang_asflags :=
+
x86_64_cflags :=
x86_64_src_files :=
x86_64_exclude_files :=
+mips_clang_asflags :=
+
mips_cflags :=
mips_src_files :=
@@ -104,15 +114,20 @@
LOCAL_SRC_FILES_arm += $(filter-out $(arm_exclude_files),$(common_src_files) $(arm_src_files))
LOCAL_CFLAGS_arm += $(arm_cflags)
+LOCAL_CLANG_ASFLAGS_arm += $(arm_clang_asflags)
LOCAL_SRC_FILES_arm64 += $(filter-out $(arm64_exclude_files),$(common_src_files) $(arm64_src_files))
LOCAL_CFLAGS_arm64 += $(arm64_cflags)
+LOCAL_CLANG_ASFLAGS_arm64 += $(arm64_clang_asflags)
LOCAL_SRC_FILES_x86 += $(filter-out $(x86_exclude_files),$(common_src_files) $(x86_src_files))
LOCAL_CFLAGS_x86 += $(x86_cflags)
+LOCAL_CLANG_ASFLAGS_x86 += $(x86_clang_asflags)
LOCAL_SRC_FILES_x86_64 += $(filter-out $(x86_64_exclude_files),$(common_src_files) $(x86_64_src_files))
LOCAL_CFLAGS_x86_64 += $(x86_64_cflags)
+LOCAL_CLANG_ASFLAGS_x86_64 += $(x86_64_clang_asflags)
LOCAL_SRC_FILES_mips += $(filter-out $(mips_exclude_files),$(common_src_files) $(mips_src_files))
LOCAL_CFLAGS_mips += $(mips_cflags)
+LOCAL_CLANG_ASFLAGS_mips += $(mips_clang_asflags)
diff --git a/import_openssl.sh b/import_openssl.sh
index f16596b..dc4049c 100755
--- a/import_openssl.sh
+++ b/import_openssl.sh
@@ -439,6 +439,9 @@
print_vardef_with_prefix_in_mk common_c_includes external/openssl/ $common_includes
for arch in $all_archs; do
+ arch_clang_asflags=$(var_sorted_value OPENSSL_${prefix}_CLANG_ASFLAGS_${arch})
+ print_vardef_in_mk ${arch}_clang_asflags $arch_clang_asflags
+
arch_defines=$(var_sorted_value OPENSSL_${prefix}_DEFINES_${arch})
print_defines_in_mk ${arch}_cflags $arch_defines
@@ -457,7 +460,8 @@
for arch in $all_archs; do
echo "
LOCAL_SRC_FILES_${arch} += \$(filter-out \$(${arch}_exclude_files),\$(common_src_files) \$(${arch}_src_files))
-LOCAL_CFLAGS_${arch} += \$(${arch}_cflags)"
+LOCAL_CFLAGS_${arch} += \$(${arch}_cflags)
+LOCAL_CLANG_ASFLAGS_${arch} += \$(${arch}_clang_asflags)"
done
else
echo "
diff --git a/openssl.config b/openssl.config
index 867711f..4673158 100644
--- a/openssl.config
+++ b/openssl.config
@@ -237,6 +237,10 @@
NO_WINDOWS_BRAINDEATH \
"
+OPENSSL_CRYPTO_CLANG_ASFLAGS_arm="\
+-no-integrated-as \
+"
+
OPENSSL_CRYPTO_DEFINES_arm="\
AES_ASM \
BSAES_ASM \
@@ -250,6 +254,10 @@
SHA512_ASM \
"
+OPENSSL_CRYPTO_CLANG_ASFLAGS_arm64="\
+-no-integrated-as \
+"
+
OPENSSL_CRYPTO_DEFINES_arm64="\
DES_UNROLL \
OPENSSL_CPUID_OBJ \