From 5a410be6c41191dc4444585d3e918ed7079310f8 Mon Sep 17 00:00:00 2001
From: fbrosson <fbrosson@localhost>
Date: Tue, 26 Apr 2016 21:03:14 +0000
Subject: Do not try to create hard links.


diff --git a/Makefile.am b/Makefile.am
index cd79331..80e0bfb 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -149,7 +149,7 @@ install-exec-hook remove-installed-links:
 	     rm -f "$$dest" && \
 	     case $@ in \
 	     install-exec-hook) \
-	       ln "$$source" "$$dest" || $(LN_S) "$$source" "$$dest";; \
+	       $(LN_S) "$$source" "$$dest";; \
 	     esac \
 	    ) || exit; \
 	  done; \
-- 
2.30.2


From fee57c4c05c42881355ecd4f0366607ddb6b1bab Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Tue, 2 Oct 2018 15:27:27 +0200
Subject: gcc2 patch


diff --git a/gzip.c b/gzip.c
index f75b614..d418cde 100644
--- a/gzip.c
+++ b/gzip.c
@@ -303,7 +303,7 @@ static const struct option longopts[] =
 
 /* local functions */
 
-local noreturn void try_help (void);
+local __attribute__ ((__noreturn__)) void try_help (void);
 local void help         (void);
 local void license      (void);
 local void version      (void);
@@ -323,7 +323,7 @@ local void copy_stat    (struct stat *ifstat);
 local void install_signal_handlers (void);
 static void remove_output_file (bool);
 static void abort_gzip_signal (int);
-local noreturn void do_exit (int exitcode);
+local __attribute__ ((__noreturn__)) void do_exit (int exitcode);
 static void finish_out (void);
       int main          (int argc, char **argv);
 static int (*work) (int infile, int outfile) = zip; /* function to call */
@@ -1188,6 +1188,7 @@ local char *get_suffix(name)
         NULL, NULL};
     char const **suf;
     bool suffix_of_builtin = false;
+    char *z_lower, *match;
 
     /* Normally put Z_SUFFIX at the start of KNOWN_SUFFIXES, but if it
        is a suffix of one of them, put it at the end.  */
@@ -1201,7 +1202,7 @@ local char *get_suffix(name)
           }
       }
 
-    char *z_lower = xstrdup(z_suffix);
+    z_lower = xstrdup(z_suffix);
     strlwr(z_lower);
     known_suffixes[suffix_of_builtin
                    ? sizeof known_suffixes / sizeof *known_suffixes - 2
@@ -1216,7 +1217,7 @@ local char *get_suffix(name)
     }
     strlwr(suffix);
     slen = strlen(suffix);
-    char *match = NULL;
+    match = NULL;
     do {
        int s = strlen(*suf);
        if (slen > s && ! ISSLASH (suffix[slen - s - 1])
diff --git a/gzip.h b/gzip.h
index 7c0acd4..10f0dee 100644
--- a/gzip.h
+++ b/gzip.h
@@ -272,7 +272,7 @@ extern int unpack     (int in, int out);
 extern int unlzh      (int in, int out);
 
         /* in gzip.c */
-extern noreturn void abort_gzip (void);
+extern __attribute__ ((__noreturn__)) void abort_gzip (void);
 
         /* in deflate.c */
 extern void lm_init (int pack_level);
@@ -309,11 +309,11 @@ extern char *gzip_base_name (char *fname) _GL_ATTRIBUTE_PURE;
 extern int xunlink        (char *fname);
 extern void make_simple_name (char *name);
 extern char *add_envopt   (int *argcp, char ***argvp, char const *env);
-extern noreturn void gzip_error    (char const *m);
-extern noreturn void xalloc_die    (void);
+extern __attribute__ ((__noreturn__)) void gzip_error    (char const *m);
+extern __attribute__ ((__noreturn__)) void xalloc_die    (void);
 extern void warning       (char const *m);
-extern noreturn void read_error    (void);
-extern noreturn void write_error   (void);
+extern __attribute__ ((__noreturn__)) void read_error    (void);
+extern __attribute__ ((__noreturn__)) void write_error   (void);
 extern void display_ratio (off_t num, off_t den, FILE *file);
 extern void fprint_off    (FILE *, off_t, int);
 
diff --git a/lib/calloc.c b/lib/calloc.c
index 25064e9..808de4a 100644
--- a/lib/calloc.c
+++ b/lib/calloc.c
@@ -44,6 +44,7 @@ rpl_calloc (size_t n, size_t s)
       return NULL;
     }
 
+{
   void *result = calloc (n, s);
 
 #if !HAVE_MALLOC_POSIX
@@ -53,3 +54,4 @@ rpl_calloc (size_t n, size_t s)
 
   return result;
 }
+}
diff --git a/lib/filenamecat-lgpl.c b/lib/filenamecat-lgpl.c
index d52dc80..5211177 100644
--- a/lib/filenamecat-lgpl.c
+++ b/lib/filenamecat-lgpl.c
@@ -52,6 +52,7 @@ mfile_name_concat (char const *dir, char const *base, char **base_in_result)
   size_t dirlen = dirbase - dir + dirbaselen;
   size_t baselen = strlen (base);
   char sep = '\0';
+  char *p_concat;
   if (dirbaselen)
     {
       /* DIR is not a file system root, so separate with / if needed.  */
@@ -68,7 +69,7 @@ mfile_name_concat (char const *dir, char const *base, char **base_in_result)
       sep = '.';
     }
 
-  char *p_concat = malloc (dirlen + (sep != '\0')  + baselen + 1);
+  p_concat = malloc (dirlen + (sep != '\0')  + baselen + 1);
   if (p_concat == NULL)
     return NULL;
 
diff --git a/lib/malloc.c b/lib/malloc.c
index 0d8b359..09a9f88 100644
--- a/lib/malloc.c
+++ b/lib/malloc.c
@@ -40,6 +40,7 @@ rpl_malloc (size_t n)
       return NULL;
     }
 
+{
   void *result = malloc (n);
 
 #if !HAVE_MALLOC_POSIX
@@ -49,3 +50,4 @@ rpl_malloc (size_t n)
 
   return result;
 }
+}
diff --git a/lib/malloca.c b/lib/malloca.c
index b488423..0e8382a 100644
--- a/lib/malloca.c
+++ b/lib/malloca.c
@@ -56,15 +56,18 @@ mmalloca (size_t n)
 
       if (mem != NULL)
         {
+          small_t *p;
+          void *vp;
+          idx_t offset;
           uintptr_t umem = (uintptr_t)mem, umemplus;
           /* The INT_ADD_WRAPV avoids signed integer overflow on
              theoretical platforms where UINTPTR_MAX <= INT_MAX.  */
           INT_ADD_WRAPV (umem, sizeof (small_t) + sa_alignment_max - 1,
                          &umemplus);
-          idx_t offset = ((umemplus & ~alignment2_mask)
+          offset = ((umemplus & ~alignment2_mask)
                           + sa_alignment_max - umem);
-          void *vp = mem + offset;
-          small_t *p = vp;
+          vp = mem + offset;
+          p = vp;
           /* Here p >= mem + sizeof (small_t),
              and p <= mem + sizeof (small_t) + 2 * sa_alignment_max - 1
              hence p + n <= mem + nplus.
diff --git a/lib/realloc.c b/lib/realloc.c
index af03f0c..7de1503 100644
--- a/lib/realloc.c
+++ b/lib/realloc.c
@@ -52,6 +52,7 @@ rpl_realloc (void *p, size_t n)
       return NULL;
     }
 
+{
   void *result = realloc (p, n);
 
 #if !HAVE_MALLOC_POSIX
@@ -61,3 +62,4 @@ rpl_realloc (void *p, size_t n)
 
   return result;
 }
+}
diff --git a/lib/savedir.c b/lib/savedir.c
index 55e0acd..8e8210c 100644
--- a/lib/savedir.c
+++ b/lib/savedir.c
@@ -149,11 +149,12 @@ streamsavedir (DIR *dirp, enum savedir_option option)
 
   if (cmp)
     {
+      idx_t i;
       if (entries_used)
         qsort (entries, entries_used, sizeof *entries, cmp);
       name_space = ximalloc (used + 1);
       used = 0;
-      for (idx_t i = 0; i < entries_used; i++)
+      for (i = 0; i < entries_used; i++)
         {
           char *dest = name_space + used;
           used += stpcpy (dest, entries[i].name) - dest + 1;
diff --git a/lib/stdnoreturn.in.h b/lib/stdnoreturn.in.h
index 4b6cbcd..4356d91 100644
--- a/lib/stdnoreturn.in.h
+++ b/lib/stdnoreturn.in.h
@@ -17,7 +17,7 @@
 
 /* Written by Paul Eggert.  */
 
-#ifndef noreturn
+#if !defined(noreturn) && !defined(__HAIKU__)
 
 /* ISO C11 <stdnoreturn.h> for platforms that lack it.
 
diff --git a/lib/xmalloc.c b/lib/xmalloc.c
index 51a0832..330e29e 100644
--- a/lib/xmalloc.c
+++ b/lib/xmalloc.c
@@ -239,6 +239,7 @@ xpalloc (void *pa, idx_t *pn, idx_t n_incr_min, ptrdiff_t n_max, idx_t s)
      This is typically idx_t, but it should be size_t on (theoretical?)
      platforms where SIZE_MAX < IDX_MAX so xpalloc does not pass
      values greater than SIZE_MAX to xrealloc.  */
+{
 #if IDX_MAX <= SIZE_MAX
   idx_t nbytes;
 #else
@@ -265,6 +266,7 @@ xpalloc (void *pa, idx_t *pn, idx_t n_incr_min, ptrdiff_t n_max, idx_t s)
   *pn = n;
   return pa;
 }
+}
 
 /* Allocate S bytes of zeroed memory dynamically, with error checking.
    There's no need for xnzalloc (N, S), since it would be equivalent
-- 
2.30.2

