components/python/python27/patches/04-solaris-64-bit.patch
branchs11-update
changeset 3367 ed5024e47b53
parent 458 2edc011b559e
equal deleted inserted replaced
3366:dba288608e69 3367:ed5024e47b53
     1 --- Python-2.7.1/Lib/distutils/command/build_ext.py.orig	Fri Jul 15 15:32:28 2011
     1 This patch ensures that 64-bit shared objects are in a subdirectory named
     2 +++ Python-2.7.1/Lib/distutils/command/build_ext.py	Fri Jul 15 15:37:00 2011
     2 "64".  Note that changes to the Lib/distutils/tests/test_build.py and
     3 @@ -637,6 +637,10 @@
     3 Lib/distutils/tests/test_install.py avoid running tests that fail due to
       
     4 this patch.  As this is Solaris-specific, it is not suitable for upstream.
       
     5 
       
     6 --- Python-2.7.6/Lib/distutils/command/build_ext.py.~1~	2013-11-09 23:36:40.000000000 -0800
       
     7 +++ Python-2.7.6/Lib/distutils/command/build_ext.py	2014-05-14 12:47:04.342901439 -0700
       
     8 @@ -634,6 +634,10 @@
     4          filename = self.get_ext_filename(ext_name)
     9          filename = self.get_ext_filename(ext_name)
     5          filename = os.path.split(filename)[-1]
    10          filename = os.path.split(filename)[-1]
     6  
    11  
     7 +        # on Solaris we put 64-bit python objects under .../64
    12 +        # on Solaris we put 64-bit python objects under .../64
     8 +        if sys.maxint != 2147483647L:
    13 +        if sys.maxint != 2147483647L:
     9 +            filename = os.path.join("64", filename)
    14 +            filename = os.path.join("64", filename)
    10 +
    15 +
    11          if not self.inplace:
    16          if not self.inplace:
    12              # no further work needed
    17              # no further work needed
    13              # returning :
    18              # returning :
    14 @@ -677,7 +681,14 @@
    19 @@ -674,7 +678,14 @@
    15          so_ext = get_config_var('SO')
    20          so_ext = get_config_var('SO')
    16          if os.name == 'nt' and self.debug:
    21          if os.name == 'nt' and self.debug:
    17              return os.path.join(*ext_path) + '_d' + so_ext
    22              return os.path.join(*ext_path) + '_d' + so_ext
    18 -        return os.path.join(*ext_path) + so_ext
    23 -        return os.path.join(*ext_path) + so_ext
    19 +        #return os.path.join(*ext_path) + so_ext
    24 +        #return os.path.join(*ext_path) + so_ext
    25 +        basename = os.path.basename(path);
    30 +        basename = os.path.basename(path);
    26 +        return os.path.join(dirname, "64", basename + so_ext)
    31 +        return os.path.join(dirname, "64", basename + so_ext)
    27  
    32  
    28      def get_export_symbols (self, ext):
    33      def get_export_symbols (self, ext):
    29          """Return the list of symbols that a shared extension has to
    34          """Return the list of symbols that a shared extension has to
    30 --- Python-2.7.1/Python/import.c.orig	Fri Jul 15 15:41:33 2011
    35 --- Python-2.7.6/Python/import.c.~1~	2013-11-09 23:36:41.000000000 -0800
    31 +++ Python-2.7.1/Python/import.c	Fri Jul 15 15:46:55 2011
    36 +++ Python-2.7.6/Python/import.c	2014-05-14 12:53:34.233016586 -0700
    32 @@ -1197,6 +1197,57 @@
    37 @@ -1288,6 +1288,57 @@
    33  static int find_init_module(char *); /* Forward */
    38  static int find_init_module(char *); /* Forward */
    34  static struct filedescr importhookdescr = {"", "", IMP_HOOK};
    39  static struct filedescr importhookdescr = {"", "", IMP_HOOK};
    35  
    40  
    36 +#ifdef HAVE_STAT
    41 +#ifdef HAVE_STAT
    37 +static char *
    42 +static char *
    85 +#endif
    90 +#endif
    86 +
    91 +
    87  static struct filedescr *
    92  static struct filedescr *
    88  find_module(char *fullname, char *subname, PyObject *path, char *buf,
    93  find_module(char *fullname, char *subname, PyObject *path, char *buf,
    89              size_t buflen, FILE **p_fp, PyObject **p_loader)
    94              size_t buflen, FILE **p_fp, PyObject **p_loader)
    90 @@ -1214,11 +1265,10 @@
    95 @@ -1302,11 +1353,10 @@
    91      static struct filedescr fd_builtin = {"", "", C_BUILTIN};
    96      static struct filedescr fd_builtin = {"", "", C_BUILTIN};
    92      static struct filedescr fd_package = {"", "", PKG_DIRECTORY};
    97      static struct filedescr fd_package = {"", "", PKG_DIRECTORY};
    93      char name[MAXPATHLEN+1];
    98      char *name;
    94 -#if defined(PYOS_OS2)
    99 -#if defined(PYOS_OS2)
    95      size_t saved_len;
   100      size_t saved_len;
    96      size_t saved_namelen;
   101      size_t saved_namelen;
    97      char *saved_buf = NULL;
   102      char *saved_buf = NULL;
    98 -#endif
   103 -#endif
    99 +
   104 +
   100      if (p_loader != NULL)
   105      if (p_loader != NULL)
   101          *p_loader = NULL;
   106          *p_loader = NULL;
   102  
   107  
   103 @@ -1437,7 +1487,6 @@
   108 @@ -1513,15 +1563,17 @@
       
   109                  }
       
   110              }
   104          }
   111          }
   105  #endif
       
   106  #endif
       
   107 -#if defined(PYOS_OS2)
   112 -#if defined(PYOS_OS2)
   108          /* take a snapshot of the module spec for restoration
   113          /* take a snapshot of the module spec for restoration
   109           * after the 8 character DLL hackery
   114           * after the 8 character DLL hackery
   110           */
   115           */
   111 @@ -1444,8 +1493,11 @@
       
   112          saved_buf = strdup(buf);
   116          saved_buf = strdup(buf);
   113          saved_len = len;
   117          saved_len = len;
   114          saved_namelen = namelen;
   118          saved_namelen = namelen;
   115 -#endif /* PYOS_OS2 */
   119 -#endif /* PYOS_OS2 */
   116 +
   120 +
   119 +            len += modify_path(fdp, buf, buflen);
   123 +            len += modify_path(fdp, buf, buflen);
   120 +#endif
   124 +#endif
   121  #if defined(PYOS_OS2) && defined(HAVE_DYNAMIC_LOADING)
   125  #if defined(PYOS_OS2) && defined(HAVE_DYNAMIC_LOADING)
   122              /* OS/2 limits DLLs to 8 character names (w/o
   126              /* OS/2 limits DLLs to 8 character names (w/o
   123                 extension)
   127                 extension)
   124 @@ -1486,14 +1538,13 @@
   128 @@ -1562,21 +1614,20 @@
   125                      fp = NULL;
   129                      fp = NULL;
   126                  }
   130                  }
   127              }
   131              }
   128 -#if defined(PYOS_OS2)
   132 -#if defined(PYOS_OS2)
   129 +
   133 +
   136 -#if defined(PYOS_OS2)
   140 -#if defined(PYOS_OS2)
   137 +
   141 +
   138          /* don't need/want the module name snapshot anymore */
   142          /* don't need/want the module name snapshot anymore */
   139          if (saved_buf)
   143          if (saved_buf)
   140          {
   144          {
   141 @@ -1500,7 +1551,7 @@
       
   142              free(saved_buf);
   145              free(saved_buf);
   143              saved_buf = NULL;
   146              saved_buf = NULL;
   144          }
   147          }
   145 -#endif
   148 -#endif
   146 +
   149 +