History

Makefile: avoid cp-ing over existing executable files

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

rcombs committed 4 years ago

Commit bb6d9a01 parent c534d9f1 file · +1 −0Browse files

Unified · Split

Makefile+1−0
@@ -121,6 +121,7 @@ $(PROGS): %$(PROGSSUF)$(EXESUF): %$(PROGSSUF)_g$(EXESUF) · 120 unmodified lines
121121 ifeq ($(STRIPTYPE),direct)
122122 $(STRIP) -o $@ $<
123123 else
124+ $(RM) $@
124125 $(CP) $< $@
125126 $(STRIP) $@
126127 endif

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t