diff options
Diffstat (limited to 'system/xar/patches')
-rw-r--r-- | system/xar/patches/series | 7 | ||||
-rw-r--r-- | system/xar/patches/xar-1.6.1-ext2.patch | 24 | ||||
-rw-r--r-- | system/xar/patches/xar-1.8-arm-ppc.patch | 23 | ||||
-rw-r--r-- | system/xar/patches/xar-1.8-openssl-1.1.patch | 45 | ||||
-rw-r--r-- | system/xar/patches/xar-1.8-safe_dirname.patch | 16 | ||||
-rw-r--r-- | system/xar/patches/xar-1.8.0.0.452-linux.patch | 104 | ||||
-rw-r--r-- | system/xar/patches/xar-1.8.0.0.487-non-darwin.patch | 12 | ||||
-rw-r--r-- | system/xar/patches/xar-1.8.0.0.487-variable-sized-object.patch | 18 |
8 files changed, 249 insertions, 0 deletions
diff --git a/system/xar/patches/series b/system/xar/patches/series new file mode 100644 index 0000000000..49d45200fe --- /dev/null +++ b/system/xar/patches/series @@ -0,0 +1,7 @@ +xar-1.6.1-ext2.patch +xar-1.8-safe_dirname.patch +xar-1.8-arm-ppc.patch +xar-1.8-openssl-1.1.patch +xar-1.8.0.0.452-linux.patch +xar-1.8.0.0.487-non-darwin.patch +xar-1.8.0.0.487-variable-sized-object.patch diff --git a/system/xar/patches/xar-1.6.1-ext2.patch b/system/xar/patches/xar-1.6.1-ext2.patch new file mode 100644 index 0000000000..da413b03e5 --- /dev/null +++ b/system/xar/patches/xar-1.6.1-ext2.patch @@ -0,0 +1,24 @@ +--- a/lib/ext2.c.orig ++++ b/lib/ext2.c +@@ -139,8 +139,10 @@ + if(! (flags & ~EXT2_NOCOMPR_FL) ) + x_addprop(f, "NoCompBlock"); + #endif ++#ifdef EXT2_ECOMPR_FL + if(! (flags & ~EXT2_ECOMPR_FL) ) + x_addprop(f, "CompError"); ++#endif + if(! (flags & ~EXT2_BTREE_FL) ) + x_addprop(f, "BTree"); + if(! (flags & ~EXT2_INDEX_FL) ) +@@ -225,8 +227,10 @@ + if( e2prop_get(f, "NoCompBlock", (char **)&tmp) == 0 ) + flags |= EXT2_NOCOMPR_FL ; + #endif ++#ifdef EXT2_ECOMPR_FL + if( e2prop_get(f, "CompError", (char **)&tmp) == 0 ) + flags |= EXT2_ECOMPR_FL ; ++#endif + if( e2prop_get(f, "BTree", (char **)&tmp) == 0 ) + flags |= EXT2_BTREE_FL ; + if( e2prop_get(f, "HashIndexed", (char **)&tmp) == 0 ) diff --git a/system/xar/patches/xar-1.8-arm-ppc.patch b/system/xar/patches/xar-1.8-arm-ppc.patch new file mode 100644 index 0000000000..b2eec5a96e --- /dev/null +++ b/system/xar/patches/xar-1.8-arm-ppc.patch @@ -0,0 +1,23 @@ +--- a/lib/archive.c ++++ b/lib/archive.c +@@ -387,7 +387,8 @@ + return NULL; + } + +- XAR(ret)->heap_offset = xar_get_heap_offset(ret) + offset; ++ XAR(ret)->heap_offset = ++ XAR(ret)->toc_count + sizeof(xar_header_t) + offset; + if( lseek(XAR(ret)->fd, XAR(ret)->heap_offset, SEEK_SET) == -1 ) { + xar_close(ret); + return NULL; +--- a/src/xar.c ++++ a/src/xar.c +@@ -783,7 +783,7 @@ + int main(int argc, char *argv[]) { + int ret; + char *filename = NULL; +- char command = 0, c; ++ signed char command = 0, c; + char **args; + const char *tocfile = NULL; + int arglen, i, err; diff --git a/system/xar/patches/xar-1.8-openssl-1.1.patch b/system/xar/patches/xar-1.8-openssl-1.1.patch new file mode 100644 index 0000000000..f811d99d07 --- /dev/null +++ b/system/xar/patches/xar-1.8-openssl-1.1.patch @@ -0,0 +1,45 @@ +lib/hash.c: fix compilation with OpenSSL-1.1+ + +EVP_MD_CTX has become an anonymous struct now, so can't allocate size +for it anymore. + +--- a/lib/hash.c 2015-06-09 03:22:07.000000000 +0000 ++++ b/lib/hash.c 2019-01-01 14:37:01.487775958 +0000 +@@ -102,7 +102,7 @@ + #ifdef __APPLE__ + CCDigestRef digest; + #else +- EVP_MD_CTX digest; ++ EVP_MD_CTX *digest; + const EVP_MD *type; + #endif + unsigned int length; +@@ -123,7 +123,8 @@ + #else + OpenSSL_add_all_digests(); + HASH_CTX(hash)->type = EVP_get_digestbyname(digest_name); +- EVP_DigestInit(&HASH_CTX(hash)->digest, HASH_CTX(hash)->type); ++ HASH_CTX(hash)->digest = EVP_MD_CTX_create(); ++ EVP_DigestInit(HASH_CTX(hash)->digest, HASH_CTX(hash)->type); + #endif + + HASH_CTX(hash)->digest_name = strdup(digest_name); +@@ -143,7 +143,7 @@ + #ifdef __APPLE__ + CCDigestUpdate(HASH_CTX(hash)->digest, buffer, nbyte); + #else +- EVP_DigestUpdate(&HASH_CTX(hash)->digest, buffer, nbyte); ++ EVP_DigestUpdate(HASH_CTX(hash)->digest, buffer, nbyte); + #endif + } + +@@ -160,7 +160,8 @@ + CCDigestFinal(HASH_CTX(hash)->digest, buffer); + CCDigestDestroy(HASH_CTX(hash)->digest); + #else +- EVP_DigestFinal(&HASH_CTX(hash)->digest, buffer, &HASH_CTX(hash)->length); ++ EVP_DigestFinal(HASH_CTX(hash)->digest, buffer, &HASH_CTX(hash)->length); ++ EVP_MD_CTX_destroy(HASH_CTX(hash)->digest); + #endif + + *nbyte = HASH_CTX(hash)->length; diff --git a/system/xar/patches/xar-1.8-safe_dirname.patch b/system/xar/patches/xar-1.8-safe_dirname.patch new file mode 100644 index 0000000000..eb2f5f071b --- /dev/null +++ b/system/xar/patches/xar-1.8-safe_dirname.patch @@ -0,0 +1,16 @@ +linuxattr: fix missing symbol safe_dirname + +This one was probably missed when they did a global rename to xar_ +prefixed variants. + +--- a/lib/linuxattr.c ++++ b/lib/linuxattr.c +@@ -223,7 +223,7 @@ + if( statfs(file, &sfs) != 0 ) { + char *tmp, *bname; + tmp = strdup(file); +- bname = safe_dirname(tmp); ++ bname = xar_safe_dirname(tmp); + statfs(bname, &sfs); + free(tmp); + free(bname); diff --git a/system/xar/patches/xar-1.8.0.0.452-linux.patch b/system/xar/patches/xar-1.8.0.0.452-linux.patch new file mode 100644 index 0000000000..ccfc68369a --- /dev/null +++ b/system/xar/patches/xar-1.8.0.0.452-linux.patch @@ -0,0 +1,104 @@ +--- a/configure.ac ++++ b/configure.ac +@@ -183,7 +183,7 @@ + + AC_TRY_COMPILE([#include <sys/types.h> + #include <sys/acl.h>], [acl_t a], [AC_DEFINE([HAVE_SYS_ACL_H],[1], [define if you have sys/acl.h and it has a working acl_t type])]) +-AC_CHECK_HEADERS(ext2fs/ext2_fs.h sys/statfs.h sys/xattr.h sys/param.h sys/extattr.h libutil.h) ++AC_CHECK_HEADERS(ext2fs/ext2_fs.h sys/statfs.h sys/vfs.h sys/xattr.h sys/param.h sys/extattr.h libutil.h) + AC_CHECK_FUNCS(lgetxattr) + AC_CHECK_FUNCS(lsetxattr) + AC_CHECK_FUNCS(getxattr) +@@ -199,7 +199,22 @@ + + AC_CHECK_MEMBERS([struct statfs.f_fstypename],,,[#include <sys/types.h> + #include <sys/param.h> +-#include <sys/mount.h>]) ++#include <sys/mount.h> ++#ifdef HAVE_SYS_VFS_H ++#include <sys/vfs.h> ++#endif]) ++AC_CHECK_MEMBERS([struct statfs.f_iosize],,,[#include <sys/types.h> ++#include <sys/param.h> ++#include <sys/mount.h> ++#ifdef HAVE_SYS_VFS_H ++#include <sys/vfs.h> ++#endif]) ++AC_CHECK_MEMBERS([struct statfs.f_bsize],,,[#include <sys/types.h> ++#include <sys/param.h> ++#include <sys/mount.h> ++#ifdef HAVE_SYS_VFS_H ++#include <sys/vfs.h> ++#endif]) + AC_CHECK_MEMBERS([struct statvfs.f_fstypename],,,[#include <sys/statvfs.h>]) + AC_CHECK_MEMBERS([struct stat.st_flags]) + +--- a/lib/util.c ++++ b/lib/util.c +@@ -35,6 +35,8 @@ + * Christopher Ryan <ryanc@apple.com> + */ + ++#include "config.h" ++ + #include <stdio.h> + #include <stdint.h> + #include <sys/types.h> +@@ -40,6 +40,9 @@ + #include <sys/types.h> + #include <sys/mount.h> + #include <sys/param.h> ++#ifdef HAVE_SYS_VFS_H ++# include <sys/vfs.h> ++#endif + #include <arpa/inet.h> + #include <string.h> + #include <unistd.h> +@@ -467,6 +467,14 @@ + return tmp; + } + ++#ifndef HAVE_STRUCT_STATFS_F_IOSIZE ++# ifdef HAVE_STRUCT_STATFS_F_BSIZE ++# define f_iosize f_bsize ++# else ++# error need a field to get optimal transfer block size ++# endif ++#endif ++ + size_t xar_optimal_io_size_at_path(const char *path) + { + // Start at 1MiB +@@ -491,6 +491,7 @@ + fs_iosize = optimal_rsize; + } + ++#ifdef MNT_LOCAL + // If we're a remote filesystem, never let us go below the optimal size above of 1MiB + // NFS is horrible and lies that the optimal size is 512 bytes. + // Whereas SMB in my testing returns 7MiBs (far more practicle) +@@ -503,6 +504,7 @@ + } + } + else ++#endif + { + optimal_rsize = fs_iosize; + } +--- a/include/config.h.in ++++ b/include/config.h.in +@@ -1,4 +1,5 @@ + #undef HAVE_SYS_STATFS_H ++#undef HAVE_SYS_VFS_H + #undef HAVE_SYS_XATTR_H + #undef HAVE_SYS_EXTATTR_H + #undef HAVE_SYS_PARAM_H +@@ -15,6 +15,8 @@ + #undef HAVE_STRUCT_STAT_ST_FLAGS + #undef HAVE_STRUCT_STATVFS_F_FSTYPENAME + #undef HAVE_STRUCT_STATFS_F_FSTYPENAME ++#undef HAVE_STRUCT_STATFS_F_IOSIZE ++#undef HAVE_STRUCT_STATFS_F_BSIZE + #undef HAVE_SYS_ACL_H + #undef HAVE_LIBUTIL_H + #undef HAVE_LIBPTHREAD diff --git a/system/xar/patches/xar-1.8.0.0.487-non-darwin.patch b/system/xar/patches/xar-1.8.0.0.487-non-darwin.patch new file mode 100644 index 0000000000..c350f69f4c --- /dev/null +++ b/system/xar/patches/xar-1.8.0.0.487-non-darwin.patch @@ -0,0 +1,12 @@ +don't do availability stuff on non-Darwin + +--- a/include/xar.h.in ++++ b/include/xar.h.in +@@ -52,6 +52,7 @@ + #import <os/availability.h> + #else + #define API_DEPRECATED(...) ++#define API_AVAILABLE(...) + #endif + + #pragma pack(4) diff --git a/system/xar/patches/xar-1.8.0.0.487-variable-sized-object.patch b/system/xar/patches/xar-1.8.0.0.487-variable-sized-object.patch new file mode 100644 index 0000000000..8779c1129c --- /dev/null +++ b/system/xar/patches/xar-1.8.0.0.487-variable-sized-object.patch @@ -0,0 +1,18 @@ +GCC doesn't like this: + +filetree.c:744:9: error: variable-sized object may not be initialized + +Since there's nothing changing at runtime at all, just make the compiler +see it's always going to be 1. + +--- a/lib/filetree.c ++++ b/lib/filetree.c +@@ -740,7 +740,7 @@ + size_t fspath1_size = 0, fspath2_size = 0; + size_t ns1_size = 0, ns2_size = 0; + const struct __xar_file_t * child1 = NULL, * child2 = NULL; +- const uint keys_to_ignore_count = 1; ++#define keys_to_ignore_count 1 + char * keys_to_ignore[keys_to_ignore_count] = { "id" }; // ID is allowed ot mismatch + + // If the two pointers match, call it the same. |