--- old/make/common/NativeCompilation.gmk 2016-02-11 12:16:26.411847300 +0100 +++ new/make/common/NativeCompilation.gmk 2016-02-11 12:16:26.311847295 +0100 @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -187,25 +187,30 @@ # param 6 = the c++ flags to the compiler # param 7 = the c++ compiler # param 8 = the flags to the assembler + # param 9 = set to disable THIS_FILE + + ifeq ($9, ) + $1_$2_THIS_FILE = -DTHIS_FILE='"$$( $$($1_RES_DEP).raw 2>&1 || true ; \ @@ -654,12 +663,11 @@ endif endif - # mapfile doesnt seem to be implemented on macosx (yet??) - ifneq ($(OPENJDK_TARGET_OS),macosx) + ifneq ($(DISABLE_MAPFILES),true) + $1_REAL_MAPFILE := $$($1_MAPFILE) ifneq ($(OPENJDK_TARGET_OS),windows) - $1_REAL_MAPFILE:=$$($1_MAPFILE) ifneq (,$$($1_REORDER)) - $1_REAL_MAPFILE:=$$($1_OBJECT_DIR)/mapfile + $1_REAL_MAPFILE := $$($1_OBJECT_DIR)/mapfile $$($1_REAL_MAPFILE) : $$($1_MAPFILE) $$($1_REORDER) $$(MKDIR) -p $$(@D) @@ -689,7 +697,8 @@ # The dependency on TARGET is needed on windows for debuginfo files # to be rebuilt properly. $$($1_OUTPUT_DIR)/% : $$($1_OBJECT_DIR)/% $$($1_TARGET) - $(CP) $$< $$@ + # Use cp -r since on macosx, the dSYM is a directory + $(CP) -r $$< $$@ endif # Generate debuginfo files. @@ -815,13 +824,23 @@ $$($1_OBJECT_DIR)/$$($1_NOSUFFIX).vardeps) # Generating a static library, ie object file archive. - $$($1_TARGET): $$($1_ALL_OBJS) $$($1_RES) $$($1_VARDEPS_FILE) + ifeq ($(STATIC_BUILD), true) + ifeq ($$($1_USE_MAPFILE_FOR_SYMBOLS), true) + STATIC_MAPFILE_DEP := $$($1_MAPFILE) + endif + endif + + $$($1_TARGET): $$($1_ALL_OBJS) $$($1_RES) $$($1_VARDEPS_FILE) $$(STATIC_MAPFILE_DEP) $$(call LogInfo, Archiving $$($1_STATIC_LIBRARY)) $$(call ExecuteWithLog, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_link, \ $$($1_AR) $$($1_ARFLAGS) $(AR_OUT_OPTION)$$($1_TARGET) $$($1_ALL_OBJS) \ $$($1_RES)) ifeq ($(STATIC_BUILD), true) - $(GetSymbols) + ifeq ($$($1_USE_MAPFILE_FOR_SYMBOLS), true) + $(CP) $$($1_MAPFILE) $$(@D)/$$(basename $$(@F)).symbols + else + $(GetSymbols) + endif endif endif @@ -836,6 +855,12 @@ $1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, \ $$($1_OBJECT_DIR)/$$($1_NOSUFFIX).vardeps) + ifeq ($(OPENJDK_TARGET_OS), windows) + ifeq ($$($1_EMBED_MANIFEST), true) + $1_EXTRA_LDFLAGS += -manifest:embed + endif + endif + $$($1_TARGET): $$($1_ALL_OBJS) $$($1_RES) $$($1_MANIFEST) \ $$($1_VARDEPS_FILE) $$(call LogInfo, Linking executable $$($1_BASENAME))