Skip to content

Commit 6f0f842

Browse files
committed
8286582: Build fails on macos aarch64 when using --with-zlib=bundled
Backport-of: 50d47de8358e2f22bf3a4a165d660c25ef6eacbc
1 parent 68456bb commit 6f0f842

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

make/autoconf/lib-bundled.m4

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2011, 2022, 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
@@ -217,6 +217,9 @@ AC_DEFUN_ONCE([LIB_SETUP_ZLIB],
217217
LIBZ_LIBS=""
218218
if test "x$USE_EXTERNAL_LIBZ" = "xfalse"; then
219219
LIBZ_CFLAGS="$LIBZ_CFLAGS -I$TOPDIR/src/java.base/share/native/libzip/zlib"
220+
if test "x$OPENJDK_TARGET_OS" = xmacosx; then
221+
LIBZ_CFLAGS="$LIBZ_CFLAGS -DHAVE_UNISTD_H"
222+
fi
220223
else
221224
LIBZ_LIBS="-lz"
222225
fi

make/modules/java.base/lib/CoreLibraries.gmk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2011, 2022, 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
@@ -135,6 +135,7 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBZIP, \
135135
$(LIBZ_CFLAGS), \
136136
CFLAGS_unix := $(BUILD_LIBZIP_MMAP) -UDEBUG, \
137137
DISABLED_WARNINGS_gcc := unused-function implicit-fallthrough, \
138+
DISABLED_WARNINGS_clang := format-nonliteral, \
138139
LDFLAGS := $(LDFLAGS_JDKLIB) \
139140
$(call SET_SHARED_LIBRARY_ORIGIN), \
140141
LIBS_unix := -ljvm -ljava $(LIBZ_LIBS), \

make/modules/java.desktop/lib/Awt2dLibraries.gmk

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2011, 2021, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2011, 2022, 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
@@ -680,6 +680,7 @@ ifeq ($(ENABLE_HEADLESS_ONLY), false)
680680

681681
ifeq ($(USE_EXTERNAL_LIBZ), false)
682682
LIBSPLASHSCREEN_EXTRA_SRC += java.base:libzip/zlib
683+
LIBZ_DISABLED_WARNINGS_CLANG := format-nonliteral
683684
endif
684685

685686
ifeq ($(call isTargetOs, macosx), true)
@@ -749,7 +750,7 @@ ifeq ($(ENABLE_HEADLESS_ONLY), false)
749750
maybe-uninitialized shift-negative-value implicit-fallthrough \
750751
unused-function, \
751752
DISABLED_WARNINGS_clang := incompatible-pointer-types sign-compare \
752-
deprecated-declarations null-pointer-subtraction, \
753+
deprecated-declarations null-pointer-subtraction $(LIBZ_DISABLED_WARNINGS_CLANG), \
753754
DISABLED_WARNINGS_microsoft := 4018 4244 4267, \
754755
LDFLAGS := $(LDFLAGS_JDKLIB) \
755756
$(call SET_SHARED_LIBRARY_ORIGIN), \

0 commit comments

Comments
 (0)