Skip to content

Commit c5c4efd

Browse files
committed
8347120: Launchers should not have java headers on include path
Reviewed-by: dholmes, ihse
1 parent ec7393e commit c5c4efd

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

make/common/JdkNativeCompilation.gmk

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -266,6 +266,9 @@ JDK_RCFLAGS=$(RCFLAGS) \
266266
# will be replaced with proper values for hotspot.
267267
# HEADERS_FROM_SRC -- if false, does not add source dirs automatically as
268268
# header include dirs. (Defaults to true.)
269+
# JAVA_HEADERS -- if false, does not add the directory with the generated
270+
# headers from the Java compilation of the current module to the search
271+
# path for include files. (Defaults to true.)
269272
# JDK_LIBS -- libraries generated by the JDK build system to link against.
270273
# These take the form <module>:<basename>. For the current module, the
271274
# module name and colon can be omitted. The basename should be specified
@@ -385,7 +388,9 @@ define SetupJdkNativeCompilationBody
385388

386389
# Add the module specific java header dir
387390
ifneq ($$(MODULE), )
388-
$1_SRC_HEADER_FLAGS += $$(addprefix -I, $$(call GetJavaHeaderDir, $$(MODULE)))
391+
ifneq ($$($1_JAVA_HEADERS), false)
392+
$1_SRC_HEADER_FLAGS += $$(addprefix -I, $$(call GetJavaHeaderDir, $$(MODULE)))
393+
endif
389394
endif
390395

391396
$1_JDK_LIBS += $$($1_JDK_LIBS_$$(OPENJDK_TARGET_OS))

make/common/modules/LauncherCommon.gmk

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -145,6 +145,7 @@ define SetupBuildLauncherBody
145145
$$($1_CFLAGS), \
146146
CFLAGS_windows := $$($1_CFLAGS_windows), \
147147
EXTRA_HEADER_DIRS := java.base:libjvm, \
148+
JAVA_HEADERS := false, \
148149
DISABLED_WARNINGS_gcc := unused-function unused-variable, \
149150
DISABLED_WARNINGS_clang := unused-function, \
150151
LDFLAGS := $$($1_LDFLAGS), \

0 commit comments

Comments
 (0)