From 5128702ed3ee97f1415315e69d2663539fc6a132 Mon Sep 17 00:00:00 2001 From: Stephen Hines Date: Mon, 11 Dec 2017 10:39:41 -0800 Subject: [PATCH] Switch to llvm-ar llvm-ar is required for platform LTO build. With GNU ar, we used crsPD flags, however 'P' flag is not supported by llvm-ar. Since none of the platform archive files are built using third party AR, the 'P' flag should not matter to us. However we've been relying on one side-effect of 'P', where 'ar foo.a some/path/to/obj.o' when foo.a already has a file named 'obj.o' will be an append operation, regardless whether the existing one is the same (ar has no way of telling the difference). We workaround this by always appending ('q' flag) for llvm-ar. This may result in larger intermediate archive files (more duplication) but will not affect the final build result. Bug: 71618641 Test: m checkbuild Change-Id: Id96a244cfe49cecfba08cc868dd18934ecb4ff23 --- core/aux_config.mk | 2 +- core/combo/select.mk | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/aux_config.mk b/core/aux_config.mk index c40b8cc7a2..41c14aef43 100644 --- a/core/aux_config.mk +++ b/core/aux_config.mk @@ -32,7 +32,7 @@ endif # setup AUX globals AUX_SHLIB_SUFFIX := .so -AUX_GLOBAL_ARFLAGS := crsPD +AUX_GLOBAL_ARFLAGS := cqsD AUX_STATIC_LIB_SUFFIX := .a # Load ever-lasting "indexed" version of AUX variant environment; it is treated as READ-ONLY from this diff --git a/core/combo/select.mk b/core/combo/select.mk index 5e181b9d81..94e37c652e 100644 --- a/core/combo/select.mk +++ b/core/combo/select.mk @@ -28,7 +28,7 @@ combo_var_prefix := $(combo_2nd_arch_prefix)$(combo_target) # Set reasonable defaults for the various variables -$(combo_var_prefix)GLOBAL_ARFLAGS := crsPD +$(combo_var_prefix)GLOBAL_ARFLAGS := cqsD $(combo_var_prefix)STATIC_LIB_SUFFIX := .a