This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients barry, cstratak, doko, eric.smith, koobs, martin.panter, mdk, nascheme, pitrou, serge-sans-paille, twouters, vstinner, xdegaye, yan12125
Date 2018-10-16.12:57:35
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1539694656.03.0.788709270274.issue34814@psf.upfronthosting.co.za>
In-reply-to
Content
I wrote the PR 9912 to ensure that C extensions are never linked to libpython.

I tested my change using:

git clean -fdx
./configure --with-pydebug --enable-shared
make
for SO in build/lib.*/*.so Modules/*.so; do ldd $SO|grep libpython; done
# grep must not display anything


I tested 3 configurations on my Fedora 28 (Linux):

* ./configure --with-pydebug --enable-shared: NEVER linked
* Modified Modules/Setup (*) with ./configure --with-pydebug --enable-shared: NEVER linked
* ./configure --with-pydebug: NEVER linked (well, it doesn't use libpython, but I wanted to test all cases :-))


(*) I modified Modules/Setup to compile 37 C extensions as shared libraries using Makefile. Extract of Modules/Setup:

errno errnomodule.c			# posix (UNIX) errno values
pwd pwdmodule.c				# this is needed to find out the user's home dir
_sre _sre.c				# Fredrik Lundh's new regular expressions
_codecs _codecsmodule.c			# access to the builtin codecs and codec registry
_weakref _weakref.c			# weak references
_operator _operator.c	        	# operator.add() and similar goodies
_collections _collectionsmodule.c	# Container types
_abc _abc.c				# Abstract base classes
itertools itertoolsmodule.c		# Functions creating iterators for efficient looping
atexit atexitmodule.c			# Register functions to be run at interpreter-shutdown
_stat _stat.c				# stat.h interface
_locale _localemodule.c  # -lintl
faulthandler faulthandler.c
_tracemalloc _tracemalloc.c hashtable.c
_symtable symtablemodule.c
readline readline.c -lreadline -ltermcap
array arraymodule.c	# array objects
cmath cmathmodule.c _math.c # -lm # complex math library functions
math mathmodule.c _math.c # -lm # math library functions, e.g. sin()
_contextvars _contextvarsmodule.c  # Context Variables
_struct _struct.c	# binary structure packing/unpacking
_weakref _weakref.c	# basic weak reference support
_testcapi _testcapimodule.c    # Python C API test module
_random _randommodule.c	# Random number generator
_pickle _pickle.c	# pickle accelerator
_datetime _datetimemodule.c	# datetime accelerator
_bisect _bisectmodule.c	# Bisection algorithms
_heapq _heapqmodule.c	# Heap queue algorithm
_asyncio _asynciomodule.c  # Fast asyncio Future
unicodedata unicodedata.c    # static Unicode character database
fcntl fcntlmodule.c	# fcntl(2) and ioctl(2)
spwd spwdmodule.c		# spwd(3)
grp grpmodule.c		# grp(3)
select selectmodule.c	# select(2); not on ancient System V
mmap mmapmodule.c
_csv _csv.c
_socket socketmodule.c
_crypt _cryptmodule.c # -lcrypt	# crypt(3); needs -lcrypt on some systems
termios termios.c	# Steen Lumholt's termios module
resource resource.c	# Jeremy Hylton's rlimit interface
_posixsubprocess _posixsubprocess.c  # POSIX subprocess module helper
audioop audioop.c	# Operations on audio samples
_md5 md5module.c
_sha1 sha1module.c
_sha256 sha256module.c
_sha512 sha512module.c
syslog syslogmodule.c		# syslog daemon interface
_gdbm _gdbmmodule.c -I/usr/local/include -L/usr/local/lib -lgdbm
binascii binascii.c
parser parsermodule.c
zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz
xxsubtype xxsubtype.c
History
Date User Action Args
2018-10-16 12:57:36vstinnersetrecipients: + vstinner, twouters, barry, nascheme, doko, pitrou, eric.smith, xdegaye, martin.panter, koobs, yan12125, serge-sans-paille, mdk, cstratak
2018-10-16 12:57:36vstinnersetmessageid: <1539694656.03.0.788709270274.issue34814@psf.upfronthosting.co.za>
2018-10-16 12:57:36vstinnerlinkissue34814 messages
2018-10-16 12:57:35vstinnercreate