jdk

Форк
0
/
JtregNativeJdk.gmk 
169 строк · 7.0 Кб
1
#
2
# Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved.
3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
#
5
# This code is free software; you can redistribute it and/or modify it
6
# under the terms of the GNU General Public License version 2 only, as
7
# published by the Free Software Foundation.  Oracle designates this
8
# particular file as subject to the "Classpath" exception as provided
9
# by Oracle in the LICENSE file that accompanied this code.
10
#
11
# This code is distributed in the hope that it will be useful, but WITHOUT
12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14
# version 2 for more details (a copy is included in the LICENSE file that
15
# accompanied this code).
16
#
17
# You should have received a copy of the GNU General Public License version
18
# 2 along with this work; if not, write to the Free Software Foundation,
19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20
#
21
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22
# or visit www.oracle.com if you need additional information or have any
23
# questions.
24
#
25

26
################################################################################
27
# This file builds the native component of the JTReg tests for JDK.
28
# It also covers the test-image part, where the built files are copied to the
29
# test image.
30
################################################################################
31

32
default: all
33

34
include $(SPEC)
35
include MakeBase.gmk
36

37
include CopyFiles.gmk
38
include TestFilesCompilation.gmk
39

40
$(eval $(call IncludeCustomExtension, test/JtregNativeJdk.gmk))
41

42
################################################################################
43
# Targets for building the native tests themselves.
44
################################################################################
45

46
# This might have been added to by a custom extension.
47
BUILD_JDK_JTREG_NATIVE_SRC += $(TOPDIR)/test/jdk
48

49
BUILD_JDK_JTREG_OUTPUT_DIR := $(OUTPUTDIR)/support/test/jdk/jtreg/native
50

51
BUILD_JDK_JTREG_IMAGE_DIR := $(TEST_IMAGE_DIR)/jdk/jtreg
52

53
BUILD_JDK_JTREG_EXECUTABLES_CFLAGS_exeJliLaunchTest := \
54
    -I$(TOPDIR)/src/java.base/share/native/libjli \
55
    -I$(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjli \
56
    -I$(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS)/native/libjli
57

58
BUILD_JDK_JTREG_EXECUTABLES_JDK_LIBS_exeJliLaunchTest := java.base:libjli
59
BUILD_JDK_JTREG_EXECUTABLES_JDK_LIBS_exeCallerAccessTest := java.base:libjvm
60
BUILD_JDK_JTREG_EXECUTABLES_JDK_LIBS_exeNullCallerTest := java.base:libjvm
61

62
BUILD_JDK_JTREG_LIBRARIES_JDK_LIBS_libstringPlatformChars := java.base:libjava
63
BUILD_JDK_JTREG_LIBRARIES_JDK_LIBS_libTracePinnedThreads := java.base:libjvm
64
BUILD_JDK_JTREG_LIBRARIES_JDK_LIBS_libNewDirectByteBuffer := java.base:libjava
65
BUILD_JDK_JTREG_LIBRARIES_JDK_LIBS_libGetXSpace := java.base:libjava
66

67
# Platform specific setup
68
ifeq ($(call isTargetOs, windows), true)
69
  BUILD_JDK_JTREG_EXCLUDE += libDirectIO.c libInheritedChannel.c \
70
      libExplicitAttach.c libImplicitAttach.c \
71
      exelauncher.c
72

73
  BUILD_JDK_JTREG_EXECUTABLES_LIBS_exeNullCallerTest := $(LIBCXX)
74
  BUILD_JDK_JTREG_EXECUTABLES_LIBS_exerevokeall := advapi32.lib
75
  BUILD_JDK_JTREG_EXECUTABLES_CFLAGS_exeNullCallerTest := /EHsc
76
else
77
  BUILD_JDK_JTREG_LIBRARIES_JDK_LIBS_libDirectIO := java.base:libjava
78
  BUILD_JDK_JTREG_LIBRARIES_LDFLAGS_libNativeThread := -pthread
79

80
  # java.lang.foreign tests
81
  BUILD_JDK_JTREG_LIBRARIES_LDFLAGS_libAsyncStackWalk := -pthread
82
  BUILD_JDK_JTREG_LIBRARIES_LDFLAGS_libAsyncInvokers := -pthread
83
  BUILD_JDK_JTREG_LIBRARIES_LDFLAGS_libLinkerInvokerUnnamed := -pthread
84
  BUILD_JDK_JTREG_LIBRARIES_LDFLAGS_libLinkerInvokerModule := -pthread
85
  BUILD_JDK_JTREG_LIBRARIES_LDFLAGS_libLoaderLookupInvoker := -pthread
86

87
  BUILD_JDK_JTREG_LIBRARIES_JDK_LIBS_libExplicitAttach := java.base:libjvm
88
  BUILD_JDK_JTREG_LIBRARIES_LDFLAGS_libExplicitAttach := -pthread
89
  BUILD_JDK_JTREG_LIBRARIES_LDFLAGS_libImplicitAttach := -pthread
90
  BUILD_JDK_JTREG_EXCLUDE += exerevokeall.c
91
  ifeq ($(call isTargetOs, linux), true)
92
    BUILD_JDK_JTREG_LIBRARIES_JDK_LIBS_libInheritedChannel := java.base:libjava
93
    BUILD_JDK_JTREG_EXECUTABLES_LIBS_exelauncher := -ldl
94
  endif
95
  BUILD_JDK_JTREG_EXECUTABLES_LIBS_exeNullCallerTest := $(LIBCXX)
96
endif
97

98
ifeq ($(call isTargetOs, macosx), true)
99
  BUILD_JDK_JTREG_EXCLUDE += exelauncher.c
100
  BUILD_JDK_JTREG_LIBRARIES_LIBS_libTestMainKeyWindow := \
101
      -framework Cocoa
102
  BUILD_JDK_JTREG_EXECUTABLES_JDK_LIBS_exeJniInvocationTest := java.base:libjli
103
  BUILD_JDK_JTREG_LIBRARIES_LIBS_libTestDynamicStore := \
104
      -framework Cocoa -framework SystemConfiguration
105
else
106
  BUILD_JDK_JTREG_EXCLUDE += libTestMainKeyWindow.m
107
  BUILD_JDK_JTREG_EXCLUDE += libTestDynamicStore.m
108
  BUILD_JDK_JTREG_EXCLUDE += exeJniInvocationTest.c
109
  BUILD_JDK_JTREG_EXCLUDE += exeLibraryCache.c
110
endif
111

112
ifeq ($(call isTargetOs, linux), true)
113
  # Unconditionally compile with debug symbols and don't ever perform
114
  # stripping during the test libraries' build.
115
  BUILD_JDK_JTREG_LIBRARIES_CFLAGS_libFib := -g
116
  BUILD_JDK_JTREG_LIBRARIES_STRIP_SYMBOLS_libFib := false
117
endif
118

119
ifeq ($(ASAN_ENABLED), true)
120
  # Any executable which launches the JVM and uses a custom launcher needs to explicitly link in the
121
  # default ASan options.
122
  BUILD_JDK_JTREG_EXTRA_FILES += $(TOPDIR)/make/data/asan/asan_default_options.c
123
endif
124

125
ifeq ($(LSAN_ENABLED), true)
126
  # Any executable which launches the JVM and uses a custom launcher needs to explicitly link in the
127
  # default LSan options.
128
  BUILD_JDK_JTREG_EXTRA_FILES += $(TOPDIR)/make/data/lsan/lsan_default_options.c
129
endif
130

131
# This evaluation is expensive and should only be done if this target was
132
# explicitly called.
133
ifneq ($(filter build-test-jdk-jtreg-native, $(MAKECMDGOALS)), )
134
  $(eval $(call SetupTestFilesCompilation, BUILD_JDK_JTREG_LIBRARIES, \
135
      TYPE := LIBRARY, \
136
      SOURCE_DIRS := $(BUILD_JDK_JTREG_NATIVE_SRC), \
137
      OUTPUT_DIR := $(BUILD_JDK_JTREG_OUTPUT_DIR), \
138
      EXCLUDE := $(BUILD_JDK_JTREG_EXCLUDE), \
139
  ))
140

141
  $(eval $(call SetupTestFilesCompilation, BUILD_JDK_JTREG_EXECUTABLES, \
142
      TYPE := PROGRAM, \
143
      SOURCE_DIRS := $(BUILD_JDK_JTREG_NATIVE_SRC), \
144
      OUTPUT_DIR := $(BUILD_JDK_JTREG_OUTPUT_DIR), \
145
      EXCLUDE := $(BUILD_JDK_JTREG_EXCLUDE), \
146
      EXTRA_FILES := $(BUILD_JDK_JTREG_EXTRA_FILES), \
147
  ))
148
endif
149

150
build-test-jdk-jtreg-native: $(BUILD_JDK_JTREG_LIBRARIES) $(BUILD_JDK_JTREG_EXECUTABLES)
151

152
################################################################################
153
# Targets for building test-image.
154
################################################################################
155

156
# Copy to jdk jtreg test image
157
$(eval $(call SetupCopyFiles,COPY_JDK_JTREG_NATIVE, \
158
    SRC := $(BUILD_JDK_JTREG_OUTPUT_DIR), \
159
    DEST := $(TEST_IMAGE_DIR)/jdk/jtreg/native, \
160
    FILES := $(wildcard $(addprefix $(BUILD_JDK_JTREG_OUTPUT_DIR), /bin/* /lib/*)), \
161
    FLATTEN := true, \
162
))
163

164
test-image-jdk-jtreg-native: $(COPY_JDK_JTREG_NATIVE)
165

166
all: build-test-jdk-jtreg-native
167
test-image: test-image-jdk-jtreg-native
168

169
.PHONY: default all build-test-jdk-jtreg-native test-image-jdk-jtreg-native test-image
170

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.