From c5c4efdaa1d04b1441fd96712b71cdb43e5d86df Mon Sep 17 00:00:00 2001 From: Erik Joelsson Date: Fri, 10 Jan 2025 13:57:52 +0000 Subject: [PATCH] 8347120: Launchers should not have java headers on include path Reviewed-by: dholmes, ihse --- make/common/JdkNativeCompilation.gmk | 9 +++++++-- make/common/modules/LauncherCommon.gmk | 3 ++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/make/common/JdkNativeCompilation.gmk b/make/common/JdkNativeCompilation.gmk index ca0f1429c61..a4f48385f41 100644 --- a/make/common/JdkNativeCompilation.gmk +++ b/make/common/JdkNativeCompilation.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2018, 2025, 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 @@ -266,6 +266,9 @@ JDK_RCFLAGS=$(RCFLAGS) \ # will be replaced with proper values for hotspot. # HEADERS_FROM_SRC -- if false, does not add source dirs automatically as # header include dirs. (Defaults to true.) +# JAVA_HEADERS -- if false, does not add the directory with the generated +# headers from the Java compilation of the current module to the search +# path for include files. (Defaults to true.) # JDK_LIBS -- libraries generated by the JDK build system to link against. # These take the form :. For the current module, the # module name and colon can be omitted. The basename should be specified @@ -385,7 +388,9 @@ define SetupJdkNativeCompilationBody # Add the module specific java header dir ifneq ($$(MODULE), ) - $1_SRC_HEADER_FLAGS += $$(addprefix -I, $$(call GetJavaHeaderDir, $$(MODULE))) + ifneq ($$($1_JAVA_HEADERS), false) + $1_SRC_HEADER_FLAGS += $$(addprefix -I, $$(call GetJavaHeaderDir, $$(MODULE))) + endif endif $1_JDK_LIBS += $$($1_JDK_LIBS_$$(OPENJDK_TARGET_OS)) diff --git a/make/common/modules/LauncherCommon.gmk b/make/common/modules/LauncherCommon.gmk index 38485283dcb..eb8621092c0 100644 --- a/make/common/modules/LauncherCommon.gmk +++ b/make/common/modules/LauncherCommon.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2025, 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 @@ -145,6 +145,7 @@ define SetupBuildLauncherBody $$($1_CFLAGS), \ CFLAGS_windows := $$($1_CFLAGS_windows), \ EXTRA_HEADER_DIRS := java.base:libjvm, \ + JAVA_HEADERS := false, \ DISABLED_WARNINGS_gcc := unused-function unused-variable, \ DISABLED_WARNINGS_clang := unused-function, \ LDFLAGS := $$($1_LDFLAGS), \