Kodi Krypton Fixes

From bibbleWiki
Jump to navigation Jump to search

Fix native/automake-native/x86_64-linux-native$ vi bin/automake.in

--- automake.in	2015-01-06 03:25:55.000000000 +0800
+++ automake.in.patched	2017-07-26 13:58:07.086205701 +0800
@@ -3878,7 +3878,7 @@
 sub substitute_ac_subst_variables
 {
   my ($text) = @_;
-  $text =~ s/\${([^ \t=:+{}]+)}/substitute_ac_subst_variables_worker ($1)/ge;
+  $text =~ s/\$\{([^ \t=:+{}]+)\}/substitute_ac_subst_variables_worker ($1)/ge;
   return $text;
 }


Fix $KODI_ROOT=/android-tools/xbmc-depends/x86_64-linux-gnu-native/include/gif_lib.h

--- /tmp/gif_lib.h      2018-12-29 16:30:47.441889499 +1300
+++ /media/iwiseman/Segate/Kypton/android-tools/xbmc-depends/x86_64-linux-gnu-native/include/gif_lib.h  2018-12-29 16:32:05.610388400 +1300
@@ -20,6 +20,7 @@ 

 #include <stddef.h>
 #include <stdbool.h>
+#include <stdlib.h>

 #define GIF_STAMP "GIFVER"          /* First chars in file - GIF stamp.  */
 #define GIF_STAMP_LEN sizeof(GIF_STAMP) - 1
@@ -245,7 +246,7 @@
 extern int GifBitSize(int n);

 extern void *
-reallocarray(void *optr, size_t nmemb, size_t size);
+reallocarray(void *optr, size_t nmemb, size_t size)  __THROW __attribute_warn_unused_result__;

 /******************************************************************************
  Support for the in-core structures allocation (slurp mode).

Fix up google-breakpad-native

find $KODI_ROOT/kodi/tools/depends/native/google-breakpad-native/x86_64-linux-native  -type f -name "*.cc" -print0 | xargs -0 sed -i 's/struct ucontext/ucontext_t/g'
find $KODI_ROOT/kodi/tools/depends/native/google-breakpad-native/x86_64-linux-native  -type f -name "*.h" -print0 | xargs -0 sed -i 's/struct ucontext/ucontext_t/g'
find $KODI_ROOT/kodi/tools/depends/native/google-breakpad-native/x86_64-linux-native  -type f -name "*.cc" -print0 | xargs -0 sed -i 's/const ucontext /const ucontext_t /g'
find $KODI_ROOT/kodi/tools/depends/native/google-breakpad-native/x86_64-linux-native  -type f -name "*.h" -print0 | xargs -0 sed -i 's/const ucontext /const ucontext_t /g'

Fix zlib to have -fPIC use in zlib Makefile

--- /tmp/Makefile       2018-12-29 18:57:38.613221546 +1300
+++ Makefile    2018-12-29 18:57:52.519113900 +1300
@@ -15,6 +15,7 @@
 #    make install
 # To install in $HOME instead of /usr/local, use:
 #    make install prefix=$HOME
+override CFLAGS += -fPIC

Fix libffi

Fix the Makefile to apply a patch

--- /tmp/Makefile       2018-12-29 19:10:26.968270997 +1300
+++ Makefile    2018-12-29 19:12:19.541011200 +1300
@@ -1,5 +1,5 @@
 include ../../Makefile.include
-DEPS= ../../Makefile.include Makefile
+DEPS= ../../Makefile.include Makefile armAssembler.patch

 # lib name, version
 LIBNAME=libffi
@@ -8,13 +8,7 @@
 ARCHIVE=$(SOURCE).tar.gz 

 # configuration settings
-CONFIGURE= ./configure --prefix=$(PREFIX) --disable-shared --disable-builddir
-ifeq ($(OS), ios)
-ifneq ($(CPU), arm64)
-CONFIGURE+=CCASFLAGS=-no-integrated-as
-endif
-endif
-
+CONFIGURE= ./configure --prefix=$(PREFIX) --disable-shared --disable-builddir

 LIBDYLIB=$(PLATFORM)/.libs/$(LIBNAME).a 

@@ -26,6 +20,7 @@
 $(PLATFORM): $(TARBALLS_LOCATION)/$(ARCHIVE) $(DEPS)
        rm -rf $(PLATFORM); mkdir -p $(PLATFORM)
        cd $(PLATFORM); $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
+       cd $(PLATFORM); patch -p1 -i ../armAssembler.patch
        cd $(PLATFORM); $(CONFIGURE)

 $(LIBDYLIB): $(PLATFORM)

Create file the patch armAssembler.patch in the Makefile directory

--- a/src/arm/sysv.S
+++ b/src/arm/sysv.S
@@ -360,7 +360,7 @@
        cmp     r0, #3
        sub     ip, fp, #64
        flddle  d0, [ip]
-       fldmiadgt       ip, {d0-d7}
+       vldmiagt        ip, {d0-d7}  

 LSYM(Lbase_args):
        @ move first 4 parameters in registers
@@ -396,7 +396,7 @@
        beq     LSYM(Lepilogue_vfp) 

        cmp     r3, #FFI_TYPE_SINT64
-       stmeqia r2, {r0, r1}
+       stmiaeq r2, {r0, r1}
        beq     LSYM(Lepilogue_vfp) 

        cmp     r3, #FFI_TYPE_FLOAT
@@ -409,7 +409,7 @@ 

        cmp     r3, #FFI_TYPE_STRUCT_VFP_FLOAT
        cmpne   r3, #FFI_TYPE_STRUCT_VFP_DOUBLE
-       fstmiadeq       r2, {d0-d3}
+       vstmiaeq        r2, {d0-d3}

 LSYM(Lepilogue_vfp):
        RETLDM  "r0-r3,fp"
@@ -420,7 +420,7 @@


 ARM_FUNC_START(ffi_closure_VFP)
-       fstmfdd sp!, {d0-d7}
+       vstmdb  sp!, {d0-d7}
        @ r0-r3, then d0-d7
        UNWIND .pad #80
        add     ip, sp, #80
@@ -470,10 +470,10 @@
        ldmia   sp, {r0, r1}
        b       .Lclosure_epilogue_vfp
 .Lretfloat_struct_vfp:
-       fldmiad sp, {d0-d1}
+       vldmia  sp, {d0-d1}
        b       .Lclosure_epilogue_vfp
 .Lretdouble_struct_vfp:
-       fldmiad sp, {d0-d3}
+       vldmia  sp, {d0-d3}
        b       .Lclosure_epilogue_vfp 

 .ffi_closure_VFP_end:

Fix python

--- /tmp/pythonrun.c    2018-12-29 19:33:17.869754505 +1300
+++ ./target/python27/arm-linux-androideabi-android-24/Python/pythonrun.c       2018-12-29 19:33:38.918419700 +1300
@@ -294,51 +294,6 @@
         overridden = 1;
     }

-#if defined(Py_USING_UNICODE) && defined(HAVE_LANGINFO_H) && defined(CODESET)
-    /* On Unix, set the file system encoding according to the
-       user's preference, if the CODESET names a well-known
-       Python codec, and Py_FileSystemDefaultEncoding isn't
-       initialized by other means. Also set the encoding of
-       stdin and stdout if these are terminals, unless overridden.  */
-
-    if (!overridden || !Py_FileSystemDefaultEncoding) {
-        saved_locale = strdup(setlocale(LC_CTYPE, NULL));
-        setlocale(LC_CTYPE, "");
-        loc_codeset = nl_langinfo(CODESET);
-        if (loc_codeset && *loc_codeset) {
-            PyObject *enc = PyCodec_Encoder(loc_codeset);
-            if (enc) {
-                loc_codeset = strdup(loc_codeset);
-                Py_DECREF(enc);
-            } else {
-                if (PyErr_ExceptionMatches(PyExc_LookupError)) {
-                    PyErr_Clear();
-                    loc_codeset = NULL;
-                } else {
-                    PyErr_Print();
-                    exit(1);
-                }
-            }
-        } else
-            loc_codeset = NULL;
-        setlocale(LC_CTYPE, saved_locale);
-        free(saved_locale);
-
-        if (!overridden) {
-            codeset = icodeset = loc_codeset;
-             free_codeset = 1;
-        }
-
-        /* Initialize Py_FileSystemDefaultEncoding from
-           locale even if PYTHONIOENCODING is set. */
-        if (!Py_FileSystemDefaultEncoding) {
-            Py_FileSystemDefaultEncoding = loc_codeset;
-            if (!overridden)
-                free_codeset = 0;
-        }
-    }
-#endif
-
 #ifdef MS_WINDOWS
     if (!overridden) {
         icodeset = ibuf;

Fix libxml2

--- /tmp/Makefile       2018-12-29 19:40:06.017621137 +1300
+++ Makefile    2018-12-29 19:40:35.767996300 +1300
@@ -19,6 +19,8 @@ 



+ override CFLAGS += -fPIC
+
 pkgdatadir = $(datadir)/libxml2
 pkgincludedir = $(includedir)/libxml2
 pkglibdir = $(libdir)/libxml2

Fix samba gpl v3

--- /tmp/winbind_struct_protocol.h      2018-12-30 11:25:22.841406202 +1300
+++ ./target/samba-gplv3/arm-linux-androideabi-android-24/nsswitch/winbind_struct_protocol.h    2018-12-30 11:22:03.676891000 +1300
@@ -186,6 +186,11 @@
        WINBINDD_NUM_CMDS
 };

+
+#if defined(ANDROID) && defined(pw_gecos)
+#undef pw_gecos
+#endif
+
 typedef struct winbindd_pw {
        fstring pw_name;
        fstring pw_passwd;

Fix FindThreads.cmake

Remove ArchSetup Android and Common ArchSetup