summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Martin Stjernholm <mast@google.com> 2020-09-28 13:02:33 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2020-09-28 13:02:33 +0000
commit0de50208a30b822887738d602ac59f02c59ef33c (patch)
treec1496821b72c5f055a0dbe9b8eee7a50f64c1873
parentd31179920603509a6489f02656f31e4f3b67cdf3 (diff)
parent2cfce9380e5b8a6874d74abd3074ef0676ffcf1c (diff)
Merge "Do not chmod the symlink target when a prebuilt binary is symlinked."
-rw-r--r--core/soong_cc_prebuilt.mk7
-rw-r--r--core/soong_rust_prebuilt.mk7
2 files changed, 10 insertions, 4 deletions
diff --git a/core/soong_cc_prebuilt.mk b/core/soong_cc_prebuilt.mk
index 504984eab4..770408c159 100644
--- a/core/soong_cc_prebuilt.mk
+++ b/core/soong_cc_prebuilt.mk
@@ -150,11 +150,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 b54f300ff9..2f4c6e7622 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