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

JDK fails to build due to undefined symbol in libpng on LoongArch64

XMLWordPrintable

    • b10
    • other
    • linux

        Steps (on loongarch64 platforms):
        $ bash configure --with-boot-jdk=../jdk-24 --with-jvm-variants=zero
        $ make images

        Errors:
        Creating jdk/modules/jdk.jpackage/jdk/jpackage/internal/resources/libjpackageapplauncheraux.so from 19 file(s)
        /usr/bin/ld: /root/aoqi/tmp/jdk-ls/build/linux-loongarch64-zero-release/support/native/java.desktop/libsplashscreen/pngrutil.o: in function `png_do_read_interlace':
        make/src/java.desktop/share/native/libsplashscreen/libpng/pngrutil.c:3961:(.text+0x2e7c): undefined reference to `png_init_filter_functions_lsx'
        collect2: error: ld returned 1 exit status
        gmake[3]: *** [lib/ClientLibraries.gmk:224: /root/aoqi/tmp/jdk-ls/build/linux-loongarch64-zero-release/support/modules_libs/java.desktop/libsplashscreen.so] Error 1
        gmake[3]: *** Waiting for unfinished jobs....
        gmake[2]: *** [make/Main.gmk:188: java.desktop-libs] Error 2
        gmake[2]: *** Waiting for unfinished jobs....
        Creating ct.sym classes

        Cause:
        After https://bugs.openjdk.org/browse/JDK-8329004, the following code was added.

        #ifndef PNG_LOONGARCH_LSX_OPT
        # if defined(__loongarch_sx)
        # define PNG_LOONGARCH_LSX_OPT 1
        # else
        # define PNG_LOONGARCH_LSX_OPT 0
        # endif
        #endif

        Some compilers on LoongArch64 platforms enable __loongarch_sx, which causes PNG_LOONGARCH_LSX_OPT to be defined and an undefined error occurs. Refer to https://bugs.openjdk.org/browse/JDK-8078245, add -DPNG_LOONGARCH_LSX_OPT=0 to LIBSPLASHSCREEN_CFLAGS flags.

              aoqi Qi Ao
              aoqi Qi Ao
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: