Ticket #15366: gcc-4.7.3.p1.diff
File gcc-4.7.3.p1.diff, 2.7 KB (added by , 9 years ago) |
---|
-
SPKG.txt
diff --git a/SPKG.txt b/SPKG.txt
a b 28 28 * Lots of stuff can be removed, run ./spkg-src to do this automatically 29 29 (after downloading the sources). 30 30 31 === Patches === 32 * cyggcc_s.patch: fix a bug in cyggcc_s.dll on Cygwin. 33 31 34 == Changelog == 32 35 36 === gcc-4.7.3.p1 (Jean-Pierre Flori, 6 November 2013) === 37 * Trac #15366: fix a bug in cyggcc_s.dll on Cygwin. 38 * Taken from http://cygwin.com/ml/cygwin/2013-07/msg00528.html. 39 40 === gcc-4.7.3.p0 (Jeroen Demeyer, 11 April 2013) === 41 * Trac #14441: upgrade to version 4.7.3. 42 33 43 === gcc-4.7.3.p0 (Jeroen Demeyer, 11 April 2013) === 34 44 * Trac #14441: upgrade to version 4.7.3. 35 45 -
new file patches/cyggcc_s.patch
diff --git a/patches/cyggcc_s.patch b/patches/cyggcc_s.patch new file mode 100644
- + 1 diff -druN src.orig/libgcc/config/i386/cygming-crtbegin.c src/libgcc/config/i386/cygming-crtbegin.c 2 --- src.orig/libgcc/config/i386/cygming-crtbegin.c 2013-11-07 17:00:39.331879751 +0100 3 +++ src/libgcc/config/i386/cygming-crtbegin.c 2013-11-05 15:12:02.000000000 +0100 4 @@ -82,6 +82,8 @@ 5 extern void __gcc_register_frame (void); 6 extern void __gcc_deregister_frame (void); 7 8 +static HANDLE libgcc_dll; 9 + 10 void 11 __gcc_register_frame (void) 12 { 13 @@ -94,8 +96,11 @@ 14 void (*register_frame_fn) (const void *, struct object *); 15 HANDLE h = GetModuleHandle (LIBGCC_SONAME); 16 if (h) 17 + { 18 + libgcc_dll = LoadLibrary(LIBGCC_SONAME); 19 register_frame_fn = (void (*) (const void *, struct object *)) 20 GetProcAddress (h, "__register_frame_info"); 21 + } 22 else 23 register_frame_fn = __register_frame_info; 24 if (register_frame_fn) 25 @@ -124,13 +129,14 @@ 26 { 27 #if DWARF2_UNWIND_INFO 28 void * (*deregister_frame_fn) (const void *); 29 - HANDLE h = GetModuleHandle (LIBGCC_SONAME); 30 - if (h) 31 + if (libgcc_dll) 32 deregister_frame_fn = (void* (*) (const void *)) 33 - GetProcAddress (h, "__deregister_frame_info"); 34 + GetProcAddress (libgcc_dll, "__deregister_frame_info"); 35 else 36 deregister_frame_fn = __deregister_frame_info; 37 if (deregister_frame_fn) 38 deregister_frame_fn (__EH_FRAME_BEGIN__); 39 + if (libgcc_dll) 40 + FreeLibrary(libgcc_dll); 41 #endif 42 } -
spkg-install
diff --git a/spkg-install b/spkg-install
a b 10 10 # Exit on error 11 11 set -e 12 12 13 # Apply patches 14 cd src/ 15 16 echo "Applying patches to upstream sources..." 17 for patch in ../patches/*.patch; do 18 [ -r "$patch" ] || continue 19 patch -p1 <"$patch" 20 if [ $? -ne 0 ]; then 21 echo >&2 "Error: '$patch' failed to apply." 22 exit 1 23 fi 24 done 25 26 cd .. 27 13 28 # Build in a separate directory, not in src/ (a.k.a. a VPATH build). 14 29 # This is the recommended way to build GCC. 15 30 mkdir gcc-build