From 0f3948005f5f18ce6272e7cac1fe70f385fe705b Mon Sep 17 00:00:00 2001 From: Donny Lawrence Date: Fri, 24 Apr 2020 18:38:35 -0500 Subject: [PATCH] FreezeTool: Place blob in custom segment on macOS The motivation behind this is in the code's comments. FreezeTool will only put the blob in a custom segment if the provided deploy-stub contains a __PANDA segment stub. Otherwise, it keeps the old behavior of simply putting the blob at the end of the binary. --- direct/src/dist/FreezeTool.py | 141 +++++++++++++++++++++++++++++++--- 1 file changed, 129 insertions(+), 12 deletions(-) diff --git a/direct/src/dist/FreezeTool.py b/direct/src/dist/FreezeTool.py index 8748b81c8d..c97d842144 100644 --- a/direct/src/dist/FreezeTool.py +++ b/direct/src/dist/FreezeTool.py @@ -639,6 +639,51 @@ okMissing = [ 'direct.extensions_native.extensions_darwin', ] +# Since around macOS 10.15, Apple's codesigning process has become more strict. +# Appending data to the end of a Mach-O binary is now explicitly forbidden. The +# solution is to embed our own segment into the binary so it can be properly +# signed. +mach_header_64_layout = '