Skip to content

Commit 0278846

Browse files
committed
Merge
2 parents 7bce9a9 + 7e20cf7 commit 0278846

91 files changed

Lines changed: 1074 additions & 417 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

make/TestImage.gmk

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,22 @@ ifeq ($(call isTargetOs, windows), true)
3737
$(call install-file)
3838
endif
3939

40-
prepare-test-image: $(FIXPATH_COPY)
40+
BUILD_INFO_PROPERTIES := $(TEST_IMAGE_DIR)/build-info.properties
41+
42+
FIXPATH_ECHO := $(FIXPATH) $(call FixPath, $(ECHO))
43+
44+
$(BUILD_INFO_PROPERTIES):
45+
$(call MakeTargetDir)
46+
$(ECHO) "# Build info properties for JDK tests" > $@
47+
$(FIXPATH_ECHO) "build.workspace.root=$(WORKSPACE_ROOT)" >> $@
48+
$(FIXPATH_ECHO) "build.output.root=$(OUTPUTDIR)" >> $@
49+
50+
prepare-test-image: $(FIXPATH_COPY) $(BUILD_INFO_PROPERTIES)
4151
$(call MakeDir, $(TEST_IMAGE_DIR))
4252
$(ECHO) > $(TEST_IMAGE_DIR)/Readme.txt 'JDK test image'
4353

54+
################################################################################
55+
4456
all: prepare-test-image
4557

4658
.PHONY: default all prepare-test-image

make/autoconf/basic.m4

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,13 @@ AC_DEFUN_ONCE([BASIC_SETUP_PATHS],
8686
AC_SUBST(TOPDIR)
8787
AC_SUBST(CONFIGURE_START_DIR)
8888
89+
if test "x$CUSTOM_ROOT" != x; then
90+
WORKSPACE_ROOT="${CUSTOM_ROOT}"
91+
else
92+
WORKSPACE_ROOT="${TOPDIR}"
93+
fi
94+
AC_SUBST(WORKSPACE_ROOT)
95+
8996
# We can only call UTIL_FIXUP_PATH after BASIC_CHECK_PATHS_WINDOWS.
9097
UTIL_FIXUP_PATH(CONFIGURE_START_DIR)
9198
UTIL_FIXUP_PATH(TOPDIR)
@@ -315,11 +322,6 @@ AC_DEFUN_ONCE([BASIC_SETUP_OUTPUT_DIR],
315322
AC_MSG_RESULT([in build directory with custom name])
316323
fi
317324
318-
if test "x$CUSTOM_ROOT" != x; then
319-
WORKSPACE_ROOT="${CUSTOM_ROOT}"
320-
else
321-
WORKSPACE_ROOT="${TOPDIR}"
322-
fi
323325
OUTPUTDIR="${WORKSPACE_ROOT}/build/${CONF_NAME}"
324326
$MKDIR -p "$OUTPUTDIR"
325327
if test ! -d "$OUTPUTDIR"; then
@@ -376,7 +378,6 @@ AC_DEFUN_ONCE([BASIC_SETUP_OUTPUT_DIR],
376378
AC_SUBST(SPEC)
377379
AC_SUBST(CONF_NAME)
378380
AC_SUBST(OUTPUTDIR)
379-
AC_SUBST(WORKSPACE_ROOT)
380381
AC_SUBST(CONFIGURESUPPORT_OUTPUTDIR)
381382
382383
# The spec.gmk file contains all variables for the make system.

make/autoconf/configure.ac

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ HOTSPOT_SETUP_JVM_VARIANTS
9797
# With basic setup done, call the custom early hook.
9898
CUSTOM_EARLY_HOOK
9999

100+
# This only needs debug level to be setup
101+
JDKOPT_ALLOW_ABSOLUTE_PATHS_IN_OUTPUT
102+
100103
# Check if we have devkits, extra paths or sysroot set.
101104
BASIC_SETUP_DEVKIT
102105

make/autoconf/flags-cflags.m4

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -641,6 +641,7 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
641641
# Where does this really belong??
642642
if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang; then
643643
PICFLAG="-fPIC"
644+
PIEFLAG="-fPIE"
644645
elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
645646
PICFLAG="-KPIC"
646647
elif test "x$TOOLCHAIN_TYPE" = xxlc; then
@@ -854,18 +855,27 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP],
854855
$1_WARNING_CFLAGS_JVM="-Wno-format-zero-length -Wtype-limits -Wuninitialized"
855856
fi
856857
857-
if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang; then
858-
# Check if compiler supports -fmacro-prefix-map. If so, use that to make
859-
# the __FILE__ macro resolve to paths relative to the workspace root.
860-
workspace_root_trailing_slash="${WORKSPACE_ROOT%/}/"
861-
FILE_MACRO_CFLAGS="-fmacro-prefix-map=${workspace_root_trailing_slash}="
862-
FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [${FILE_MACRO_CFLAGS}],
863-
PREFIX: $3,
864-
IF_FALSE: [
865-
FILE_MACRO_CFLAGS=
866-
]
867-
)
858+
# Prevent the __FILE__ macro from generating absolute paths into the built
859+
# binaries. Depending on toolchain, different mitigations are possible.
860+
# * GCC and Clang of new enough versions have -fmacro-prefix-map.
861+
# * For most other toolchains, supplying all source files and -I flags as
862+
# relative paths fixes the issue.
863+
FILE_MACRO_CFLAGS=
864+
if test "x$ALLOW_ABSOLUTE_PATHS_IN_OUTPUT" = "xfalse"; then
865+
if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang; then
866+
# Check if compiler supports -fmacro-prefix-map. If so, use that to make
867+
# the __FILE__ macro resolve to paths relative to the workspace root.
868+
workspace_root_trailing_slash="${WORKSPACE_ROOT%/}/"
869+
FILE_MACRO_CFLAGS="-fmacro-prefix-map=${workspace_root_trailing_slash}="
870+
FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [${FILE_MACRO_CFLAGS}],
871+
PREFIX: $3,
872+
IF_FALSE: [
873+
FILE_MACRO_CFLAGS=
874+
]
875+
)
876+
fi
868877
fi
878+
AC_SUBST(FILE_MACRO_CFLAGS)
869879
870880
# EXPORT to API
871881
CFLAGS_JVM_COMMON="$ALWAYS_CFLAGS_JVM $ALWAYS_DEFINES_JVM \
@@ -894,10 +904,12 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP],
894904
895905
$2JVM_CFLAGS="$CFLAGS_JVM_COMMON ${$1_CFLAGS_JVM} ${$2EXTRA_CXXFLAGS}"
896906
897-
$2CFLAGS_JDKEXE="$CFLAGS_JDK_COMMON $CFLAGS_JDK_COMMON_CONLY ${$1_CFLAGS_JDK}"
898-
$2CXXFLAGS_JDKEXE="$CFLAGS_JDK_COMMON $CFLAGS_JDK_COMMON_CXXONLY ${$1_CFLAGS_JDK}"
899-
$2CFLAGS_JDKLIB="${$2CFLAGS_JDKEXE} $JDK_PICFLAG ${$1_CFLAGS_CPU_JDK_LIBONLY}"
900-
$2CXXFLAGS_JDKLIB="${$2CXXFLAGS_JDKEXE} $JDK_PICFLAG ${$1_CFLAGS_CPU_JDK_LIBONLY}"
907+
$2CFLAGS_JDKEXE="$CFLAGS_JDK_COMMON $CFLAGS_JDK_COMMON_CONLY ${$1_CFLAGS_JDK} $PIEFLAG"
908+
$2CXXFLAGS_JDKEXE="$CFLAGS_JDK_COMMON $CFLAGS_JDK_COMMON_CXXONLY ${$1_CFLAGS_JDK} $PIEFLAG"
909+
$2CFLAGS_JDKLIB="$CFLAGS_JDK_COMMON $CFLAGS_JDK_COMMON_CONLY ${$1_CFLAGS_JDK} \
910+
$JDK_PICFLAG ${$1_CFLAGS_CPU_JDK_LIBONLY}"
911+
$2CXXFLAGS_JDKLIB="$CFLAGS_JDK_COMMON $CFLAGS_JDK_COMMON_CXXONLY ${$1_CFLAGS_JDK} \
912+
$JDK_PICFLAG ${$1_CFLAGS_CPU_JDK_LIBONLY}"
901913
902914
AC_SUBST($2JVM_CFLAGS)
903915
AC_SUBST($2CFLAGS_JDKLIB)

make/autoconf/flags-ldflags.m4

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,17 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_HELPER],
152152
# Setup LDFLAGS for linking executables
153153
if test "x$TOOLCHAIN_TYPE" = xgcc; then
154154
EXECUTABLE_LDFLAGS="$EXECUTABLE_LDFLAGS -Wl,--allow-shlib-undefined"
155+
# Enabling pie on 32 bit builds prevents the JVM from allocating a continuous
156+
# java heap.
157+
if test "x$OPENJDK_TARGET_CPU_BITS" != "x32"; then
158+
EXECUTABLE_LDFLAGS="$EXECUTABLE_LDFLAGS -pie"
159+
fi
160+
fi
161+
162+
if test "x$ALLOW_ABSOLUTE_PATHS_IN_OUTPUT" = "xfalse"; then
163+
if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
164+
BASIC_LDFLAGS="$BASIC_LDFLAGS -pdbaltpath:%_PDB%"
165+
fi
155166
fi
156167
157168
# Export some intermediate variables for compatibility

make/autoconf/jdk-options.m4

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -598,3 +598,35 @@ AC_DEFUN([JDKOPT_ENABLE_DISABLE_CDS_ARCHIVE],
598598
])
599599
AC_SUBST(BUILD_CDS_ARCHIVE)
600600
])
601+
602+
################################################################################
603+
#
604+
# Disallow any output from containing absolute paths from the build system.
605+
# This setting defaults to allowed on debug builds and not allowed on release
606+
# builds.
607+
#
608+
AC_DEFUN([JDKOPT_ALLOW_ABSOLUTE_PATHS_IN_OUTPUT],
609+
[
610+
AC_ARG_ENABLE([absolute-paths-in-output],
611+
[AS_HELP_STRING([--disable-absolute-paths-in-output],
612+
[Set to disable to prevent any absolute paths from the build to end up in
613+
any of the build output. @<:@disabled in release builds, otherwise enabled@:>@])
614+
])
615+
616+
AC_MSG_CHECKING([if absolute paths should be allowed in the build output])
617+
if test "x$enable_absolute_paths_in_output" = "xno"; then
618+
AC_MSG_RESULT([no, forced])
619+
ALLOW_ABSOLUTE_PATHS_IN_OUTPUT="false"
620+
elif test "x$enable_absolute_paths_in_output" = "xyes"; then
621+
AC_MSG_RESULT([yes, forced])
622+
ALLOW_ABSOLUTE_PATHS_IN_OUTPUT="true"
623+
elif test "x$DEBUG_LEVEL" = "xrelease"; then
624+
AC_MSG_RESULT([no, release build])
625+
ALLOW_ABSOLUTE_PATHS_IN_OUTPUT="false"
626+
else
627+
AC_MSG_RESULT([yes, debug build])
628+
ALLOW_ABSOLUTE_PATHS_IN_OUTPUT="true"
629+
fi
630+
631+
AC_SUBST(ALLOW_ABSOLUTE_PATHS_IN_OUTPUT)
632+
])

make/autoconf/spec.gmk.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,8 @@ BUILD_MANPAGES := @BUILD_MANPAGES@
338338

339339
BUILD_CDS_ARCHIVE := @BUILD_CDS_ARCHIVE@
340340

341+
ALLOW_ABSOLUTE_PATHS_IN_OUTPUT := @ALLOW_ABSOLUTE_PATHS_IN_OUTPUT@
342+
341343
# The boot jdk to use. This is overridden in bootcycle-spec.gmk. Make sure to keep
342344
# it in sync.
343345
BOOT_JDK:=@BOOT_JDK@
@@ -381,6 +383,7 @@ LIBFFI_CFLAGS:=@LIBFFI_CFLAGS@
381383
ENABLE_LIBFFI_BUNDLING:=@ENABLE_LIBFFI_BUNDLING@
382384
LIBFFI_LIB_FILE:=@LIBFFI_LIB_FILE@
383385
GRAALUNIT_LIB := @GRAALUNIT_LIB@
386+
FILE_MACRO_CFLAGS := @FILE_MACRO_CFLAGS@
384387

385388
STATIC_LIBS_CFLAGS := @STATIC_LIBS_CFLAGS@
386389

make/common/NativeCompilation.gmk

Lines changed: 81 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,68 @@ DEPENDENCY_TARGET_SED_PATTERN := \
204204
-e 's/$$$$/ :/' \
205205
#
206206

207+
################################################################################
208+
# When absolute paths are not allowed in the output, and the compiler does not
209+
# support any options to avoid it, we need to rewrite compile commands to use
210+
# relative paths. By doing this, the __FILE__ macro will resolve to relative
211+
# paths. The relevant input paths on the command line are the -I flags and the
212+
# path to the source file itself.
213+
#
214+
# The macro MakeCommandRelative is used to rewrite the command line like this:
215+
# 'CD $(WORKSPACE_ROOT) && <cmd>'
216+
# and changes all paths in cmd to be relative to the workspace root. This only
217+
# works properly if the build dir is inside the workspace root. If it's not,
218+
# relative paths are still calculated, but depending on the distance between the
219+
# dirs, paths in the build dir may end up as essentially absolute anyway.
220+
#
221+
# The fix-deps-file macro is used to adjust the contents of the generated make
222+
# dependency files to contain paths compatible with make.
223+
#
224+
ifeq ($(ALLOW_ABSOLUTE_PATHS_IN_OUTPUT)-$(FILE_MACRO_CFLAGS), false-)
225+
# Need to handle -I flags as both '-Ifoo' and '-I foo'.
226+
MakeCommandRelative = \
227+
$(CD) $(WORKSPACE_ROOT) && \
228+
$(foreach o, $1, \
229+
$(if $(filter $(WORKSPACE_ROOT)/% $(OUTPUTDIR)/%, $o), \
230+
$(call RelativePath, $o, $(WORKSPACE_ROOT)) \
231+
, \
232+
$(if $(filter -I$(WORKSPACE_ROOT)/%, $o), \
233+
-I$(call RelativePath, $(patsubst -I%, %, $o), $(WORKSPACE_ROOT)) \
234+
, \
235+
$o \
236+
) \
237+
) \
238+
)
239+
240+
# When compiling with relative paths, the deps file comes out with relative
241+
# paths.
242+
ifeq ($(TOOLCHAIN_TYPE), solstudio)
243+
define fix-deps-file
244+
$(SED) -e 's|\./|$(WORKSPACE_ROOT)/|g' $1.tmp > $1
245+
endef
246+
else
247+
define fix-deps-file
248+
$(SED) -e 's|^\([ ]*\)|\1$(WORKSPACE_ROOT)|' $1.tmp > $1
249+
endef
250+
endif
251+
else
252+
# By default the MakeCommandRelative macro does nothing.
253+
MakeCommandRelative = $1
254+
255+
# Even with absolute paths on the command line, the Solaris studio compiler
256+
# doesn't output the full path to the object file in the generated deps files.
257+
# For other toolchains, no adjustment is needed.
258+
ifeq ($(TOOLCHAIN_TYPE), solstudio)
259+
define fix-deps-file
260+
$(SED) 's|^$$(@F):|$$@:|' $1.tmp > $1
261+
endef
262+
else
263+
define fix-deps-file
264+
$(MV) $1.tmp $1
265+
endef
266+
endif
267+
endif
268+
207269
################################################################################
208270
# Create the recipe needed to compile a single native source file.
209271
#
@@ -214,7 +276,6 @@ DEPENDENCY_TARGET_SED_PATTERN := \
214276
# Remaining parameters are named arguments:
215277
# FILE - The full path of the source file to compiler
216278
# BASE - The name of the rule for the entire binary to build ($1)
217-
# DISABLE_THIS_FILE_DEFINE - Set to true to disable the THIS_FILE define.
218279
#
219280
SetupCompileNativeFile = $(NamedParamsMacroTemplate)
220281
define SetupCompileNativeFileBody
@@ -236,12 +297,6 @@ define SetupCompileNativeFileBody
236297
# This is the definite source file to use for $1_FILENAME.
237298
$1_SRC_FILE := $$($1_FILE)
238299

239-
ifneq ($$($1_DEFINE_THIS_FILE), false)
240-
ifneq ($$($$($1_BASE)_DEFINE_THIS_FILE), false)
241-
$1_THIS_FILE = -DTHIS_FILE='"$$($1_FILENAME)"'
242-
endif
243-
endif
244-
245300
ifeq ($$($1_OPTIMIZATION), )
246301
$1_OPT_CFLAGS := $$($$($1_BASE)_OPT_CFLAGS)
247302
$1_OPT_CXXFLAGS := $$($$($1_BASE)_OPT_CXXFLAGS)
@@ -284,13 +339,13 @@ define SetupCompileNativeFileBody
284339
ifneq ($$(filter %.c, $$($1_FILENAME)), )
285340
# Compile as a C file
286341
$1_FLAGS := $(CFLAGS_CCACHE) $$($1_USE_PCH_FLAGS) $$($1_BASE_CFLAGS) \
287-
$$($1_OPT_CFLAGS) $$($1_CFLAGS) $$($1_THIS_FILE) -c
342+
$$($1_OPT_CFLAGS) $$($1_CFLAGS) -c
288343
$1_COMPILER := $$($$($1_BASE)_CC)
289344
$1_DEP_FLAG := $(C_FLAG_DEPS)
290345
else ifneq ($$(filter %.m, $$($1_FILENAME)), )
291346
# Compile as an Objective-C file
292347
$1_FLAGS := -x objective-c $(CFLAGS_CCACHE) $$($1_USE_PCH_FLAGS) \
293-
$$($1_BASE_CFLAGS) $$($1_OPT_CFLAGS) $$($1_CFLAGS) $$($1_THIS_FILE) -c
348+
$$($1_BASE_CFLAGS) $$($1_OPT_CFLAGS) $$($1_CFLAGS) -c
294349
$1_COMPILER := $$($$($1_BASE)_CC)
295350
$1_DEP_FLAG := $(C_FLAG_DEPS)
296351
else ifneq ($$(filter %.s %.S, $$($1_FILENAME)), )
@@ -301,7 +356,7 @@ define SetupCompileNativeFileBody
301356
else ifneq ($$(filter %.cpp %.cc %.mm, $$($1_FILENAME)), )
302357
# Compile as a C++ or Objective-C++ file
303358
$1_FLAGS := $(CFLAGS_CCACHE) $$($1_USE_PCH_FLAGS) $$($1_BASE_CXXFLAGS) \
304-
$$($1_OPT_CXXFLAGS) $$($1_CXXFLAGS) $$($1_THIS_FILE) -c
359+
$$($1_OPT_CXXFLAGS) $$($1_CXXFLAGS) -c
305360
$1_COMPILER := $$($$($1_BASE)_CXX)
306361
$1_DEP_FLAG := $(CXX_FLAG_DEPS)
307362
else
@@ -341,21 +396,17 @@ define SetupCompileNativeFileBody
341396
$$(call LogInfo, Compiling $$($1_FILENAME) (for $$($$($1_BASE)_BASENAME)))
342397
$$(call MakeDir, $$(@D))
343398
ifneq ($(TOOLCHAIN_TYPE), microsoft)
344-
ifeq ($(TOOLCHAIN_TYPE)$$(filter %.s, $$($1_FILENAME)), solstudio)
345-
# The Solaris studio compiler doesn't output the full path to the
346-
# object file in the generated deps files. Fixing it with sed. If
347-
# compiling assembly, don't try this.
348-
$$(call ExecuteWithLog, $$@, \
349-
$$($1_COMPILER) $$($1_DEP_FLAG) $$($1_DEPS_FILE).tmp $$($1_COMPILE_OPTIONS))
350-
$(SED) 's|^$$(@F):|$$@:|' $$($1_DEPS_FILE).tmp > $$($1_DEPS_FILE)
351-
else
352-
$$(call ExecuteWithLog, $$@, \
353-
$$($1_COMPILER) $$($1_DEP_FLAG) $$($1_DEPS_FILE) $$($1_COMPILE_OPTIONS))
354-
endif
355-
# Create a dependency target file from the dependency file.
356-
# Solution suggested by http://make.mad-scientist.net/papers/advanced-auto-dependency-generation/
399+
$$(call ExecuteWithLog, $$@, $$(call MakeCommandRelative, \
400+
$$($1_COMPILER) $$($1_DEP_FLAG) \
401+
$$(addsuffix .tmp, $$($1_DEPS_FILE)) \
402+
$$($1_COMPILE_OPTIONS)))
357403
ifneq ($$($1_DEPS_FILE), )
358-
$(SED) $(DEPENDENCY_TARGET_SED_PATTERN) $$($1_DEPS_FILE) > $$($1_DEPS_TARGETS_FILE)
404+
$$(call fix-deps-file, $$($1_DEPS_FILE))
405+
# Create a dependency target file from the dependency file.
406+
# Solution suggested by:
407+
# http://make.mad-scientist.net/papers/advanced-auto-dependency-generation/
408+
$(SED) $(DEPENDENCY_TARGET_SED_PATTERN) $$($1_DEPS_FILE) \
409+
> $$($1_DEPS_TARGETS_FILE)
359410
endif
360411
else
361412
# The Visual Studio compiler lacks a feature for generating make
@@ -365,8 +416,8 @@ define SetupCompileNativeFileBody
365416
# Keep as much as possible on one execution line for best performance
366417
# on Windows. No need to save exit code from compilation since
367418
# pipefail is always active on Windows.
368-
$$(call ExecuteWithLog, $$@, \
369-
$$($1_COMPILER) -showIncludes $$($1_COMPILE_OPTIONS)) \
419+
$$(call ExecuteWithLog, $$@, $$(call MakeCommandRelative, \
420+
$$($1_COMPILER) -showIncludes $$($1_COMPILE_OPTIONS))) \
370421
| $(TR) -d '\r' | $(GREP) -v -e "^Note: including file:" \
371422
-e "^$$($1_FILENAME)$$$$" || test "$$$$?" = "1" ; \
372423
$(ECHO) $$@: \\ > $$($1_DEPS_FILE) ; \
@@ -430,7 +481,6 @@ endef
430481
# STRIPFLAGS Optionally change the flags given to the strip command
431482
# PRECOMPILED_HEADER Header file to use as precompiled header
432483
# PRECOMPILED_HEADER_EXCLUDE List of source files that should not use PCH
433-
# DEFINE_THIS_FILE Set to false to not set the THIS_FILE preprocessor macro
434484
#
435485
# After being called, some variables are exported from this macro, all prefixed
436486
# with parameter 1 followed by a '_':
@@ -734,7 +784,6 @@ define SetupNativeCompilationBody
734784
FILE := $$($1_GENERATED_PCH_SRC), \
735785
BASE := $1, \
736786
EXTRA_CXXFLAGS := -Fp$$($1_PCH_FILE) -Yc$$(notdir $$($1_PRECOMPILED_HEADER)), \
737-
DEFINE_THIS_FILE := false, \
738787
))
739788

740789
$1_USE_PCH_FLAGS := \
@@ -769,7 +818,8 @@ define SetupNativeCompilationBody
769818
$$($1_PCH_FILE): $$($1_PRECOMPILED_HEADER) $$($1_COMPILE_VARDEPS_FILE)
770819
$$(call LogInfo, Generating precompiled header)
771820
$$(call MakeDir, $$(@D))
772-
$$(call ExecuteWithLog, $$@, $$($1_PCH_COMMAND) $$< -o $$@)
821+
$$(call ExecuteWithLog, $$@, $$(call MakeCommandRelative, \
822+
$$($1_PCH_COMMAND) $$< -o $$@))
773823
$(SED) $(DEPENDENCY_TARGET_SED_PATTERN) $$($1_PCH_DEPS_FILE) \
774824
> $$($1_PCH_DEPS_TARGETS_FILE)
775825

@@ -825,9 +875,9 @@ define SetupNativeCompilationBody
825875
$$($1_RES): $$($1_VERSIONINFO_RESOURCE) $$($1_RES_VARDEPS_FILE)
826876
$$(call LogInfo, Compiling resource $$(notdir $$($1_VERSIONINFO_RESOURCE)) (for $$($1_BASENAME)))
827877
$$(call MakeDir, $$(@D) $$($1_OBJECT_DIR))
828-
$$(call ExecuteWithLog, $$@, \
878+
$$(call ExecuteWithLog, $$@, $$(call MakeCommandRelative, \
829879
$$($1_RC) $$($1_RC_FLAGS) $$($1_SYSROOT_CFLAGS) $(CC_OUT_OPTION)$$@ \
830-
$$($1_VERSIONINFO_RESOURCE) 2>&1 )
880+
$$($1_VERSIONINFO_RESOURCE) 2>&1 ))
831881
# Windows RC compiler does not support -showIncludes, so we mis-use CL
832882
# for this. Filter out RC specific arguments that are unknown to CL.
833883
# For some unknown reason, in this case CL actually outputs the show

0 commit comments

Comments
 (0)