Skip to content

Commit d5ea053

Browse files
committed
unix: don't export dependency symbols on macOS
This commit follows up on recent work we did for Linux/ELF around not exporting dependency symbols and applies it to Apple/Mach-O. We change compiler flags so symbols are hidden by default. We also teach the linker to make symbols in library dependencies hidden by default to prevent them from being exported / dynamic in the resulting Mach-O binary. Mach-O linker support for controlling symbol visibility is different from ELF. We had to utilize an `ld64` specific argument (`-hidden-l<lib>`) to force symbol visibility on a per library basis. The Rust validation code for Mach-O has been updated to verify we aren't exporting dependency symbols and are properly exporting Python symbols, just like we did for ELF. Distributions built before this fail the new validation. This should finish the implementation of #114. Windows is still not addressed. We can file a separate issue to track Windows.
1 parent f33217a commit d5ea053

7 files changed

+120
-48
lines changed

cpython-unix/static-modules.3.10.macos

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,40 +3,40 @@
33
# setup.py and what was observed to execute in a normal build via setup.py.
44
# We should audit this every time we upgrade CPython.
55

6-
_bz2 _bz2module.c -lbz2
6+
_bz2 _bz2module.c -Xlinker -hidden-lbz2
77
_crypt _cryptmodule.c
88
# We link against the system ncurses on macOS for simplicity. There is no ncursesw
99
# but it is Unicode aware.
10-
_curses _cursesmodule.c -DHAVE_NCURSESW=1 -D_XOPEN_SOURCE_EXTENDED=1 -lncurses
11-
_curses_panel _curses_panel.c -DHAVE_NCURSESW=1 -D_XOPEN_SOURCE_EXTENDED=1 -lpanel -lncurses
12-
_ctypes _ctypes/_ctypes.c _ctypes/callbacks.c _ctypes/callproc.c _ctypes/darwin/dlfcn_simple.c _ctypes/malloc_closure.c _ctypes/stgdict.c _ctypes/cfield.c -DMACOSX -DUSING_MALLOC_CLOSURE_DOT_C=1 -DHAVE_FFI_PREP_CIF_VAR=1 -DHAVE_FFI_PREP_CLOSURE_LOC=1 -DHAVE_FFI_CLOSURE_ALLOC=1 -I_ctypes/darwin -lffi -ldl
10+
_curses _cursesmodule.c -DHAVE_NCURSESW=1 -D_XOPEN_SOURCE_EXTENDED=1 -Xlinker -hidden-lncurses
11+
_curses_panel _curses_panel.c -DHAVE_NCURSESW=1 -D_XOPEN_SOURCE_EXTENDED=1 -Xlinker -hidden-lpanel -Xlinker -hidden-lncurses
12+
_ctypes _ctypes/_ctypes.c _ctypes/callbacks.c _ctypes/callproc.c _ctypes/darwin/dlfcn_simple.c _ctypes/malloc_closure.c _ctypes/stgdict.c _ctypes/cfield.c -DMACOSX -DUSING_MALLOC_CLOSURE_DOT_C=1 -DHAVE_FFI_PREP_CIF_VAR=1 -DHAVE_FFI_PREP_CLOSURE_LOC=1 -DHAVE_FFI_CLOSURE_ALLOC=1 -I_ctypes/darwin -Xlinker -hidden-lffi -ldl
1313
_ctypes_test _ctypes/_ctypes_test.c -lm
1414
_decimal _decimal/_decimal.c _decimal/libmpdec/basearith.c _decimal/libmpdec/constants.c _decimal/libmpdec/context.c _decimal/libmpdec/convolute.c _decimal/libmpdec/crt.c _decimal/libmpdec/difradix2.c _decimal/libmpdec/fnt.c _decimal/libmpdec/fourstep.c _decimal/libmpdec/io.c _decimal/libmpdec/mpalloc.c _decimal/libmpdec/mpdecimal.c _decimal/libmpdec/numbertheory.c _decimal/libmpdec/sixstep.c _decimal/libmpdec/transpose.c -DUNIVERSAL=1 -IModules/_decimal/libmpdec
1515
# macOS ships with an ndbm implementation in libSystem. CPython's setup.py will
1616
# use it unless an ndbl or gdbm_compat library is present.
1717
_dbm _dbmmodule.c -DHAVE_NDBM_H
1818
_elementtree _elementtree.c -DHAVE_EXPAT_CONFIG_H=1 -DXML_POOR_ENTROPY=1 -DUSE_PYEXPAT_CAPI -IModules/expat
19-
_hashlib _hashopenssl.c -lcrypto
19+
_hashlib _hashopenssl.c -Xlinker -hidden-lcrypto
2020
_json _json.c
2121
_lsprof _lsprof.c rotatingtree.c
22-
_lzma _lzmamodule.c -llzma
22+
_lzma _lzmamodule.c -Xlinker -hidden-llzma
2323
# TODO check setup.py logic for semaphore.c and possibly fix missing
2424
# dependency.
2525
_multiprocessing _multiprocessing/multiprocessing.c _multiprocessing/semaphore.c
2626
_opcode _opcode.c
2727
_posixshmem _multiprocessing/posixshmem.c -IModules/_multiprocessing
2828
_queue _queuemodule.c
2929
_scproxy _scproxy.c -framework SystemConfiguration -framework CoreFoundation
30-
_sqlite3 _sqlite/cache.c _sqlite/connection.c _sqlite/cursor.c _sqlite/microprotocols.c _sqlite/module.c _sqlite/prepare_protocol.c _sqlite/row.c _sqlite/statement.c _sqlite/util.c -IModules/_sqlite -DMODULE_NAME=\"sqlite3\" -DSQLITE_OMIT_LOAD_EXTENSION=1 -lsqlite3
31-
_ssl _ssl.c -lssl -lcrypto
30+
_sqlite3 _sqlite/cache.c _sqlite/connection.c _sqlite/cursor.c _sqlite/microprotocols.c _sqlite/module.c _sqlite/prepare_protocol.c _sqlite/row.c _sqlite/statement.c _sqlite/util.c -IModules/_sqlite -DMODULE_NAME=\"sqlite3\" -DSQLITE_OMIT_LOAD_EXTENSION=1 -Xlinker -hidden-lsqlite3
31+
_ssl _ssl.c -Xlinker -hidden-lssl -Xlinker -hidden-lcrypto
3232
_testbuffer _testbuffer.c
3333
_testimportmultiple _testimportmultiple.c
3434
_testinternalcapi _testinternalcapi.c -DPy_BUILD_CORE_MODULE
3535
_testmultiphase _testmultiphase.c
3636
# CoreFoundation isn't a directory dependency but is a dependency of libtcl and libtk.
37-
_tkinter _tkinter.c tkappinit.c -DWITH_APPINIT -framework AppKit -framework ApplicationServices -framework Carbon -framework CoreFoundation -framework CoreServices -framework CoreGraphics -framework IOKit -framework QuartzCore -ltcl8.6 -ltk8.6
38-
_uuid _uuidmodule.c -luuid
37+
_tkinter _tkinter.c tkappinit.c -DWITH_APPINIT -framework AppKit -framework ApplicationServices -framework Carbon -framework CoreFoundation -framework CoreServices -framework CoreGraphics -framework IOKit -framework QuartzCore -Xlinker -hidden-ltcl8.6 -Xlinker -hidden-ltk8.6
38+
_uuid _uuidmodule.c -Xlinker -hidden-luuid
3939
_xxsubinterpreters _xxsubinterpretersmodule.c
4040
_xxtestfuzz _xxtestfuzz/_xxtestfuzz.c _xxtestfuzz/fuzzer.c
4141
pyexpat pyexpat.c expat/xmlparse.c expat/xmlrole.c expat/xmltok.c -DHAVE_EXPAT_CONFIG_H=1 -DXML_POOR_ENTROPY=1 -DUSE_PYEXPAT_CAPI -IModules/expat
42-
readline readline.c -ledit -lncurses
42+
readline readline.c -Xlinker -hidden-ledit -Xlinker -hidden-lncurses

cpython-unix/static-modules.3.8.macos

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,33 @@
33
# setup.py and what was observed to execute in a normal build via setup.py.
44
# We should audit this every time we upgrade CPython.
55

6-
_bz2 _bz2module.c -lbz2
6+
_bz2 _bz2module.c -Xlinker -hidden-lbz2
77
_crypt _cryptmodule.c
88
# We link against the system ncurses on macOS for simplicity. There is no ncursesw
99
# but it is Unicode aware.
10-
_curses _cursesmodule.c -DHAVE_NCURSESW=1 -D_XOPEN_SOURCE_EXTENDED=1 -lncurses
11-
_curses_panel _curses_panel.c -DHAVE_NCURSESW=1 -D_XOPEN_SOURCE_EXTENDED=1 -lpanel -lncurses
12-
_ctypes _ctypes/_ctypes.c _ctypes/callbacks.c _ctypes/callproc.c _ctypes/darwin/dlfcn_simple.c _ctypes/malloc_closure.c _ctypes/stgdict.c _ctypes/cfield.c -DMACOSX -DUSING_MALLOC_CLOSURE_DOT_C=1 -DHAVE_FFI_PREP_CIF_VAR=1 -DHAVE_FFI_PREP_CLOSURE_LOC=1 -DHAVE_FFI_CLOSURE_ALLOC=1 -I_ctypes/darwin -lffi -ldl
10+
_curses _cursesmodule.c -DHAVE_NCURSESW=1 -D_XOPEN_SOURCE_EXTENDED=1 -Xlinker -hidden-lncurses
11+
_curses_panel _curses_panel.c -DHAVE_NCURSESW=1 -D_XOPEN_SOURCE_EXTENDED=1 -Xlinker -hidden-lpanel -Xlinker -hidden-lncurses
12+
_ctypes _ctypes/_ctypes.c _ctypes/callbacks.c _ctypes/callproc.c _ctypes/darwin/dlfcn_simple.c _ctypes/malloc_closure.c _ctypes/stgdict.c _ctypes/cfield.c -DMACOSX -DUSING_MALLOC_CLOSURE_DOT_C=1 -DHAVE_FFI_PREP_CIF_VAR=1 -DHAVE_FFI_PREP_CLOSURE_LOC=1 -DHAVE_FFI_CLOSURE_ALLOC=1 -I_ctypes/darwin -Xlinker -hidden-lffi -ldl
1313
_decimal _decimal/_decimal.c _decimal/libmpdec/basearith.c _decimal/libmpdec/constants.c _decimal/libmpdec/context.c _decimal/libmpdec/convolute.c _decimal/libmpdec/crt.c _decimal/libmpdec/difradix2.c _decimal/libmpdec/fnt.c _decimal/libmpdec/fourstep.c _decimal/libmpdec/io.c _decimal/libmpdec/memory.c _decimal/libmpdec/mpdecimal.c _decimal/libmpdec/numbertheory.c _decimal/libmpdec/sixstep.c _decimal/libmpdec/transpose.c -DUNIVERSAL=1 -IModules/_decimal/libmpdec
1414
# macOS ships with an ndbm implementation in libSystem. CPython's setup.py will
1515
# use it unless an ndbl or gdbm_compat library is present.
1616
_dbm _dbmmodule.c -DHAVE_NDBM_H
1717
_elementtree _elementtree.c -DHAVE_EXPAT_CONFIG_H=1 -DXML_POOR_ENTROPY=1 -DUSE_PYEXPAT_CAPI -IModules/expat
18-
_hashlib _hashopenssl.c -lssl -lcrypto
18+
_hashlib _hashopenssl.c -Xlinker -hidden-lssl -Xlinker -hidden-lcrypto
1919
_json _json.c
2020
_lsprof _lsprof.c rotatingtree.c
21-
_lzma _lzmamodule.c -llzma
21+
_lzma _lzmamodule.c -Xlinker -hidden-llzma
2222
# TODO check setup.py logic for semaphore.c and possibly fix missing
2323
# dependency.
2424
_multiprocessing _multiprocessing/multiprocessing.c _multiprocessing/semaphore.c
2525
_opcode _opcode.c
2626
_posixshmem _multiprocessing/posixshmem.c -IModules/_multiprocessing
2727
_queue _queuemodule.c
2828
_scproxy _scproxy.c -framework SystemConfiguration -framework CoreFoundation
29-
_sqlite3 _sqlite/cache.c _sqlite/connection.c _sqlite/cursor.c _sqlite/microprotocols.c _sqlite/module.c _sqlite/prepare_protocol.c _sqlite/row.c _sqlite/statement.c _sqlite/util.c -IModules/_sqlite -DMODULE_NAME=\"sqlite3\" -DSQLITE_OMIT_LOAD_EXTENSION=1 -lsqlite3
30-
_ssl _ssl.c -lssl -lcrypto
29+
_sqlite3 _sqlite/cache.c _sqlite/connection.c _sqlite/cursor.c _sqlite/microprotocols.c _sqlite/module.c _sqlite/prepare_protocol.c _sqlite/row.c _sqlite/statement.c _sqlite/util.c -IModules/_sqlite -DMODULE_NAME=\"sqlite3\" -DSQLITE_OMIT_LOAD_EXTENSION=1 -Xlinker -hidden-lsqlite3
30+
_ssl _ssl.c -Xlinker -hidden-lssl -Xlinker -hidden-lcrypto
3131
# CoreFoundation isn't a directory dependency but is a dependency of libtcl and libtk.
32-
_tkinter _tkinter.c tkappinit.c -DWITH_APPINIT -framework AppKit -framework ApplicationServices -framework Carbon -framework CoreFoundation -framework CoreServices -framework CoreGraphics -framework IOKit -framework QuartzCore -ltcl8.6 -ltk8.6
33-
_uuid _uuidmodule.c -luuid
32+
_tkinter _tkinter.c tkappinit.c -DWITH_APPINIT -framework AppKit -framework ApplicationServices -framework Carbon -framework CoreFoundation -framework CoreServices -framework CoreGraphics -framework IOKit -framework QuartzCore -Xlinker -hidden-ltcl8.6 -Xlinker -hidden-ltk8.6
33+
_uuid _uuidmodule.c -Xlinker -hidden-luuid
3434
pyexpat pyexpat.c expat/xmlparse.c expat/xmlrole.c expat/xmltok.c -DHAVE_EXPAT_CONFIG_H=1 -DXML_POOR_ENTROPY=1 -DUSE_PYEXPAT_CAPI -IModules/expat
35-
readline readline.c -ledit -lncurses
35+
readline readline.c -Xlinker -hidden-ledit -Xlinker -hidden-lncurses

cpython-unix/static-modules.3.9.aarch64-apple-ios

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,23 @@
33
# setup.py and what was observed to execute in a normal build via setup.py.
44
# We should audit this every time we upgrade CPython.
55

6-
_bz2 _bz2module.c -lbz2
6+
_bz2 _bz2module.c -Wl,-hidden-lbz2
77
_crypt _cryptmodule.c
8-
_ctypes _ctypes/_ctypes.c _ctypes/callbacks.c _ctypes/callproc.c _ctypes/darwin/dlfcn_simple.c _ctypes/malloc_closure.c _ctypes/stgdict.c _ctypes/cfield.c -DMACOSX -DUSING_MALLOC_CLOSURE_DOT_C=1 -DHAVE_FFI_PREP_CIF_VAR=1 -DHAVE_FFI_PREP_CLOSURE_LOC=1 -DHAVE_FFI_CLOSURE_ALLOC=1 -I_ctypes/darwin -lffi -ldl
8+
_ctypes _ctypes/_ctypes.c _ctypes/callbacks.c _ctypes/callproc.c _ctypes/darwin/dlfcn_simple.c _ctypes/malloc_closure.c _ctypes/stgdict.c _ctypes/cfield.c -DMACOSX -DUSING_MALLOC_CLOSURE_DOT_C=1 -DHAVE_FFI_PREP_CIF_VAR=1 -DHAVE_FFI_PREP_CLOSURE_LOC=1 -DHAVE_FFI_CLOSURE_ALLOC=1 -I_ctypes/darwin -Wl,-hidden-lffi -ldl
99
_decimal _decimal/_decimal.c _decimal/libmpdec/basearith.c _decimal/libmpdec/constants.c _decimal/libmpdec/context.c _decimal/libmpdec/convolute.c _decimal/libmpdec/crt.c _decimal/libmpdec/difradix2.c _decimal/libmpdec/fnt.c _decimal/libmpdec/fourstep.c _decimal/libmpdec/io.c _decimal/libmpdec/mpalloc.c _decimal/libmpdec/mpdecimal.c _decimal/libmpdec/numbertheory.c _decimal/libmpdec/sixstep.c _decimal/libmpdec/transpose.c -DUNIVERSAL=1 -IModules/_decimal/libmpdec
1010
# macOS ships with an ndbm implementation in libSystem. CPython's setup.py will
1111
# use it unless an ndbl or gdbm_compat library is present.
1212
_dbm _dbmmodule.c -DHAVE_NDBM_H
1313
_elementtree _elementtree.c -DHAVE_EXPAT_CONFIG_H=1 -DXML_POOR_ENTROPY=1 -DUSE_PYEXPAT_CAPI -IModules/expat
14-
_hashlib _hashopenssl.c -lssl -lcrypto
14+
_hashlib _hashopenssl.c -Wl,-hidden-lssl -Wl,-hidden-lcrypto
1515
_json _json.c
1616
_lsprof _lsprof.c rotatingtree.c
17-
_lzma _lzmamodule.c -llzma
17+
_lzma _lzmamodule.c -Wl,-hidden-llzma
1818
_multiprocessing _multiprocessing/multiprocessing.c _multiprocessing/semaphore.c
1919
_opcode _opcode.c
2020
_posixshmem _multiprocessing/posixshmem.c -IModules/_multiprocessing
2121
_queue _queuemodule.c
22-
_sqlite3 _sqlite/cache.c _sqlite/connection.c _sqlite/cursor.c _sqlite/microprotocols.c _sqlite/module.c _sqlite/prepare_protocol.c _sqlite/row.c _sqlite/statement.c _sqlite/util.c -IModules/_sqlite -DMODULE_NAME=\"sqlite3\" -DSQLITE_OMIT_LOAD_EXTENSION=1 -lsqlite3
23-
_ssl _ssl.c -lssl -lcrypto
22+
_sqlite3 _sqlite/cache.c _sqlite/connection.c _sqlite/cursor.c _sqlite/microprotocols.c _sqlite/module.c _sqlite/prepare_protocol.c _sqlite/row.c _sqlite/statement.c _sqlite/util.c -IModules/_sqlite -DMODULE_NAME=\"sqlite3\" -DSQLITE_OMIT_LOAD_EXTENSION=1 -Wl,-hidden-lsqlite3
23+
_ssl _ssl.c -Wl,-hidden-lssl -Wl,-hidden-lcrypto
2424
_uuid _uuidmodule.c
2525
pyexpat pyexpat.c expat/xmlparse.c expat/xmlrole.c expat/xmltok.c -DHAVE_EXPAT_CONFIG_H=1 -DXML_POOR_ENTROPY=1 -DUSE_PYEXPAT_CAPI -IModules/expat

cpython-unix/static-modules.3.9.macos

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,40 +3,40 @@
33
# setup.py and what was observed to execute in a normal build via setup.py.
44
# We should audit this every time we upgrade CPython.
55

6-
_bz2 _bz2module.c -lbz2
6+
_bz2 _bz2module.c -Xlinker -hidden-lbz2
77
_crypt _cryptmodule.c
88
# We link against the system ncurses on macOS for simplicity. There is no ncursesw
99
# but it is Unicode aware.
10-
_curses _cursesmodule.c -DHAVE_NCURSESW=1 -D_XOPEN_SOURCE_EXTENDED=1 -lncurses
11-
_curses_panel _curses_panel.c -DHAVE_NCURSESW=1 -D_XOPEN_SOURCE_EXTENDED=1 -lpanel -lncurses
12-
_ctypes _ctypes/_ctypes.c _ctypes/callbacks.c _ctypes/callproc.c _ctypes/darwin/dlfcn_simple.c _ctypes/malloc_closure.c _ctypes/stgdict.c _ctypes/cfield.c -DMACOSX -DUSING_MALLOC_CLOSURE_DOT_C=1 -DHAVE_FFI_PREP_CIF_VAR=1 -DHAVE_FFI_PREP_CLOSURE_LOC=1 -DHAVE_FFI_CLOSURE_ALLOC=1 -I_ctypes/darwin -lffi -ldl
10+
_curses _cursesmodule.c -DHAVE_NCURSESW=1 -D_XOPEN_SOURCE_EXTENDED=1 -Xlinker -hidden-lncurses
11+
_curses_panel _curses_panel.c -DHAVE_NCURSESW=1 -D_XOPEN_SOURCE_EXTENDED=1 -Xlinker -hidden-lpanel -Xlinker -hidden-lncurses
12+
_ctypes _ctypes/_ctypes.c _ctypes/callbacks.c _ctypes/callproc.c _ctypes/darwin/dlfcn_simple.c _ctypes/malloc_closure.c _ctypes/stgdict.c _ctypes/cfield.c -DMACOSX -DUSING_MALLOC_CLOSURE_DOT_C=1 -DHAVE_FFI_PREP_CIF_VAR=1 -DHAVE_FFI_PREP_CLOSURE_LOC=1 -DHAVE_FFI_CLOSURE_ALLOC=1 -I_ctypes/darwin -Xlinker -hidden-lffi -ldl
1313
_ctypes_test _ctypes/_ctypes_test.c -lm
1414
_decimal _decimal/_decimal.c _decimal/libmpdec/basearith.c _decimal/libmpdec/constants.c _decimal/libmpdec/context.c _decimal/libmpdec/convolute.c _decimal/libmpdec/crt.c _decimal/libmpdec/difradix2.c _decimal/libmpdec/fnt.c _decimal/libmpdec/fourstep.c _decimal/libmpdec/io.c _decimal/libmpdec/mpalloc.c _decimal/libmpdec/mpdecimal.c _decimal/libmpdec/numbertheory.c _decimal/libmpdec/sixstep.c _decimal/libmpdec/transpose.c -DUNIVERSAL=1 -IModules/_decimal/libmpdec
1515
# macOS ships with an ndbm implementation in libSystem. CPython's setup.py will
1616
# use it unless an ndbl or gdbm_compat library is present.
1717
_dbm _dbmmodule.c -DHAVE_NDBM_H
1818
_elementtree _elementtree.c -DHAVE_EXPAT_CONFIG_H=1 -DXML_POOR_ENTROPY=1 -DUSE_PYEXPAT_CAPI -IModules/expat
19-
_hashlib _hashopenssl.c -lssl -lcrypto
19+
_hashlib _hashopenssl.c -Xlinker -hidden-lssl -Xlinker -hidden-lcrypto
2020
_json _json.c
2121
_lsprof _lsprof.c rotatingtree.c
22-
_lzma _lzmamodule.c -llzma
22+
_lzma _lzmamodule.c -Xlinker -hidden-llzma
2323
# TODO check setup.py logic for semaphore.c and possibly fix missing
2424
# dependency.
2525
_multiprocessing _multiprocessing/multiprocessing.c _multiprocessing/semaphore.c
2626
_opcode _opcode.c
2727
_posixshmem _multiprocessing/posixshmem.c -IModules/_multiprocessing
2828
_queue _queuemodule.c
2929
_scproxy _scproxy.c -framework SystemConfiguration -framework CoreFoundation
30-
_sqlite3 _sqlite/cache.c _sqlite/connection.c _sqlite/cursor.c _sqlite/microprotocols.c _sqlite/module.c _sqlite/prepare_protocol.c _sqlite/row.c _sqlite/statement.c _sqlite/util.c -IModules/_sqlite -DMODULE_NAME=\"sqlite3\" -DSQLITE_OMIT_LOAD_EXTENSION=1 -lsqlite3
31-
_ssl _ssl.c -lssl -lcrypto
30+
_sqlite3 _sqlite/cache.c _sqlite/connection.c _sqlite/cursor.c _sqlite/microprotocols.c _sqlite/module.c _sqlite/prepare_protocol.c _sqlite/row.c _sqlite/statement.c _sqlite/util.c -IModules/_sqlite -DMODULE_NAME=\"sqlite3\" -DSQLITE_OMIT_LOAD_EXTENSION=1 -Xlinker -hidden-lsqlite3
31+
_ssl _ssl.c -Xlinker -hidden-lssl -Xlinker -hidden-lcrypto
3232
_testbuffer _testbuffer.c
3333
_testimportmultiple _testimportmultiple.c
3434
_testinternalcapi _testinternalcapi.c -DPy_BUILD_CORE_MODULE
3535
_testmultiphase _testmultiphase.c
3636
# CoreFoundation isn't a directory dependency but is a dependency of libtcl and libtk.
37-
_tkinter _tkinter.c tkappinit.c -DWITH_APPINIT -framework AppKit -framework ApplicationServices -framework Carbon -framework CoreFoundation -framework CoreServices -framework CoreGraphics -framework IOKit -framework QuartzCore -ltcl8.6 -ltk8.6
38-
_uuid _uuidmodule.c -luuid
37+
_tkinter _tkinter.c tkappinit.c -DWITH_APPINIT -framework AppKit -framework ApplicationServices -framework Carbon -framework CoreFoundation -framework CoreServices -framework CoreGraphics -framework IOKit -framework QuartzCore -Xlinker -hidden-ltcl8.6 -Xlinker -hidden-ltk8.6
38+
_uuid _uuidmodule.c -Xlinker -hidden-luuid
3939
_xxsubinterpreters _xxsubinterpretersmodule.c
4040
_xxtestfuzz _xxtestfuzz/_xxtestfuzz.c _xxtestfuzz/fuzzer.c
4141
pyexpat pyexpat.c expat/xmlparse.c expat/xmlrole.c expat/xmltok.c -DHAVE_EXPAT_CONFIG_H=1 -DXML_POOR_ENTROPY=1 -DUSE_PYEXPAT_CAPI -IModules/expat
42-
readline readline.c -ledit -lncurses
42+
readline readline.c -Xlinker -hidden-ledit -Xlinker -hidden-lncurses

cpython-unix/static-modules.3.9.x86_64-apple-ios

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,23 @@
33
# setup.py and what was observed to execute in a normal build via setup.py.
44
# We should audit this every time we upgrade CPython.
55

6-
_bz2 _bz2module.c -lbz2
6+
_bz2 _bz2module.c -Wl,-hidden-lbz2
77
_crypt _cryptmodule.c
8-
_ctypes _ctypes/_ctypes.c _ctypes/callbacks.c _ctypes/callproc.c _ctypes/darwin/dlfcn_simple.c _ctypes/malloc_closure.c _ctypes/stgdict.c _ctypes/cfield.c -DMACOSX -DUSING_MALLOC_CLOSURE_DOT_C=1 -DHAVE_FFI_PREP_CIF_VAR=1 -DHAVE_FFI_PREP_CLOSURE_LOC=1 -DHAVE_FFI_CLOSURE_ALLOC=1 -I_ctypes/darwin -lffi -ldl
8+
_ctypes _ctypes/_ctypes.c _ctypes/callbacks.c _ctypes/callproc.c _ctypes/darwin/dlfcn_simple.c _ctypes/malloc_closure.c _ctypes/stgdict.c _ctypes/cfield.c -DMACOSX -DUSING_MALLOC_CLOSURE_DOT_C=1 -DHAVE_FFI_PREP_CIF_VAR=1 -DHAVE_FFI_PREP_CLOSURE_LOC=1 -DHAVE_FFI_CLOSURE_ALLOC=1 -I_ctypes/darwin -Wl,-hidden-lffi -ldl
99
_decimal _decimal/_decimal.c _decimal/libmpdec/basearith.c _decimal/libmpdec/constants.c _decimal/libmpdec/context.c _decimal/libmpdec/convolute.c _decimal/libmpdec/crt.c _decimal/libmpdec/difradix2.c _decimal/libmpdec/fnt.c _decimal/libmpdec/fourstep.c _decimal/libmpdec/io.c _decimal/libmpdec/mpalloc.c _decimal/libmpdec/mpdecimal.c _decimal/libmpdec/numbertheory.c _decimal/libmpdec/sixstep.c _decimal/libmpdec/transpose.c -DUNIVERSAL=1 -IModules/_decimal/libmpdec
1010
# macOS ships with an ndbm implementation in libSystem. CPython's setup.py will
1111
# use it unless an ndbl or gdbm_compat library is present.
1212
_dbm _dbmmodule.c -DHAVE_NDBM_H
1313
_elementtree _elementtree.c -DHAVE_EXPAT_CONFIG_H=1 -DXML_POOR_ENTROPY=1 -DUSE_PYEXPAT_CAPI -IModules/expat
14-
_hashlib _hashopenssl.c -lssl -lcrypto
14+
_hashlib _hashopenssl.c -Wl,-hidden-lssl -Wl,-hidden-lcrypto
1515
_json _json.c
1616
_lsprof _lsprof.c rotatingtree.c
17-
_lzma _lzmamodule.c -llzma
17+
_lzma _lzmamodule.c -Wl,-hidden-llzma
1818
_multiprocessing _multiprocessing/multiprocessing.c _multiprocessing/semaphore.c
1919
_opcode _opcode.c
2020
_posixshmem _multiprocessing/posixshmem.c -IModules/_multiprocessing
2121
_queue _queuemodule.c
22-
_sqlite3 _sqlite/cache.c _sqlite/connection.c _sqlite/cursor.c _sqlite/microprotocols.c _sqlite/module.c _sqlite/prepare_protocol.c _sqlite/row.c _sqlite/statement.c _sqlite/util.c -IModules/_sqlite -DMODULE_NAME=\"sqlite3\" -DSQLITE_OMIT_LOAD_EXTENSION=1 -lsqlite3
23-
_ssl _ssl.c -lssl -lcrypto
22+
_sqlite3 _sqlite/cache.c _sqlite/connection.c _sqlite/cursor.c _sqlite/microprotocols.c _sqlite/module.c _sqlite/prepare_protocol.c _sqlite/row.c _sqlite/statement.c _sqlite/util.c -IModules/_sqlite -DMODULE_NAME=\"sqlite3\" -DSQLITE_OMIT_LOAD_EXTENSION=1 -Wl,-hidden-lsqlite3
23+
_ssl _ssl.c -Wl,-hidden-lssl -Wl,-hidden-lcrypto
2424
_uuid _uuidmodule.c
2525
pyexpat pyexpat.c expat/xmlparse.c expat/xmlrole.c expat/xmltok.c -DHAVE_EXPAT_CONFIG_H=1 -DXML_POOR_ENTROPY=1 -DUSE_PYEXPAT_CAPI -IModules/expat

0 commit comments

Comments
 (0)