diff options
author | Pirama Arumuga Nainar <pirama@google.com> | 2018-08-31 08:44:28 -0700 |
---|---|---|
committer | Pirama Arumuga Nainar <pirama@google.com> | 2018-08-31 10:57:47 -0700 |
commit | ef58803bb1c5f70d34705a4698b9a97851d430b1 (patch) | |
tree | 198a1688cfd9b5193dfd504d00a09c60eb5fb84b | |
parent | a74813a825e49267faa0b2ba45e9cd4bd6ccf4f4 (diff) | |
download | gcc-ef58803bb1c5f70d34705a4698b9a97851d430b1.tar.gz |
Build libgcc_s DLLs with additional linker flagsndk-r19cndk-r19bndk-r19-beta2ndk-r19-beta1ndk-r19ndk-release-r19
Bug: http://b/113171785
This hacked up change passes security-related linker flags for libgcc_s
DLLs. It should affect only Windows targets in gcc-4.8.3.
There doesn't seem a way to pass separate LDFLAGS for 32- and 64-bit
when running 'configure', so we'd end up without --high-entropy-va for
the 64-bit DLL. Instead, this hacky change gets the behavior we want
and is unlikely to regress. To be safe
https://android-review.googlesource.com/c/toolchain/mingw/+/743702 also
verifies that all DLLs built have the correct flags.
Test: toolchain/mingw/build.sh
Change-Id: I9d52e7b8cb449fcaf11c7f771761f11c7d35f99b
-rw-r--r-- | gcc-4.8.3/libgcc/config/i386/t-slibgcc-cygming | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc-4.8.3/libgcc/config/i386/t-slibgcc-cygming b/gcc-4.8.3/libgcc/config/i386/t-slibgcc-cygming index 6236c78e4..f5d43e264 100644 --- a/gcc-4.8.3/libgcc/config/i386/t-slibgcc-cygming +++ b/gcc-4.8.3/libgcc/config/i386/t-slibgcc-cygming @@ -28,12 +28,17 @@ ifndef SHLIB_PTHREAD_LDFLAG SHLIB_PTHREAD_LDFLAG = endif +SHLIB_LDFLAGS = -Wl,--dynamicbase -Wl,--nxcompat +ifeq (,$(findstring m32,$(CFLAGS))) +SHLIB_LDFLAGS += -Wl,--high-entropy-va +endif + SHLIB_LINK = $(LN_S) -f $(SHLIB_MAP) $(SHLIB_MAP).def && \ if [ ! -d $(SHLIB_DIR) ]; then \ mkdir $(SHLIB_DIR); \ else true; fi && \ $(CC) $(LIBGCC2_CFLAGS) $(SHLIB_PTHREAD_CFLAG) \ - -shared -nodefaultlibs \ + -shared -nodefaultlibs $(SHLIB_LDFLAGS) \ $(SHLIB_MAP).def \ -Wl,--out-implib,$(SHLIB_DIR)/$(SHLIB_IMPLIB).tmp \ -o $(SHLIB_DIR)/$(SHLIB_SONAME).tmp @multilib_flags@ \ |