[vlc-commits] contrib: gpg-error: fix darwin triplet handling

Alexandre Janniaux git at videolan.org
Sun May 3 01:05:17 CEST 2020


vlc | branch: master | Alexandre Janniaux <ajanni at videolabs.io> | Mon Apr 27 14:11:28 2020 +0200| [0d062895184d6b859e537ab087eeea7381cc4daf] | committer: Alexandre Janniaux

contrib: gpg-error: fix darwin triplet handling

de-versionning was done before alias selection, and armv7-apple-darwin
wasn't aliased to arm-apple-darwin, leading to failure finding the
correct triplet.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0d062895184d6b859e537ab087eeea7381cc4daf
---

 contrib/src/gpg-error/darwin-triplet.patch | 41 ++++++++++++++++++++++--------
 1 file changed, 31 insertions(+), 10 deletions(-)

diff --git a/contrib/src/gpg-error/darwin-triplet.patch b/contrib/src/gpg-error/darwin-triplet.patch
index dd0fef95de..8cf92b1101 100644
--- a/contrib/src/gpg-error/darwin-triplet.patch
+++ b/contrib/src/gpg-error/darwin-triplet.patch
@@ -1,11 +1,19 @@
---- libgpg-error-1.27_orig/src/mkheader.c	2017-02-28 13:32:33.000000000 +0100
-+++ libgpg-error-1.27/src/mkheader.c	2020-01-23 11:36:50.000000000 +0100
-@@ -107,7 +107,21 @@
-           return xstrdup (lastalias);
-         }
-     }
--  return xstrdup (triplet);
-+  /* Darwin triplet de-versioning */
+diff --git a/src/mkheader.c b/src/mkheader.c
+index 5aeb1e7..121d029 100644
+--- a/src/mkheader.c
++++ b/src/mkheader.c
+@@ -91,23 +91,41 @@ canon_host_triplet (const char *triplet)
+     {"armv5-unknown-linux-musleabi"   },
+     {"armv6-unknown-linux-musleabihf" },
+
++    {"armv7-apple-darwin", "arm-apple-darwin"},
++
+     { NULL }
+   };
+   int i;
+   const char *lastalias = NULL;
+
++    /* Darwin triplet de-versioning */
 +  char *res_triplet = xstrdup (triplet);
 +
 +  char *triplet_last = strrchr(res_triplet, '-');
@@ -18,8 +26,21 @@
 +  if (strncmp("darwin", triplet_last, 6) == 0) {
 +    triplet_last[6] = '\0';
 +  }
++
+   for (i=0; tbl[i].name; i++)
+     {
+       if (tbl[i].alias)
+         lastalias = tbl[i].alias;
+-      if (!strcmp (tbl[i].name, triplet))
++      if (!strcmp (tbl[i].name, res_triplet))
+         {
+           if (!lastalias)
+             break; /* Ooops: first entry has no alias.  */
++          free(res_triplet);
+           return xstrdup (lastalias);
+         }
+     }
+-  return xstrdup (triplet);
 +
 +  return res_triplet;
  }
- 
- 



More information about the vlc-commits mailing list