[oe] Python standard lib: provide a new package for SSL support (lib-dynload/_ssl.so)

Cyril Humbert cyril.humbert at martec.fr
Fri Nov 7 10:47:37 UTC 2008


Hello,

I'm using Python on a target where RAM is quite limited. I've noticed 
that "import socket" module will dynload libcrypto.so.0.9.8 and
libssl.so.0.9.8, which are quite big.

Currently, Python SSL support is provided through the package 
"python-io". I propose to remove 
"${libdir}/python2.5/lib-dynload/_ssl.so" from FILES_python-io and to 
put it in a new package called, for example, "python-ssl".

This way, you can selectively enable/disable SSL support by installing 
removing python-ssl package. This allows to save memory in situations 
where you need Python socket module without SSL support.

Here is an example of memory usage (using pmap), resp. without and with 
python-ssl installed. A Python interpreter is started and the module 
socket is imported.
==================================================================
--- import-socket-without-ssl.txt	Fri Nov  7 09:58:35 2008
+++ import-socket-with-ssl.txt	Fri Nov  7 09:59:12 2008
@@ -1,8 +1,8 @@
-1961:   python
+1977:   python
  Address   Kbytes     RSS    Anon  Locked Mode   Mapping
  00008000       4       -       -       - r-x--  python
  00010000       4       -       -       - rw---  python
-00011000     524       -       -       - rwx--    [ anon ]
+00011000     536       -       -       - rwx--    [ anon ]
  40000000     112       -       -       - r-x--  ld-2.6.1.so
  4001c000      12       -       -       - rw---    [ anon ]
  40023000       8       -       -       - rw---  ld-2.6.1.so
@@ -36,6 +36,19 @@
  403d4000      48       -       -       - r-x--  _socket.so
  403e0000      32       -       -       - -----  _socket.so
  403e8000      12       -       -       - rw---  _socket.so
-bef97000      84       -       -       - rwx--    [ stack ]
+403eb000      16       -       -       - r-x--  _ssl.so
+403ef000      28       -       -       - -----  _ssl.so
+403f6000       4       -       -       - rw---  _ssl.so
+403f7000     224       -       -       - r-x--  libssl.so.0.9.8
+4042f000      28       -       -       - -----  libssl.so.0.9.8
+40436000      16       -       -       - rw---  libssl.so.0.9.8
+4043a000    1108       -       -       - r-x--  libcrypto.so.0.9.8
+4054f000      28       -       -       - -----  libcrypto.so.0.9.8
+40556000      84       -       -       - rw---  libcrypto.so.0.9.8
+4056b000      12       -       -       - rw---    [ anon ]
+4056e000      40       -       -       - r-x--  libgcc_s.so.1
+40578000      28       -       -       - -----  libgcc_s.so.1
+4057f000       4       -       -       - rw---  libgcc_s.so.1
+be91d000      84       -       -       - rwx--    [ stack ]
  -------- ------- ------- ------- -------
-total kB    4612       -       -       -
+total kB    6244       -       -       -
=======================================================================

The attached patch contains the modifications to 
generate-manifest-2.5.py in order to move SSL support into a new package 
called "python-ssl". In this case, other Python package dependency list 
should of course be adjusted accordingly when SSL support is needed:

    s/RDEPENDS="python-io"/RDEPENDS="python-io python-ssl"/

Best Regards,
-- 
Cyril
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0087-Python-2.5-provide-lib-dynload-_ssl.so-in-a-new-pac.patch
Type: text/x-patch
Size: 12256 bytes
Desc: not available
URL: <http://lists.openembedded.org/pipermail/openembedded-devel/attachments/20081107/a1e69d89/attachment-0002.bin>


More information about the Openembedded-devel mailing list