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

[linux] libfontmanager should be linked against headless awt library

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 8u161, 10
    • Fix Version/s: 11
    • Component/s: client-libs
    • Labels:
      None
    • Subcomponent:
      2d
    • Resolved In Build:
      b01
    • OS:
      linux

      Description

      When building libfontmanager.so on Linux with link flags "-Wl,-z,defs" (JDK 8) or "-Xlinker -z -Xlinker defs" (JDK 10) the build fails with:

      /usr/bin/printf "* For target support_native_java.desktop_libfontmanager_BUILD_LIBFONTMANAGER_link:\n"
      * For target support_native_java.desktop_libfontmanager_BUILD_LIBFONTMANAGER_link:
      (/usr/bin/grep -v -e "^Note: including file:" < /disk/openjdk/upstream-sources/openjdk-hs/build/linux-x86_64-normal-server-release/make-support/failure-logs/support_native_java.desktop_libfontmanager_BUILD_LIBFONTMANAGER_link.log || true) | /usr/bin/head -n 12
      /disk/openjdk/upstream-sources/openjdk-hs/build/linux-x86_64-normal-server-release/support/native/java.desktop/libfontmanager/X11FontScaler.o: In function `Java_sun_font_NativeStrikeDisposer_freeNativeScalerContext':
      /disk/openjdk/upstream-sources/openjdk-hs/src/java.desktop/unix/native/libfontmanager/X11FontScaler.c:57: undefined reference to `AWTFreeFont'
      /disk/openjdk/upstream-sources/openjdk-hs/build/linux-x86_64-normal-server-release/support/native/java.desktop/libfontmanager/X11FontScaler.o: In function `Java_sun_font_NativeStrike_createScalerContext':
      /disk/openjdk/upstream-sources/openjdk-hs/src/java.desktop/unix/native/libfontmanager/X11FontScaler.c:96: undefined reference to `AWTLoadFont'
      /disk/openjdk/upstream-sources/openjdk-hs/src/java.desktop/unix/native/libfontmanager/X11FontScaler.c:107: undefined reference to `AWTFontMinByte1'
      /disk/openjdk/upstream-sources/openjdk-hs/src/java.desktop/unix/native/libfontmanager/X11FontScaler.c:108: undefined reference to `AWTFontMinCharOrByte2'
      /disk/openjdk/upstream-sources/openjdk-hs/src/java.desktop/unix/native/libfontmanager/X11FontScaler.c:109: undefined reference to `AWTFontMaxByte1'
      /disk/openjdk/upstream-sources/openjdk-hs/src/java.desktop/unix/native/libfontmanager/X11FontScaler.c:110: undefined reference to `AWTFontMaxCharOrByte2'
      /disk/openjdk/upstream-sources/openjdk-hs/src/java.desktop/unix/native/libfontmanager/X11FontScaler.c:112: undefined reference to `AWTFontDefaultChar'
      /disk/openjdk/upstream-sources/openjdk-hs/build/linux-x86_64-normal-server-release/support/native/java.desktop/libfontmanager/X11FontScaler.o: In function `Java_sun_font_NativeFont_fontExists':
      /disk/openjdk/upstream-sources/openjdk-hs/src/java.desktop/unix/native/libfontmanager/X11FontScaler.c:163: undefined reference to `AWTCountFonts'
      /disk/openjdk/upstream-sources/openjdk-hs/build/linux-x86_64-normal-server-release/support/native/java.desktop/libfontmanager/X11FontScaler.o: In function `Java_sun_font_NativeFont_haveBitmapFonts':
      if test `/usr/bin/wc -l < /disk/openjdk/upstream-sources/openjdk-hs/build/linux-x86_64-normal-server-release/make-support/failure-logs/support_native_java.desktop_libfontmanager_BUILD_LIBFONTMANAGER_link.log` -gt 12; then /usr/bin/echo " ... (rest of output omitted)" ; fi
         ... (rest of output omitted)
      /usr/bin/printf "\n* All command lines available in /disk/openjdk/upstream-sources/openjdk-hs/build/linux-x86_64-normal-server-release/make-support/failure-logs.\n"

      Or on JDK 8 with:

      /disk/openjdk/upstream-sources/openjdk8u-dev/build/linux-x86_64-normal-server-release/jdk/objs/libfontmanager/X11FontScaler.o: In function `Java_sun_font_NativeStrikeDisposer_freeNativeScalerContext':
      /disk/openjdk/upstream-sources/openjdk8u-dev/jdk/src/solaris/native/sun/font/X11FontScaler.c:57: undefined reference to `AWTFreeFont'
      /disk/openjdk/upstream-sources/openjdk8u-dev/build/linux-x86_64-normal-server-release/jdk/objs/libfontmanager/X11FontScaler.o: In function `Java_sun_font_NativeStrike_createScalerContext':
      /disk/openjdk/upstream-sources/openjdk8u-dev/jdk/src/solaris/native/sun/font/X11FontScaler.c:96: undefined reference to `AWTLoadFont'
      /disk/openjdk/upstream-sources/openjdk8u-dev/jdk/src/solaris/native/sun/font/X11FontScaler.c:107: undefined reference to `AWTFontMinByte1'
      /disk/openjdk/upstream-sources/openjdk8u-dev/jdk/src/solaris/native/sun/font/X11FontScaler.c:108: undefined reference to `AWTFontMinCharOrByte2'
      /disk/openjdk/upstream-sources/openjdk8u-dev/jdk/src/solaris/native/sun/font/X11FontScaler.c:109: undefined reference to `AWTFontMaxByte1'
      /disk/openjdk/upstream-sources/openjdk8u-dev/jdk/src/solaris/native/sun/font/X11FontScaler.c:110: undefined reference to `AWTFontMaxCharOrByte2'
      /disk/openjdk/upstream-sources/openjdk8u-dev/jdk/src/solaris/native/sun/font/X11FontScaler.c:112: undefined reference to `AWTFontDefaultChar'
      /disk/openjdk/upstream-sources/openjdk8u-dev/build/linux-x86_64-normal-server-release/jdk/objs/libfontmanager/X11FontScaler.o: In function `Java_sun_font_NativeFont_fontExists':
      /disk/openjdk/upstream-sources/openjdk8u-dev/jdk/src/solaris/native/sun/font/X11FontScaler.c:163: undefined reference to `AWTCountFonts'
      /disk/openjdk/upstream-sources/openjdk8u-dev/build/linux-x86_64-normal-server-release/jdk/objs/libfontmanager/X11FontScaler.o: In function `Java_sun_font_NativeFont_haveBitmapFonts':
      /disk/openjdk/upstream-sources/openjdk8u-dev/jdk/src/solaris/native/sun/font/X11FontScaler.c:187: undefined reference to `AWTCountFonts'
      /disk/openjdk/upstream-sources/openjdk8u-dev/build/linux-x86_64-normal-server-release/jdk/objs/libfontmanager/X11FontScaler.o: In function `Java_sun_font_NativeFont_countGlyphs':
      /disk/openjdk/upstream-sources/openjdk8u-dev/jdk/src/solaris/native/sun/font/X11FontScaler.c:213: undefined reference to `AWTFreeFont'
      /disk/openjdk/upstream-sources/openjdk8u-dev/build/linux-x86_64-normal-server-release/jdk/objs/libfontmanager/X11FontScaler.o: In function `Java_sun_font_NativeFont_getGlyphAdvance':
      /disk/openjdk/upstream-sources/openjdk8u-dev/jdk/src/solaris/native/sun/font/X11FontScaler.c:254: undefined reference to `AWTFontPerChar'
      /disk/openjdk/upstream-sources/openjdk8u-dev/jdk/src/solaris/native/sun/font/X11FontScaler.c:255: undefined reference to `AWTFontPerChar'
      /disk/openjdk/upstream-sources/openjdk8u-dev/jdk/src/solaris/native/sun/font/X11FontScaler.c:256: undefined reference to `AWTCharAdvance'
      /disk/openjdk/upstream-sources/openjdk8u-dev/jdk/src/solaris/native/sun/font/X11FontScaler.c:263: undefined reference to `AWTFontTextExtents16'
      /disk/openjdk/upstream-sources/openjdk8u-dev/jdk/src/solaris/native/sun/font/X11FontScaler.c:264: undefined reference to `AWTCharAdvance'
      /disk/openjdk/upstream-sources/openjdk8u-dev/jdk/src/solaris/native/sun/font/X11FontScaler.c:265: undefined reference to `AWTFreeChar'
      /disk/openjdk/upstream-sources/openjdk8u-dev/build/linux-x86_64-normal-server-release/jdk/objs/libfontmanager/X11FontScaler.o: In function `Java_sun_font_NativeFont_getGlyphImageNoDefault':
      /disk/openjdk/upstream-sources/openjdk8u-dev/jdk/src/solaris/native/sun/font/X11FontScaler.c:288: undefined reference to `AWTFontGenerateImage'
      /disk/openjdk/upstream-sources/openjdk8u-dev/build/linux-x86_64-normal-server-release/jdk/objs/libfontmanager/X11FontScaler.o: In function `Java_sun_font_NativeFont_getGlyphImage':
      /disk/openjdk/upstream-sources/openjdk8u-dev/jdk/src/solaris/native/sun/font/X11FontScaler.c:309: undefined reference to `AWTFontGenerateImage'
      /disk/openjdk/upstream-sources/openjdk8u-dev/build/linux-x86_64-normal-server-release/jdk/objs/libfontmanager/X11FontScaler.o: In function `Java_sun_font_NativeFont_getFontMetrics':
      /disk/openjdk/upstream-sources/openjdk8u-dev/jdk/src/solaris/native/sun/font/X11FontScaler.c:330: undefined reference to `AWTFontAscent'
      /disk/openjdk/upstream-sources/openjdk8u-dev/jdk/src/solaris/native/sun/font/X11FontScaler.c:331: undefined reference to `AWTFontDescent'
      /disk/openjdk/upstream-sources/openjdk8u-dev/jdk/src/solaris/native/sun/font/X11FontScaler.c:332: undefined reference to `AWTFontMaxBounds'
      /disk/openjdk/upstream-sources/openjdk8u-dev/jdk/src/solaris/native/sun/font/X11FontScaler.c:332: undefined reference to `AWTCharAdvance'
      /disk/openjdk/upstream-sources/openjdk8u-dev/build/linux-x86_64-normal-server-release/jdk/objs/libfontmanager/X11TextRenderer.o: In function `Java_sun_font_X11TextRenderer_doDrawGlyphList':
      /disk/openjdk/upstream-sources/openjdk8u-dev/jdk/src/solaris/native/sun/font/X11TextRenderer.c:71: undefined reference to `AWTDrawGlyphList'
      /disk/openjdk/upstream-sources/openjdk8u-dev/build/linux-x86_64-normal-server-release/jdk/objs/libfontmanager/sunFont.o: In function `Java_sun_font_StrikeCache_freeIntMemory':
      /disk/openjdk/upstream-sources/openjdk8u-dev/jdk/src/share/native/sun/font/sunFont.c:260: undefined reference to `AccelGlyphCache_RemoveAllCellInfos'
      /disk/openjdk/upstream-sources/openjdk8u-dev/build/linux-x86_64-normal-server-release/jdk/objs/libfontmanager/sunFont.o: In function `Java_sun_font_StrikeCache_freeLongMemory':
      /disk/openjdk/upstream-sources/openjdk8u-dev/jdk/src/share/native/sun/font/sunFont.c:291: undefined reference to `AccelGlyphCache_RemoveAllCellInfos'
      collect2: error: ld returned 1 exit status
      gmake[2]: *** [lib/Awt2dLibraries.gmk:908: /disk/openjdk/upstream-sources/openjdk8u-dev/build/linux-x86_64-normal-server-release/jdk/lib/amd64/libfontmanager.so] Error 1
      gmake[2]: *** Waiting for unfinished jobs....
      gmake[2]: Leaving directory '/disk/openjdk/upstream-sources/openjdk8u-dev/jdk/make'

      As it turns out libawt_headless.so exports the missing symbols, but libfontmanager.so's link command does not include -lawt_headless.

      $ nm -D build/linux-x86_64-normal-server-release/jdk/lib/amd64/libawt_headless.so | grep T | grep AWTDrawGlyphList
      0000000000003710 T AWTDrawGlyphList

      libawt.so (the non-headless version) on the other hand doesn't have it:

      $ nm -D build/linux-x86_64-normal-server-release/jdk/lib/amd64/libawt.so | grep T | grep AWTDrawGlyphList
      <nothing>

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                sgehwolf Severin Gehwolf
                Reporter:
                sgehwolf Severin Gehwolf
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: