summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYaakov Selkowitz <yselkowitz@users.sourceforge.net>2014-07-25 11:29:28 -0500
committerYaakov Selkowitz <yselkowitz@users.sourceforge.net>2014-07-25 11:29:28 -0500
commitcd116f01a90082574f078c06fb2d94ebbaa24711 (patch)
treeaace1627a97d5eb8c9ae72f75714c43a77219db2
parent5d80c3587d8536202933a341e1039b583bb71554 (diff)
downloadcygwin-gcc-cd116f01a90082574f078c06fb2d94ebbaa24711.tar.gz
cygwin-gcc-cd116f01a90082574f078c06fb2d94ebbaa24711.tar.xz
cygwin-gcc-cd116f01a90082574f078c06fb2d94ebbaa24711.zip
Add patch to fix libgcc deregistration on x86
-rw-r--r--cygwin-gcc.spec7
-rw-r--r--gcc48-libgcc-deregister.patch61
2 files changed, 67 insertions, 1 deletions
diff --git a/cygwin-gcc.spec b/cygwin-gcc.spec
index faff5fb..6eaa364 100644
--- a/cygwin-gcc.spec
+++ b/cygwin-gcc.spec
@@ -7,7 +7,7 @@
%global gcc_version %{gcc_major}.%{gcc_minor}.%{gcc_micro}
# 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
%global build_ada 0
# building cross-gnat requires matching X.Y version of native gnat
@@ -60,6 +60,7 @@ Patch19: gcc48-lto-plugin-soname.patch
Patch21: gcc48-libatomic-cygwin.patch
Patch23: gcc48-Wimplicit-decls.patch
Patch24: gcc49-default-manifest.patch
+Patch25: gcc48-libgcc-deregister.patch
%description
@@ -196,6 +197,7 @@ Cygwin cross-compiler for Ada.
%patch21 -p2
%patch23 -p2
%patch24 -p0
+%patch25 -p0
echo %{gcc_version} > gcc/BASE-VER
echo 'Fedora Cygwin %{gcc_version}-%{gcc_release}' > gcc/DEV-PHASE
@@ -413,6 +415,9 @@ rm -rf $RPM_BUILD_ROOT
%changelog
+* Fri Jul 25 2014 Yaakov Selkowitz <yselkowitz@cygwin.com> - 4.8.3-2
+- Add patch to fix libgcc deregistration on x86
+
* Tue Jun 10 2014 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> - 4.8.3-1
- Version bump.
- Remove java support (dropped from F21/EL7).
diff --git a/gcc48-libgcc-deregister.patch b/gcc48-libgcc-deregister.patch
new file mode 100644
index 0000000..23b2958
--- /dev/null
+++ b/gcc48-libgcc-deregister.patch
@@ -0,0 +1,61 @@
+Index: libgcc/config/i386/cygming-crtbegin.c
+===================================================================
+--- libgcc/config/i386/cygming-crtbegin.c (revision 212546)
++++ libgcc/config/i386/cygming-crtbegin.c (working copy)
+@@ -99,12 +99,13 @@ static EH_FRAME_SECTION_CONST char __EH_
+ = { };
+
+ static struct object obj;
+
+ /* Handle of libgcc's DLL reference. */
+ HANDLE hmod_libgcc;
++static void * (*deregister_frame_fn) (const void *) = NULL;
+ #endif
+
+ #if TARGET_USE_JCR_SECTION
+ static void *__JCR_LIST__[]
+ __attribute__ ((used, section(JCR_SECTION_NAME), aligned(4)))
+ = { };
+@@ -130,15 +131,20 @@ __gcc_register_frame (void)
+ if (h)
+ {
+ /* Increasing the load-count of LIBGCC_SONAME DLL. */
+ hmod_libgcc = LoadLibrary (LIBGCC_SONAME);
+ register_frame_fn = (void (*) (const void *, struct object *))
+ GetProcAddress (h, "__register_frame_info");
++ deregister_frame_fn = (void* (*) (const void *))
++ GetProcAddress (h, "__deregister_frame_info");
++ }
++ else
++ {
++ register_frame_fn = __register_frame_info;
++ deregister_frame_fn = __deregister_frame_info;
+ }
+- else
+- register_frame_fn = __register_frame_info;
+ if (register_frame_fn)
+ register_frame_fn (__EH_FRAME_BEGIN__, &obj);
+ #endif
+
+ #if TARGET_USE_JCR_SECTION
+ if (__JCR_LIST__[0])
+@@ -158,19 +164,12 @@ __gcc_register_frame (void)
+ }
+
+ void
+ __gcc_deregister_frame (void)
+ {
+ #if DWARF2_UNWIND_INFO
+- void * (*deregister_frame_fn) (const void *);
+- HANDLE h = GetModuleHandle (LIBGCC_SONAME);
+- if (h)
+- deregister_frame_fn = (void* (*) (const void *))
+- GetProcAddress (h, "__deregister_frame_info");
+- else
+- deregister_frame_fn = __deregister_frame_info;
+ if (deregister_frame_fn)
+ deregister_frame_fn (__EH_FRAME_BEGIN__);
+ if (hmod_libgcc)
+ FreeLibrary (hmod_libgcc);
+ #endif
+ }