RFR: 8286582: Build fails on macos aarch64 when using --with-zlib=bundled [v2]
Magnus Ihse Bursie
ihse at openjdk.java.net
Wed May 11 18:11:48 UTC 2022
On Wed, 11 May 2022 15:03:56 GMT, Lance Andersen <lancea at openjdk.org> wrote:
>> Jaikiran Pai has updated the pull request incrementally with four additional commits since the last revision:
>>
>> - copyright years
>> - disable format-nonliteral warning when building LIBSPLASHSCREEN with bundled zlib
>> - Magnus' suggestion - make the LIBZ_CFLAGS more readable in the build file
>> - Magnus' suggestion - Disable format-nonliteral in build section of zlib instead of source code
>
> make/autoconf/lib-bundled.m4 line 220:
>
>> 218: if test "x$USE_EXTERNAL_LIBZ" = "xfalse"; then
>> 219: LIBZ_CFLAGS="$LIBZ_CFLAGS -I$TOPDIR/src/java.base/share/native/libzip/zlib"
>> 220: if test "x$OPENJDK_TARGET_OS" = xmacosx; then
>
> Please add a comment here as to why we are doing this
@LanceAndersen Is that really needed? We normally don't comment on the reason why certain code needs certain defines. We tried to document some compiler flags in the beginning, but it turned out that most command lines ended up as essays, and this were not helpful. I think it's quite obvious what this code does: libz requires the define HAVE_UNISTD_H on macOS. I'm not even sure how you'd formulate a "why" -- "otherwise it does not work properly"?
> make/modules/java.base/lib/CoreLibraries.gmk line 139:
>
>> 137: DISABLED_WARNINGS_gcc := unused-function implicit-fallthrough, \
>> 138: DISABLED_WARNINGS_clang := format-nonliteral, \
>> 139: LDFLAGS := $(LDFLAGS_JDKLIB) \
>
> A comment would be good here also as to the reasoning
And once again, we never comment on why we disable warnings. The context is clear enough -- there is a compiler warning that is not applicable to this module. Especially for 3rd party code, which is not nearly as stringent as we are about enabling warnings.
-------------
PR: https://git.openjdk.java.net/jdk/pull/8651
More information about the build-dev
mailing list