[SCM] Emulator of the Super Nintendo Entertainment System (TM) branch, fortify, updated. debian/1.510+bz2-4-11-g8183446

Fabian Greffrath fabian+debian at greffrath.com
Mon Sep 10 09:30:34 UTC 2012


The following commit has been merged in the fortify branch:
commit 818344623c370a72b956b522c17f8f45406fc78b
Merge: 5851a5001c6bb724651c71e3e466d6a57a80f346 92ef1f4ef2ec38d1c1731dd3e01b63c8eaf85c1d
Author: Fabian Greffrath <fabian+debian at greffrath.com>
Date:   Mon Sep 10 11:34:11 2012 +0200

    Merge master and simplify patches.

diff --combined debian/changelog
index 9b55a7b,a0ed6db..7acbdcd
--- a/debian/changelog
+++ b/debian/changelog
@@@ -1,16 -1,30 +1,32 @@@
- zsnes (1.510+bz2-7) unstable; urgency=low
+ zsnes (1.510+bz2-5) UNRELEASED; urgency=low
+ 
+   [ Fabian Greffrath ]
+   * 0001-gcc-fno-rtti.patch: Removed, one less deviation from upstream.
+   * 0002-replace_crc32.patch: Removed, not actually needed at all.
+   * 0013-Fix-sound-with-libao.patch: Replace with the actual patch from
+     upstream SVN.
+   * 0014-Initialize-driver_format.matrix-with-NULL.patch: Only keep the
+     memset() part as discussed with upstream author Nach on the ZSNES board.
+   * Set Architecture: any-i386.
++  * Add CPPFLAGS to CFLAGS and CXXFLAGS to enable full hardening flags.
++  * fortify-source.patch: New patch to fix compilation with FORTIFY_SOURCE.
+ 
+   [ Etienne Millon ]
+   * Fix crashes on resume : use int64s instead of floats in sem_GetTicks().
+     Thanks to Ian Munsie. (Closes: #687107)
+ 
+  -- Fabian Greffrath <fabian+debian at greffrath.com>  Wed, 18 Jul 2012 11:04:28 +0200
+ 
+ zsnes (1.510+bz2-4) unstable; urgency=low
  
    [ Etienne Millon ]
    * Disable build on amd64 (Closes: #679526)
      - Add Multi-Arch: Foreign
-   * Add patch to initialize the ao_sample_format structure
-     (thanks to Fabian Greffrath & Goswin von Brederlow - Closes: #679826)
    * debian/compat : use level 9 compatibility level
    * debian/rules :
      - use find -delete instead of command expansion
      - use dpkg-buildflags
      - add -Wl,--as-needed to LDFLAGS (Closes: #607311)
-   * Install high-res PNG icons provided with the sources (Closes: #680078)
  
    [ Eshat Cakar ]
    * Improve zsnes.desktop file, thanks to Fabian Greffrath (Closes: #680054)
@@@ -19,15 -33,11 +35,11 @@@
    * Add myself to Uploaders.
    * 0001-gcc-fno-rtti.patch: Patch src/configure.in instead of the
      auto-generated src/configure.
-   * Append CPPFLAGS to CFLAGS and CXXFLAGS to enable "-D_FORTIFY_SOURCE=2".
-   * 0015-fortify-source.patch: New patch from RPM Fusion by Hans de Goede
-     to fix compilation with "-D_FORTIFY_SOURCE=2" (LP: #250425).
-   * 0016-parsegen.patch: Another patch from RPM Fusion by Ralf Corsepius
-     to create an intermediate .c file instead of an .o file with parsegen,
-     also needed to fix compilation with "-D_FORTIFY_SOURCE=2".
-   * debian/clean: Remove the intermediate .c files in the clean rule.
- 
-  -- Etienne Millon <etienne.millon at gmail.com>  Fri, 29 Jun 2012 17:37:53 +0200
+   * Add patch to initialize the ao_sample_format structure
+     (thanks also to Goswin von Brederlow - Closes: #679826)
+   * Install high-res PNG icons provided with the sources (Closes: #680078)
+ 
+  -- Etienne Millon <etienne.millon at gmail.com>  Fri, 06 Jul 2012 08:27:08 +0200
  
  zsnes (1.510+bz2-3) unstable; urgency=low
  
diff --combined debian/patches/fortify-source.patch
index 402da7d,0000000..b83d0d0
mode 100644,000000..100644
--- a/debian/patches/fortify-source.patch
+++ b/debian/patches/fortify-source.patch
@@@ -1,122 -1,0 +1,100 @@@
- Author: Hans de Goede
++Subject: Fix compilation with FORTIFY_SOURCE.
 +Origin: http://cvs.rpmfusion.org/viewvc/rpms/zsnes/devel/zsnes-1.51-FORTIFY_SOURCE.patch?root=free&view=markup
 +Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/intrepid/+source/zsnes/+bug/250425
- Subject: Upstream has strange memory manipulations that upset FORTIFY_SOURCE
-  The problem is an interaction between the uncommon (to put it mildly) way
-  zsnes calls memcpy to restore its global state from the "regsbackup" buffer,
-  and _FORTIFY_SOURCE:
-  .
-  gcc -ggdb3 -pipe -I. -I/usr/local/include -I/usr/include -D__UNIXSDL__
-  -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -DNO_DEBUGGER -D__LIBAO__
-  -D__OPENGL__ -march=i486 -O3 -fomit-frame-pointer -fprefetch-loop-arrays
-  -fforce-addr -s -D__RELEASE__ -o initc.o -c initc.c
-  [...]
-  In function ‘memcpy’,
-     inlined from ‘powercycle’ at initc.c:2624:
-  /usr/include/bits/string3.h:52: warning: call to __builtin___memcpy_chk will
-  always overflow destination buffer
-  .
-  The corresponding block of code is:
-  .
-     sramsavedis = 0;
-     memcpy(&sndrot, regsbackup, 3019);
-  .
-  And the declaration for the relevant variables, from the same file:
-  .
-  extern unsigned char NextLineCache, sramsavedis, sndrot, regsbackup[3019];
-  .
-  The reason this strange memcpy call will always work correctly is that the
-  storage for sndrot and the rest of the state variables is allocated in
-  assembly (cpu/regs.inc, included from cpu/table.asm), in a way which
-  guarantees that all the correct variables will be sequential in memory, with
-  no padding (sndrot is just the first variable on that block). However, gcc
-  cannot know that; it sees instead an attempt to write 3019 bytes to a single
-  byte-sized variable, which will obviously overflow (and, in fact, overflowing
-  is precisely the desired behaviour!).
-  <https://bugs.launchpad.net/ubuntu/intrepid/+source/zsnes/+bug/250425/comments/45>
 +
 +--- a/src/initc.c
 ++++ b/src/initc.c
 +@@ -1464,8 +1464,8 @@ void clearmem()
 +   clearmem2();
 + }
 + 
 +-extern unsigned char BRRBuffer[32];
 +-extern unsigned char echoon0;
 ++extern unsigned char BRRBuffer[];
 ++extern unsigned char echoon0[];
 + extern unsigned int PHdspsave;
 + extern unsigned int PHdspsave2;
 + unsigned char echobuf[90000];
 +@@ -1479,7 +1479,7 @@ void clearvidsound()
 +   memset(vidmemch4, 0, 4096);
 +   memset(vidmemch8, 0, 4096);
 +   memset(BRRBuffer, 0, PHdspsave);
 +-  memset(&echoon0, 0, PHdspsave2);
 ++  memset(echoon0, 0, PHdspsave2);
 +   memset(echobuf, 0, 90000);
 +   memset(spcBuffera, 0, 65536*4+4096);
 +   memset(DSPMem, 0, 256);
 +@@ -1822,7 +1822,7 @@ unsigned int showinfogui()
 + 
 + extern unsigned int nmiprevaddrl, nmiprevaddrh, nmirept, nmiprevline, nmistatus;
 + extern unsigned char spcnumread, yesoutofmemory;
 +-extern unsigned char NextLineCache, sramsavedis, sndrot, regsbackup[3019];
 ++extern unsigned char NextLineCache, sramsavedis, sndrot[], regsbackup[3019];
 + extern unsigned int Voice0Freq, Voice1Freq, Voice2Freq, Voice3Freq;
 + extern unsigned int Voice4Freq, Voice5Freq, Voice6Freq, Voice7Freq;
 + extern unsigned int dspPAdj;
 +@@ -2621,7 +2621,7 @@ void powercycle(bool sramload, bool roml
 +     }
 + 
 +     sramsavedis = 0;
 +-    memcpy(&sndrot, regsbackup, 3019);
 ++    memcpy(sndrot, regsbackup, 3019);
 + 
 +     if (yesoutofmemory) { asm_call(outofmemfix); }
 +     asm_call(GUIDoReset);
 +--- a/src/zstate.c
 ++++ b/src/zstate.c
 +@@ -99,15 +99,15 @@ static void copy_snes_data(unsigned char
 +   copy_func(buffer, &cycpbl, 4);
 +   copy_func(buffer, &cycpblt, 4);
 +   //SNES PPU Register status
 +-  copy_func(buffer, &sndrot, 3019);
 ++  copy_func(buffer, sndrot, 3019);
 + }
 + 
 + static void copy_spc_data(unsigned char **buffer, void (*copy_func)(unsigned char **, void *, size_t))
 + {
 +   //SPC stuff, DSP stuff
 +   copy_func(buffer, SPCRAM, PHspcsave);
 +-  copy_func(buffer, &BRRBuffer, PHdspsave);
 +-  copy_func(buffer, &DSPMem, sizeof(DSPMem));
 ++  copy_func(buffer, BRRBuffer, PHdspsave);
 ++  copy_func(buffer, DSPMem, sizeof(DSPMem));
 + }
 + 
 + static void copy_extra_data(unsigned char **buffer, void (*copy_func)(unsigned char **, void *, size_t))
 +@@ -156,7 +156,7 @@ static void copy_state_data(unsigned cha
 +     /*
 +     if (buffer) //Rewind stuff
 +     {
 +-      copy_func(&buffer, &echoon0, PHdspsave2);
 ++      copy_func(&buffer, echoon0, PHdspsave2);
 +     }
 +     */
 +   }
 +--- a/src/gblvars.h
 ++++ b/src/gblvars.h
 +@@ -33,9 +33,9 @@ extern unsigned int nmirept, nmiprevline
 + extern unsigned int SfxR0, *setaramdata, ramsize, *sram, nmiprevaddrh;
 + extern unsigned int tempesi, tempedi, tempedx, tempebp;
 + extern unsigned int SPCMultA, PHnum2writespc7110reg, PHdspsave2;
 +-extern unsigned char sndrot, SPCRAM[65472], DSPMem[256], SA1Status, *SA1RAMArea;
 +-extern unsigned char DSP1Enable, DSP1COp, prevoamptr, BRRBuffer[32], *romdata;
 +-extern unsigned char curcyc, echoon0, spcnumread, NextLineCache, HIRQNextExe;
 ++extern unsigned char sndrot[], SPCRAM[65472], DSPMem[256], SA1Status, *SA1RAMArea;
 ++extern unsigned char DSP1Enable, DSP1COp, prevoamptr, BRRBuffer[], *romdata;
 ++extern unsigned char curcyc, echoon0[], spcnumread, NextLineCache, HIRQNextExe;
 + extern unsigned char vidmemch4[4096], vidmemch8[4096], vidmemch2[4096];
 + 
 + extern bool C4Enable, SFXEnable, SA1Enable, SPC7110Enable, SETAEnable, DSP4Enable, spcon;
++--- a/src/Makefile.in
+++++ b/src/Makefile.in
++@@ -95,7 +95,7 @@ Z_OBJS=$(MAIN_O) $(CHIP_O) $(CPU_O) $(DE
++ %.o: %.cpp
++ 	@CXX@ @CXXFLAGS@ -o $@ -c $<
++ %.o %.h: %.psr $(PSR)
++-	./$(PSR) @PSRFLAGS@ -gcc @CC@ -compile -flags "@CFLAGS@ -O1" -cheader $*.h -fname $* $*.o $<
+++	./$(PSR) @PSRFLAGS@ -gcc @CC@ -compile -flags "@CFLAGS@" -cheader $*.h -fname $* $*.o $<
++ 
++ default: main
++ all: main tools
diff --combined debian/patches/series
index 72cf7c6,9b29cb7..08299e0
--- a/debian/patches/series
+++ b/debian/patches/series
@@@ -1,5 -1,3 +1,3 @@@
- 0001-gcc-fno-rtti.patch
- 0002-replace_crc32.patch
  0003-gcc-4.3-ftbfs.patch
  0004-manpage-in-usr-share-man.patch
  0005-hyphens-as-minus-signs-in-manpage.patch
@@@ -12,5 -10,4 +10,5 @@@
  0012-Fix-build-with-gcc-4.7.patch
  0013-Fix-sound-with-libao.patch
  0014-Initialize-driver_format.matrix-with-NULL.patch
- 0015-fortify-source.patch
- 0016-parsegen.patch
+ zsnes-linux-resume-freeze-fix.patch
++fortify-source.patch

-- 
Emulator of the Super Nintendo Entertainment System (TM)



More information about the Pkg-games-commits mailing list