ports/36998: rsync requires -O2 on BSD to avoid segv?

Anders Nordby anders at fix.no
Sun Apr 21 12:26:01 EST 2002


Hi,

On Sun, Apr 21, 2002 at 12:04:22PM -0700, Jos Backus wrote:
> Is it OK if I fix this in rsync CVS so the next release won't need this patch
> on FreeBSD?

Hm. Better make the patch like this. The ifdef was too narrow (sorry).

Cheers,

-- 
Anders.
-------------- next part --------------
--- zlib/infcodes.c.orig	Tue Mar 12 02:14:58 2002
+++ zlib/infcodes.c	Sun Apr 21 21:19:46 2002
@@ -197,8 +197,18 @@
       c->mode = COPY;
     case COPY:          /* o: copying bytes in window, waiting for space */
       f = q - c->sub.copy.dist;
+#ifdef __FreeBSD__
+      {
+      /* Work-around for a FreeBSD gcc bug. */
+      volatile inflate_blocks_statef *s1 = s;
+
+      while (f < s1->window)            /* modulo window size-"while" instead */
+        f += s1->end - s1->window;      /* of "if" handles invalid distances */
+      }
+#else
       while (f < s->window)             /* modulo window size-"while" instead */
         f += s->end - s->window;        /* of "if" handles invalid distances */
+#endif
       while (c->len)
       {
         NEEDOUT


More information about the rsync mailing list