On macOS, code-signing information for executables (including those signed automatically by the linker) is cached by the system on a per-inode basis. The cp(1) tool will truncate and overwrite an existing file if present, so we need to delete it first to avoid strange crashes. See https://developer.apple.com/documentation/security/updating_mac_software
Unified · Split
| @@ -121,6 +121,7 @@ $(PROGS): %$(PROGSSUF)$(EXESUF): %$(PROGSSUF)_g$(EXESUF) · 120 unmodified lines | ||
| 121 | 121 | ifeq ($(STRIPTYPE),direct) |
| 122 | 122 | $(STRIP) -o $@ $< |
| 123 | 123 | else |
| 124 | + $(RM) $@ | |
| 124 | 125 | $(CP) $< $@ |
| 125 | 126 | $(STRIP) $@ |
| 126 | 127 | endif |