Skip to content

Commit 35aabb6

Browse files
committed
JBR-8111 add vulkan package & calculate GLIBC expected version in checking dependencies
1 parent 43e9aea commit 35aabb6

File tree

5 files changed

+38
-12
lines changed

5 files changed

+38
-12
lines changed

jb/project/tools/common/scripts/common.sh

+6
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,12 @@ else
102102
WITH_BUNDLED_FREETYPE=""
103103
fi
104104

105+
if [ "$bundle_type" == "vk" ]; then
106+
WITH_VULKAN="--with-vulkan"
107+
else
108+
WITH_VULKAN=""
109+
fi
110+
105111
REPRODUCIBLE_BUILD_OPTS="--with-source-date=$SOURCE_DATE_EPOCH
106112
--with-hotspot-build-time=$BUILD_TIME
107113
--with-copyright-year=$COPYRIGHT_YEAR

jb/project/tools/linux/scripts/mkimages_aarch64.sh

+8-3
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ function do_configure {
3535
--with-version-opt=b"$build_number" \
3636
--with-boot-jdk="$BOOT_JDK" \
3737
--enable-cds=yes \
38-
--with-vulkan \
38+
$WITH_VULKAN \
3939
$DISABLE_WARNINGS_AS_ERRORS \
4040
$STATIC_CONF_ARGS \
4141
$REPRODUCIBLE_BUILD_OPTS \
@@ -113,6 +113,11 @@ case "$bundle_type" in
113113
jbr_name_postfix="_${bundle_type}"
114114
do_maketest=1
115115
;;
116+
"vk")
117+
do_reset_changes=1
118+
jbr_name_postfix="_${bundle_type}"
119+
do_maketest=1
120+
;;
116121
"nomod" | "")
117122
bundle_type=""
118123
;;
@@ -141,7 +146,7 @@ JBRSDK_BUNDLE=jbrsdk
141146
echo Fixing permissions
142147
chmod -R a+r $JSDK
143148

144-
if [ "$bundle_type" == "jcef" ] || [ "$bundle_type" == "fd" ]; then
149+
if [ "$bundle_type" == "jcef" ] || [ "$bundle_type" == "vk" ] || [ "$bundle_type" == "fd" ]; then
145150
git apply -p0 < jb/project/tools/patches/add_jcef_module_aarch64.patch || do_exit $?
146151
update_jsdk_mods $JSDK $JCEF_PATH/jmods $JSDK/jmods $JSDK_MODS_DIR || do_exit $?
147152
cp $JCEF_PATH/jmods/* $JSDK_MODS_DIR # $JSDK/jmods is not changed
@@ -154,7 +159,7 @@ create_image_bundle "jbr${jbr_name_postfix}" "jbr" $JSDK_MODS_DIR "$modules" ||
154159

155160
# create sdk image bundle
156161
modules=$(cat $JSDK/release | grep MODULES | sed s/MODULES=//g | sed s/' '/','/g | sed s/\"//g | sed s/\\n//g) || do_exit $?
157-
if [ "$bundle_type" == "jcef" ] || [ "$bundle_type" == "fd" ] || [ "$bundle_type" == "$JBRSDK_BUNDLE" ]; then
162+
if [ "$bundle_type" == "jcef" ] || [ "$bundle_type" == "vk" ] || [ "$bundle_type" == "fd" ] || [ "$bundle_type" == "$JBRSDK_BUNDLE" ]; then
158163
modules=${modules},$(get_mods_list "$JCEF_PATH"/jmods)
159164
fi
160165
create_image_bundle "$JBRSDK_BUNDLE${jbr_name_postfix}" $JBRSDK_BUNDLE $JSDK_MODS_DIR "$modules" || do_exit $?

jb/project/tools/linux/scripts/mkimages_x64.sh

+8-3
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ function do_configure {
4242
--with-version-opt=b"$build_number" \
4343
--with-boot-jdk="$BOOT_JDK" \
4444
--enable-cds=yes \
45-
--with-vulkan \
45+
$WITH_VULKAN \
4646
$LINUX_TARGET \
4747
$DISABLE_WARNINGS_AS_ERRORS \
4848
$STATIC_CONF_ARGS \
@@ -121,6 +121,11 @@ case "$bundle_type" in
121121
jbr_name_postfix="_${bundle_type}"
122122
do_maketest=1
123123
;;
124+
"vk")
125+
do_reset_changes=1
126+
jbr_name_postfix="_${bundle_type}"
127+
do_maketest=1
128+
;;
124129
"nomod" | "")
125130
bundle_type=""
126131
;;
@@ -149,7 +154,7 @@ JBRSDK_BUNDLE=jbrsdk
149154
echo Fixing permissions
150155
chmod -R a+r $JSDK
151156

152-
if [ "$bundle_type" == "jcef" ] || [ "$bundle_type" == "fd" ]; then
157+
if [ "$bundle_type" == "jcef" ] || [ "$bundle_type" == "vk" ] || [ "$bundle_type" == "fd" ]; then
153158
git apply -p0 < jb/project/tools/patches/add_jcef_module.patch || do_exit $?
154159
update_jsdk_mods $JSDK $JCEF_PATH/jmods $JSDK/jmods $JSDK_MODS_DIR || do_exit $?
155160
cp $JCEF_PATH/jmods/* $JSDK_MODS_DIR # $JSDK/jmods is not changed
@@ -162,7 +167,7 @@ create_image_bundle "jbr${jbr_name_postfix}" "jbr" $JSDK_MODS_DIR "$modules" ||
162167

163168
# create sdk image bundle
164169
modules=$(cat $JSDK/release | grep MODULES | sed s/MODULES=//g | sed s/' '/','/g | sed s/\"//g | sed s/\\n//g) || do_exit $?
165-
if [ "$bundle_type" == "jcef" ] || [ "$bundle_type" == "fd" ] || [ "$bundle_type" == "$JBRSDK_BUNDLE" ]; then
170+
if [ "$bundle_type" == "jcef" ] || [ "$bundle_type" == "vk" ] || [ "$bundle_type" == "fd" ] || [ "$bundle_type" == "$JBRSDK_BUNDLE" ]; then
166171
modules=${modules},$(get_mods_list "$JCEF_PATH"/jmods)
167172
fi
168173
create_image_bundle "$JBRSDK_BUNDLE${jbr_name_postfix}" $JBRSDK_BUNDLE $JSDK_MODS_DIR "$modules" || do_exit $?

jb/project/tools/linux/scripts/mkimages_x86.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ WITH_DEBUG_LEVEL="--with-debug-level=release"
9292
RELEASE_NAME=linux-x86-server-release
9393

9494
case "$bundle_type" in
95-
"jcef")
95+
"jcef" | "vk")
9696
echo "not implemented" && do_exit 1
9797
;;
9898
"nomod" | "")
@@ -119,7 +119,7 @@ JBRSDK_BUNDLE=jbrsdk
119119
echo Fixing permissions
120120
chmod -R a+r $JSDK
121121

122-
if [ "$bundle_type" == "jcef" ] || [ "$bundle_type" == "fd" ]; then
122+
if [ "$bundle_type" == "jcef" ] || [ "$bundle_type" == "fd" ] || [ "$bundle_type" == "vk" ]; then
123123
jbr_name_postfix="_${bundle_type}"
124124
else
125125
jbr_name_postfix=""

test/jdk/jb/build/VerifyDependencies.java

+14-4
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,18 @@
3030
/**
3131
* @test
3232
* @summary VerifyDependencies checks readability verifies that a Linux shared
33-
* library has no dependency on symbols from glibc version higher than 2.17
33+
* library has no dependency on symbols from glibc version higher than <code>expectedVersion</code>
3434
* @run main VerifyDependencies
3535
* @requires (os.family == "linux")
3636
*/
3737

3838
public class VerifyDependencies {
3939

40-
static final public String EXPECTED_VERSION = "2.17";
40+
static final public String EXPECTED_VERSION_LEGACY = "2.17";
41+
static final public String EXPECTED_VERSION_VULKAN = "2.28";
42+
43+
static String expectedVersion;
44+
4145
public static void verifyLibrary(String libraryPath) throws IOException {
4246
Process process;
4347
BufferedReader reader;
@@ -52,12 +56,12 @@ public static void verifyLibrary(String libraryPath) throws IOException {
5256
System.out.println(line);
5357
if (line.contains("GLIBC_")) {
5458
String version = extractVersion(line);
55-
if (compareVersions(version, EXPECTED_VERSION) > 0) {
59+
if (compareVersions(version, expectedVersion) > 0) {
5660
throw new RuntimeException(libraryPath + " has a dependency on glibc version " + version);
5761
}
5862
}
5963
}
60-
System.out.println(libraryPath + " has no dependency on glibc version higher than " + EXPECTED_VERSION);
64+
System.out.println(libraryPath + " has no dependency on glibc version higher than " + expectedVersion);
6165
}
6266

6367
private static String extractVersion(String line) {
@@ -125,6 +129,12 @@ public boolean accept(File dir, String name) {
125129

126130
public static void main(String[] args) throws IOException {
127131
String javaHome = System.getProperty("java.home");
132+
133+
String vendorVersion = System.getProperty("java.vendor.version");
134+
expectedVersion = vendorVersion.substring(Math.max(vendorVersion.length() - 3, 0)).compareTo("-vk") == 0
135+
? EXPECTED_VERSION_VULKAN : EXPECTED_VERSION_LEGACY;
136+
System.out.println("supporting glibc version is not less than " + expectedVersion);
137+
128138
findInDirectory(javaHome + "/bin", false);
129139
findInDirectory(javaHome + "/lib", true);
130140
}

0 commit comments

Comments
 (0)