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
This commit is contained in:
Stephen Hines
2014-10-02 00:51:11 -07:00
parent 72f0cf56b3
commit a503fb3629

View File

@@ -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)