aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Hines <srhines@google.com>2014-10-02 00:51:11 -0700
committerStephen Hines <srhines@google.com>2014-10-02 00:57:09 -0700
commita503fb362918363b28637b487eba83e9ad647ceb (patch)
tree9f3573ff67026fbc0955e2889a42033beab3aace
parent72f0cf56b362b8a4b6cfefb3f47240aa9e2d5ce6 (diff)
downloadbuild-a503fb362918363b28637b487eba83e9ad647ceb.tar.gz
PIE executables created with mingw use "mainCRTStartup" as their entry point.
Bug: 14416410 Our linker uses "start" as the primary entry point, so we need to adjust this for mingw-based Windows compiles, or nothing will execute correctly. Change-Id: I6e99f43e075ef9f00500099ce34ec4425c996454
-rw-r--r--core/definitions.mk4
1 files changed, 4 insertions, 0 deletions
diff --git a/core/definitions.mk b/core/definitions.mk
index d7d8b25e9c..38aa72066f 100644
--- a/core/definitions.mk
+++ b/core/definitions.mk
@@ -1414,6 +1414,10 @@ ifdef BUILD_HOST_static
HOST_FPIE_FLAGS :=
else
HOST_FPIE_FLAGS := -pie
+# Force the correct entry point to workaround a bug in binutils that manifests with -pie
+ifeq ($(HOST_OS),windows)
+HOST_FPIE_FLAGS += -Wl,-e_mainCRTStartup
+endif
endif
ifneq ($(HOST_CUSTOM_LD_COMMAND),true)