summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--1002-cygwin-ld-flags.patch24
-rw-r--r--cygwin-gcc.spec6
2 files changed, 29 insertions, 1 deletions
diff --git a/1002-cygwin-ld-flags.patch b/1002-cygwin-ld-flags.patch
new file mode 100644
index 0000000..ca9fdff
--- /dev/null
+++ b/1002-cygwin-ld-flags.patch
@@ -0,0 +1,24 @@
+diff -up gcc-11.2.0/gcc/config/i386/cygwin.h.dynamicbase gcc-11.2.0/gcc/config/i386/cygwin.h
+--- gcc-11.2.0/gcc/config/i386/cygwin.h.dynamicbase 2021-10-19 12:13:30.662685331 -0400
++++ gcc-11.2.0/gcc/config/i386/cygwin.h 2021-10-19 12:14:31.539839223 -0400
+@@ -138,7 +138,7 @@ along with GCC; see the file COPYING3.
+ %{shared: %{mdll: %eshared and mdll are not compatible}} \
+ %{shared: --shared} %{mdll:--dll} \
+ %{static:-Bstatic} %{!static:-Bdynamic} \
+- %{shared|mdll: --enable-auto-image-base -e __cygwin_dll_entry@12} \
++ %{shared|mdll: --disable-dynamicbase --enable-auto-image-base -e __cygwin_dll_entry@12} \
+ --dll-search-prefix=cyg \
+ %{rdynamic: --export-all-symbols} \
+ %{!shared: %{!mdll: --large-address-aware --tsaware}}"
+diff -up gcc-11.2.0/gcc/config/i386/cygwin-w64.h.dynamicbase gcc-11.2.0/gcc/config/i386/cygwin-w64.h
+--- gcc-11.2.0/gcc/config/i386/cygwin-w64.h.dynamicbase 2021-10-19 14:22:45.560706087 -0400
++++ gcc-11.2.0/gcc/config/i386/cygwin-w64.h 2021-10-19 14:23:17.766770713 -0400
+@@ -64,7 +64,7 @@ along with GCC; see the file COPYING3.
+ %{shared: %{mdll: %eshared and mdll are not compatible}} \
+ %{shared: --shared} %{mdll:--dll} \
+ %{static:-Bstatic} %{!static:-Bdynamic} \
+- %{shared|mdll: " SUB_LINK_ENTRY " --enable-auto-image-base} \
++ %{shared|mdll: " SUB_LINK_ENTRY " --disable-dynamicbase --enable-auto-image-base} \
+ %(shared_libgcc_undefs) \
+ --dll-search-prefix=cyg \
+ %{rdynamic: --export-all-symbols} \
diff --git a/cygwin-gcc.spec b/cygwin-gcc.spec
index 39c8e24..7dfb51a 100644
--- a/cygwin-gcc.spec
+++ b/cygwin-gcc.spec
@@ -5,7 +5,7 @@
%global gcc_micro 0
# Note, gcc_release must be integer, if you want to add suffixes to
# %%{release}, append them after %%{gcc_release} on Release: line.
-%global gcc_release 1
+%global gcc_release 2
Name: cygwin-gcc
Version: %{gcc_major}.%{gcc_minor}.%{gcc_micro}
@@ -54,6 +54,7 @@ Patch11: 0011-Cygwin-define-STD_UNIX.patch
# Fedora-specific patches
Patch1001: 1001-textdomain.patch
+Patch1002: 1002-cygwin-ld-flags.patch
# Upstream patches
#Patch2001: pr47030.patch
@@ -523,6 +524,9 @@ cat cygwin-cpplib.lang >> cygwin-gcc.lang
%changelog
+* Tue Oct 19 2021 Yaakov Selkowitz <yselkowi@redhat.com> - 11.2.0-2
+- Disable dynamicbase by default in DLLs
+
* Thu Sep 02 2021 Yaakov Selkowitz <yselkowi@redhat.com> - 11.2.0-1
- new version