8294006: Avoid hardcoding object file suffixes in make

Reviewed-by: erikj, ihse
This commit is contained in:
Julian Waters 2022-09-20 17:23:49 +00:00 committed by Magnus Ihse Bursie
parent 5002eaa5cc
commit cb5771dc2a
3 changed files with 9 additions and 9 deletions

View File

@ -807,7 +807,7 @@ define SetupNativeCompilationBody
ifeq ($(TOOLCHAIN_TYPE), microsoft)
$1_PCH_FILE := $$($1_OBJECT_DIR)/$1.pch
$1_GENERATED_PCH_SRC := $$($1_OBJECT_DIR)/$1_pch.cpp
$1_GENERATED_PCH_OBJ := $$($1_OBJECT_DIR)/$1_pch.obj
$1_GENERATED_PCH_OBJ := $$($1_OBJECT_DIR)/$1_pch$(OBJ_SUFFIX)
$$(eval $$(call SetupCompileNativeFile, $1_$$(notdir $$($1_GENERATED_PCH_SRC)), \
FILE := $$($1_GENERATED_PCH_SRC), \
@ -914,15 +914,15 @@ define SetupNativeCompilationBody
# For some unknown reason, in this case CL actually outputs the show
# includes to stderr so need to redirect it to hide the output from the
# main log.
$$(call ExecuteWithLog, $$($1_RES_DEPS_FILE).obj, \
$$(call ExecuteWithLog, $$($1_RES_DEPS_FILE)$(OBJ_SUFFIX), \
$$($1_CC) $$(filter-out -l%, $$($1_RCFLAGS)) \
$$($1_SYSROOT_CFLAGS) -showIncludes -nologo -TC \
$(CC_OUT_OPTION)$$($1_RES_DEPS_FILE).obj -P -Fi$$($1_RES_DEPS_FILE).pp \
$(CC_OUT_OPTION)$$($1_RES_DEPS_FILE)$(OBJ_SUFFIX) -P -Fi$$($1_RES_DEPS_FILE).pp \
$$($1_VERSIONINFO_RESOURCE)) 2>&1 \
| $(TR) -d '\r' | $(GREP) -v -e "^Note: including file:" \
-e "^$$(notdir $$($1_VERSIONINFO_RESOURCE))$$$$" || test "$$$$?" = "1" ; \
$(ECHO) $$($1_RES): \\ > $$($1_RES_DEPS_FILE) ; \
$(SED) $(WINDOWS_SHOWINCLUDE_SED_PATTERN) $$($1_RES_DEPS_FILE).obj.log \
$(SED) $(WINDOWS_SHOWINCLUDE_SED_PATTERN) $$($1_RES_DEPS_FILE)$(OBJ_SUFFIX).log \
>> $$($1_RES_DEPS_FILE) ; \
$(ECHO) >> $$($1_RES_DEPS_FILE) ;\
$(SED) $(DEPENDENCY_TARGET_SED_PATTERN) $$($1_RES_DEPS_FILE) \

View File

@ -53,7 +53,7 @@ endif
# platform dependent.
ifeq ($(call isTargetOs, linux), true)
DUMP_SYMBOLS_CMD := $(NM) --defined-only *.o
DUMP_SYMBOLS_CMD := $(NM) --defined-only *$(OBJ_SUFFIX)
ifneq ($(FILTER_SYMBOLS_PATTERN), )
FILTER_SYMBOLS_PATTERN := $(FILTER_SYMBOLS_PATTERN)|
endif
@ -67,7 +67,7 @@ ifeq ($(call isTargetOs, linux), true)
else ifeq ($(call isTargetOs, macosx), true)
# nm on macosx prints out "warning: nm: no name list" to stderr for
# files without symbols. Hide this, even at the expense of hiding real errors.
DUMP_SYMBOLS_CMD := $(NM) -Uj *.o 2> /dev/null
DUMP_SYMBOLS_CMD := $(NM) -Uj *$(OBJ_SUFFIX) 2> /dev/null
ifneq ($(FILTER_SYMBOLS_PATTERN), )
FILTER_SYMBOLS_PATTERN := $(FILTER_SYMBOLS_PATTERN)|
endif
@ -89,7 +89,7 @@ else ifeq ($(call isTargetOs, aix), true)
# which may be installed under /opt/freeware/bin. So better use an absolute path here!
# NM=/usr/bin/nm
DUMP_SYMBOLS_CMD := $(NM) -X64 -B -C *.o
DUMP_SYMBOLS_CMD := $(NM) -X64 -B -C *$(OBJ_SUFFIX)
FILTER_SYMBOLS_AWK_SCRIPT := \
'{ \
if (($$2="d" || $$2="D") && ($$3 ~ /^__vft/ || $$3 ~ /^gHotSpotVM/)) print $$3; \
@ -98,7 +98,7 @@ else ifeq ($(call isTargetOs, aix), true)
}'
else ifeq ($(call isTargetOs, windows), true)
DUMP_SYMBOLS_CMD := $(DUMPBIN) -symbols *.obj
DUMP_SYMBOLS_CMD := $(DUMPBIN) -symbols *$(OBJ_SUFFIX)
# The following lines create a list of vftable symbols to be filtered out of
# the mapfile. Removing this line causes the linker to complain about too many

View File

@ -79,7 +79,7 @@ ifeq ($(call isTargetOs, macosx aix linux), true)
SRC := $(TOPDIR)/src/$(MODULE)/unix/native/jspawnhelper, \
OPTIMIZATION := LOW, \
CFLAGS := $(CFLAGS_JDKEXE) -I$(TOPDIR)/src/$(MODULE)/unix/native/libjava, \
EXTRA_OBJECT_FILES := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjava/childproc.o, \
EXTRA_OBJECT_FILES := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjava/childproc$(OBJ_SUFFIX), \
LDFLAGS := $(LDFLAGS_JDKEXE), \
OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/modules_libs/$(MODULE), \
))