Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8286582

Build fails on macos aarch64 when using --with-zlib=bundled

    XMLWordPrintable

    Details

      Backports

        Description

        As noted in https://mail.openjdk.java.net/pipermail/build-dev/2022-March/033956.html, using --with-zlib=bundled, currently fails on macos aarch64 with errors like:

        build errors:

        /home/me/jdk/src/java.base/share/native/libzip/zlib/gzlib.c:276:9:
        error: implicit declaration of function 'lseek' is invalid in C99
        [-Werror,-Wimplicit-function-declaration]
                 LSEEK(state->fd, 0, SEEK_END); /* so gzoffset() is correct */
                 ^
        /home/me/jdk/src/java.base/share/native/libzip/zlib/gzlib.c:38:17: note:
        expanded from macro 'LSEEK'
        # define LSEEK lseek
                         ^
        /home/me/jdk/src/java.base/share/native/libzip/zlib/gzlib.c:276:9: note:
        did you mean 'fseek'?
        /home/me/jdk/src/java.base/share/native/libzip/zlib/gzlib.c:38:17: note:
        expanded from macro 'LSEEK'
        # define LSEEK lseek
                         ^
        /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/include/stdio.h:162:6:
        note: 'fseek' declared here
        int fseek(FILE *, long, int);
                  ^
        /home/me/jdk/src/java.base/share/native/libzip/zlib/gzlib.c:282:24:
        error: implicit declaration of function 'lseek' is invalid in C99
        [-Werror,-Wimplicit-function-declaration]
                 state->start = LSEEK(state->fd, 0, SEEK_CUR);
                                ^
        /home/me/jdk/src/java.base/share/native/libzip/zlib/gzlib.c:38:17: note:
        expanded from macro 'LSEEK'
        # define LSEEK lseek
                         ^
        /home/me/jdk/src/java.base/share/native/libzip/zlib/gzlib.c:383:9:
        error: implicit declaration of function 'lseek' is invalid in C99
        [-Werror,-Wimplicit-function-declaration]
             if (LSEEK(state->fd, state->start, SEEK_SET) == -1)
                 ^
        /home/me/jdk/src/java.base/share/native/libzip/zlib/gzlib.c:38:17: note:
        expanded from macro 'LSEEK'
        # define LSEEK lseek
                         ^
        /home/me/jdk/src/java.base/share/native/libzip/zlib/gzlib.c:424:15:
        error: implicit declaration of function 'lseek' is invalid in C99
        [-Werror,-Wimplicit-function-declaration]
                 ret = LSEEK(state->fd, offset - state->x.have, SEEK_CUR);
                       ^
        /home/me/jdk/src/java.base/share/native/libzip/zlib/gzlib.c:38:17: note:
        expanded from macro 'LSEEK'
        # define LSEEK lseek
                         ^
        /home/me/jdk/src/java.base/share/native/libzip/zlib/gzlib.c:520:14:
        error: implicit declaration of function 'lseek' is invalid in C99
        [-Werror,-Wimplicit-function-declaration]
             offset = LSEEK(state->fd, 0, SEEK_CUR);
                      ^
        /home/me/jdk/src/java.base/share/native/libzip/zlib/gzlib.c:38:17: note:
        expanded from macro 'LSEEK'
        # define LSEEK lseek
                         ^
        5 errors generated.

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                jpai Jaikiran Pai
                Reporter:
                jpai Jaikiran Pai
                Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: