diff --git a/core/soong_cc_prebuilt.mk b/core/soong_cc_prebuilt.mk index a0315a542..f98253d80 100644 --- a/core/soong_cc_prebuilt.mk +++ b/core/soong_cc_prebuilt.mk @@ -149,11 +149,14 @@ endif $(LOCAL_BUILT_MODULE): $(LOCAL_PREBUILT_MODULE_FILE) ifeq ($(LOCAL_IS_HOST_MODULE) $(if $(filter EXECUTABLES SHARED_LIBRARIES NATIVE_TESTS,$(LOCAL_MODULE_CLASS)),true,),true true) $(copy-or-link-prebuilt-to-target) + ifneq ($(filter EXECUTABLES NATIVE_TESTS,$(LOCAL_MODULE_CLASS)),) + [ -x $@ ] || $(call echo-error,$@,Target of symlink is not executable) + endif else $(transform-prebuilt-to-target) -endif -ifneq ($(filter EXECUTABLES NATIVE_TESTS,$(LOCAL_MODULE_CLASS)),) + ifneq ($(filter EXECUTABLES NATIVE_TESTS,$(LOCAL_MODULE_CLASS)),) $(hide) chmod +x $@ + endif endif ifndef LOCAL_IS_HOST_MODULE diff --git a/core/soong_rust_prebuilt.mk b/core/soong_rust_prebuilt.mk index b54f300ff..2f4c6e762 100644 --- a/core/soong_rust_prebuilt.mk +++ b/core/soong_rust_prebuilt.mk @@ -59,11 +59,14 @@ endif $(LOCAL_BUILT_MODULE): $(LOCAL_PREBUILT_MODULE_FILE) ifeq ($(LOCAL_IS_HOST_MODULE) $(if $(filter EXECUTABLES SHARED_LIBRARIES NATIVE_TESTS,$(LOCAL_MODULE_CLASS)),true,),true true) $(copy-or-link-prebuilt-to-target) + ifneq ($(filter EXECUTABLES NATIVE_TESTS,$(LOCAL_MODULE_CLASS)),) + [ -x $@ ] || $(call echo-error,$@,Target of symlink is not executable) + endif else $(transform-prebuilt-to-target) -endif -ifneq ($(filter EXECUTABLES NATIVE_TESTS,$(LOCAL_MODULE_CLASS)),) + ifneq ($(filter EXECUTABLES NATIVE_TESTS,$(LOCAL_MODULE_CLASS)),) $(hide) chmod +x $@ + endif endif ifndef LOCAL_IS_HOST_MODULE