Skip to content

Commit

Permalink
unix: add -ObjC to tkinter linker arguments
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
indygreg committed Jun 27, 2022
1 parent a452f43 commit 5433319
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
5 changes: 4 additions & 1 deletion cpython-unix/static-modules.3.10.macos
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ _testimportmultiple _testimportmultiple.c
_testinternalcapi _testinternalcapi.c -DPy_BUILD_CORE_MODULE
_testmultiphase _testmultiphase.c
# CoreFoundation isn't a directory dependency but is a dependency of libtcl and libtk.
_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
# Without -ObjC, we get a crash: -[TKApplication tkProcessEvent:]: unrecognized selector sent to instance.
# See also https://core.tcl-lang.org/tk/tktview/85f316beb15108ac43b03fa6c8608e31f3ae5f92.
# This is apparently an issue with static linking Objective-C binaries.
_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
_uuid _uuidmodule.c -Xlinker -hidden-luuid
_xxsubinterpreters _xxsubinterpretersmodule.c
_xxtestfuzz _xxtestfuzz/_xxtestfuzz.c _xxtestfuzz/fuzzer.c
Expand Down
5 changes: 4 additions & 1 deletion cpython-unix/static-modules.3.8.macos
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ _scproxy _scproxy.c -framework SystemConfiguration -framework CoreFoundation
_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
_ssl _ssl.c -Xlinker -hidden-lssl -Xlinker -hidden-lcrypto
# CoreFoundation isn't a directory dependency but is a dependency of libtcl and libtk.
_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
# Without -ObjC, we get a crash: -[TKApplication tkProcessEvent:]: unrecognized selector sent to instance.
# See also https://core.tcl-lang.org/tk/tktview/85f316beb15108ac43b03fa6c8608e31f3ae5f92.
# This is apparently an issue with static linking Objective-C binaries.
_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
_uuid _uuidmodule.c -Xlinker -hidden-luuid
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
readline readline.c -Xlinker -hidden-ledit -Xlinker -hidden-lncurses
5 changes: 4 additions & 1 deletion cpython-unix/static-modules.3.9.macos
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ _testimportmultiple _testimportmultiple.c
_testinternalcapi _testinternalcapi.c -DPy_BUILD_CORE_MODULE
_testmultiphase _testmultiphase.c
# CoreFoundation isn't a directory dependency but is a dependency of libtcl and libtk.
_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
# Without -ObjC, we get a crash: -[TKApplication tkProcessEvent:]: unrecognized selector sent to instance.
# See also https://core.tcl-lang.org/tk/tktview/85f316beb15108ac43b03fa6c8608e31f3ae5f92.
# This is apparently an issue with static linking Objective-C binaries.
_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
_uuid _uuidmodule.c -Xlinker -hidden-luuid
_xxsubinterpreters _xxsubinterpretersmodule.c
_xxtestfuzz _xxtestfuzz/_xxtestfuzz.c _xxtestfuzz/fuzzer.c
Expand Down

0 comments on commit 5433319

Please sign in to comment.