From f91762f56ea7fb27b6fa54d07d3b3b0650bab0bc Mon Sep 17 00:00:00 2001 From: Erik Joelsson Date: Mon, 19 Sep 2022 12:36:14 +0000 Subject: [PATCH] 8293965: Code signing warnings after JDK-8293550 Reviewed-by: mikael, ihse --- make/common/NativeCompilation.gmk | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/make/common/NativeCompilation.gmk b/make/common/NativeCompilation.gmk index b36dd9c652b..7222671191e 100644 --- a/make/common/NativeCompilation.gmk +++ b/make/common/NativeCompilation.gmk @@ -1209,11 +1209,15 @@ define SetupNativeCompilationBody $$($1_MT) -nologo -manifest $$($1_MANIFEST) -identity:"$$($1_NAME).exe, version=$$($1_MANIFEST_VERSION)" -outputresource:$$@;#1 endif endif - # On macosx, optionally run codesign on every binary + # On macosx, optionally run codesign on every binary. + # Remove signature explicitly first to avoid warnings if the linker + # added a default adhoc signature. ifeq ($(MACOSX_CODESIGN_MODE), hardened) + $(CODESIGN) --remove-signature $$@ $(CODESIGN) -f -s "$(MACOSX_CODESIGN_IDENTITY)" --timestamp --options runtime \ --entitlements $$(call GetEntitlementsFile, $$@) $$@ else ifeq ($(MACOSX_CODESIGN_MODE), debug) + $(CODESIGN) --remove-signature $$@ $(CODESIGN) -f -s - --entitlements $$(call GetEntitlementsFile, $$@) $$@ endif endif