summaryrefslogtreecommitdiffstats
path: root/1002-cygwin-ld-flags.patch
diff options
context:
space:
mode:
authorYaakov Selkowitz <yselkowi@redhat.com>2021-10-19 15:18:01 -0400
committerYaakov Selkowitz <yselkowi@redhat.com>2021-10-19 15:18:01 -0400
commit73702990470f5d795ee6e0866e341998d5857d3c (patch)
tree07b5f25f7a8ee3624fab486c33d71df47268d778 /1002-cygwin-ld-flags.patch
parent041920c9533fad4a517fe6f268ebbd3af2a903a7 (diff)
downloadcygwin-gcc-main.tar.gz
cygwin-gcc-main.tar.xz
cygwin-gcc-main.zip
Pass --disable-dynamicbase to ldHEADmain
The following commit (erroneously) enabled dynamicbase by default for all PE binaries: https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=514b4e191d5f46de8e142fe216e677a35fa9c4bb But that messes up fork() and rebase on Cygwin, which rely on DLLs having static (but editable) bases.
Diffstat (limited to '1002-cygwin-ld-flags.patch')
-rw-r--r--1002-cygwin-ld-flags.patch24
1 files changed, 24 insertions, 0 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} \