toku-mac commented on PR #18886:
URL: https://github.com/apache/nuttx/pull/18886#issuecomment-4467680918
about `arch/sim/src/patch_macho_initsection.py`.
On macOS 11 and later with Apple Silicon, binary re-signing is required.
Writing the file invalidates the ad-hoc signature that ld attached at link
time, which causes the kernel to SIGKILL the process at exec.
```
import argparse
import subprocess
import sys
```
```
if patched:
fat.write(args.binary)
if sys.platform == "darwin":
subprocess.run(
["codesign", "--force", "--sign", "-", args.binary],
check=True,
)
return 0
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]