[Python-Dev] GPL'd python code vs Python2.6 linked against OpenSSL

Antoine Pitrou solipsis at pitrou.net
Thu Mar 10 00:32:20 CET 2011


On Wed, 9 Mar 2011 18:20:01 -0500
James Y Knight <foom at fuhm.net> wrote:
> It's well known that OpenSSL is incompatible with the GPL. [1] Python (from 2.6) is *always* linked against openssl, instead of waiting for you to "import ssl".
> 
> Doesn't this mean it's now impossible (rather, a license violation) to distribute a GPL'd python program (or to use a GPL'd library in your python program)? This seems like a problem...

A Python program is not a derivative of the Python interpreter any more
than a C program is a derivative of gcc (or any other compiler).

That said, with a non-shared build of Python 3.x:

$ ldd ./python
	linux-vdso.so.1 =>  (0x00007fffa574d000)
	libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fd9a56d2000)
	libdl.so.2 => /lib64/libdl.so.2 (0x00007fd9a54ce000)
	libutil.so.1 => /lib64/libutil.so.1 (0x00007fd9a52cb000)
	libm.so.6 => /lib64/libm.so.6 (0x00007fd9a5049000)
	libc.so.6 => /lib64/libc.so.6 (0x00007fd9a4cdd000)
	/lib64/ld-linux-x86-64.so.2 (0x00007fd9a58ee000)

$ objdump -p ./python | grep NEEDED
  NEEDED               libpthread.so.0
  NEEDED               libdl.so.2
  NEEDED               libutil.so.1
  NEEDED               libm.so.6
  NEEDED               libc.so.6

Also, with the system Python 2.6 shipped on a Mandriva distribution:

$ ldd /usr/bin/python
	linux-vdso.so.1 =>  (0x00007fff8456d000)
	libpython2.6.so.1.0 => /usr/lib64/libpython2.6.so.1.0
(0x00007f1a0b1e2000) libc.so.6 => /lib64/libc.so.6 (0x00007f1a0ae76000)
	libdl.so.2 => /lib64/libdl.so.2 (0x00007f1a0ac72000)
	libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f1a0aa56000)
	libutil.so.1 => /lib64/libutil.so.1 (0x00007f1a0a853000)
	libm.so.6 => /lib64/libm.so.6 (0x00007f1a0a5d1000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f1a0b583000)

$ objdump -p /usr/bin/python | grep NEEDED
  NEEDED               libpython2.6.so.1.0
  NEEDED               libc.so.6


So I'm not sure which build options led to that result.

Regards

Antoine.




More information about the Python-Dev mailing list