Skip to content

Commit 5433319

Browse files
committed
unix: add -ObjC to tkinter linker arguments
See the inline comment. This fixes a tk crash on macOS that was introduced when we upgraded tcl/tk from 8.6.10 to 8.6.12. Closes #132.
1 parent a452f43 commit 5433319

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

cpython-unix/static-modules.3.10.macos

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@ _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 Cocoa -framework CoreFoundation -framework CoreServices -framework CoreGraphics -framework IOKit -framework QuartzCore -Xlinker -hidden-ltcl8.6 -Xlinker -hidden-ltk8.6
37+
# Without -ObjC, we get a crash: -[TKApplication tkProcessEvent:]: unrecognized selector sent to instance.
38+
# See also https://core.tcl-lang.org/tk/tktview/85f316beb15108ac43b03fa6c8608e31f3ae5f92.
39+
# This is apparently an issue with static linking Objective-C binaries.
40+
_tkinter _tkinter.c tkappinit.c -DWITH_APPINIT -framework AppKit -framework ApplicationServices -framework Carbon -framework Cocoa -framework CoreFoundation -framework CoreServices -framework CoreGraphics -framework IOKit -framework QuartzCore -Xlinker -hidden-ltcl8.6 -Xlinker -hidden-ltk8.6 -Xlinker -ObjC
3841
_uuid _uuidmodule.c -Xlinker -hidden-luuid
3942
_xxsubinterpreters _xxsubinterpretersmodule.c
4043
_xxtestfuzz _xxtestfuzz/_xxtestfuzz.c _xxtestfuzz/fuzzer.c

cpython-unix/static-modules.3.8.macos

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@ _scproxy _scproxy.c -framework SystemConfiguration -framework CoreFoundation
2929
_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\" -Xlinker -hidden-lsqlite3
3030
_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 Cocoa -framework CoreFoundation -framework CoreServices -framework CoreGraphics -framework IOKit -framework QuartzCore -Xlinker -hidden-ltcl8.6 -Xlinker -hidden-ltk8.6
32+
# Without -ObjC, we get a crash: -[TKApplication tkProcessEvent:]: unrecognized selector sent to instance.
33+
# See also https://core.tcl-lang.org/tk/tktview/85f316beb15108ac43b03fa6c8608e31f3ae5f92.
34+
# This is apparently an issue with static linking Objective-C binaries.
35+
_tkinter _tkinter.c tkappinit.c -DWITH_APPINIT -framework AppKit -framework ApplicationServices -framework Carbon -framework Cocoa -framework CoreFoundation -framework CoreServices -framework CoreGraphics -framework IOKit -framework QuartzCore -Xlinker -hidden-ltcl8.6 -Xlinker -hidden-ltk8.6 -Xlinker -ObjC
3336
_uuid _uuidmodule.c -Xlinker -hidden-luuid
3437
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
3538
readline readline.c -Xlinker -hidden-ledit -Xlinker -hidden-lncurses

cpython-unix/static-modules.3.9.macos

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@ _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 Cocoa -framework CoreFoundation -framework CoreServices -framework CoreGraphics -framework IOKit -framework QuartzCore -Xlinker -hidden-ltcl8.6 -Xlinker -hidden-ltk8.6
37+
# Without -ObjC, we get a crash: -[TKApplication tkProcessEvent:]: unrecognized selector sent to instance.
38+
# See also https://core.tcl-lang.org/tk/tktview/85f316beb15108ac43b03fa6c8608e31f3ae5f92.
39+
# This is apparently an issue with static linking Objective-C binaries.
40+
_tkinter _tkinter.c tkappinit.c -DWITH_APPINIT -framework AppKit -framework ApplicationServices -framework Carbon -framework Cocoa -framework CoreFoundation -framework CoreServices -framework CoreGraphics -framework IOKit -framework QuartzCore -Xlinker -hidden-ltcl8.6 -Xlinker -hidden-ltk8.6 -Xlinker -ObjC
3841
_uuid _uuidmodule.c -Xlinker -hidden-luuid
3942
_xxsubinterpreters _xxsubinterpretersmodule.c
4043
_xxtestfuzz _xxtestfuzz/_xxtestfuzz.c _xxtestfuzz/fuzzer.c

0 commit comments

Comments
 (0)