Skip to content

Commit 8363d9d

Browse files
committed
8286582: Build fails on macos aarch64 when using --with-zlib=bundled
Backport-of: 50d47de8358e2f22bf3a4a165d660c25ef6eacbc
1 parent 27faf15 commit 8363d9d

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-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, 2017, 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
@@ -214,6 +214,9 @@ AC_DEFUN_ONCE([LIB_SETUP_ZLIB],
214214
LIBZ_LIBS=""
215215
if test "x$USE_EXTERNAL_LIBZ" = "xfalse"; then
216216
LIBZ_CFLAGS="$LIBZ_CFLAGS -I$TOPDIR/src/java.base/share/native/libzip/zlib"
217+
if test "x$OPENJDK_TARGET_OS" = xmacosx; then
218+
LIBZ_CFLAGS="$LIBZ_CFLAGS -DHAVE_UNISTD_H"
219+
fi
217220
else
218221
LIBZ_LIBS="-lz"
219222
fi

make/lib/Awt2dLibraries.gmk

Lines changed: 4 additions & 2 deletions
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
@@ -810,6 +810,7 @@ ifeq ($(ENABLE_HEADLESS_ONLY), false)
810810

811811
ifeq ($(USE_EXTERNAL_LIBZ), false)
812812
LIBSPLASHSCREEN_EXTRA_SRC += java.base:libzip/zlib
813+
LIBZ_DISABLED_WARNINGS_CLANG := format-nonliteral
813814
endif
814815

815816
ifeq ($(OPENJDK_TARGET_OS), macosx)
@@ -869,7 +870,8 @@ ifeq ($(ENABLE_HEADLESS_ONLY), false)
869870
EXTRA_HEADER_DIRS := $(LIBSPLASHSCREEN_HEADER_DIRS), \
870871
DISABLED_WARNINGS_gcc := sign-compare type-limits unused-result \
871872
maybe-uninitialized shift-negative-value implicit-fallthrough, \
872-
DISABLED_WARNINGS_clang := incompatible-pointer-types deprecated-declarations, \
873+
DISABLED_WARNINGS_clang := incompatible-pointer-types deprecated-declarations \
874+
$(LIBZ_DISABLED_WARNINGS_CLANG), \
873875
DISABLED_WARNINGS_solstudio := E_NEWLINE_NOT_LAST E_DECLARATION_IN_CODE \
874876
E_STATEMENT_NOT_REACHED, \
875877
DISABLED_WARNINGS_microsoft := 4018 4244 4267, \

make/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, 2018, 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
@@ -149,6 +149,7 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBZIP, \
149149
$(LIBZ_CFLAGS), \
150150
CFLAGS_unix := $(BUILD_LIBZIP_MMAP) -UDEBUG, \
151151
DISABLED_WARNINGS_gcc := unused-function implicit-fallthrough, \
152+
DISABLED_WARNINGS_clang := format-nonliteral, \
152153
LDFLAGS := $(LDFLAGS_JDKLIB) \
153154
$(call SET_SHARED_LIBRARY_ORIGIN), \
154155
LIBS_unix := -ljvm -ljava $(LIBZ_LIBS), \

0 commit comments

Comments
 (0)