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

Sound code fails to build with gcc 4.6 on multiarch Linux systems

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3
    • 8
    • 7
    • infrastructure
    • None
    • b23
    • generic, x86
    • generic, linux_ubuntu

    Backports

      Description

        The JDK 8 build fails on Ubuntu 11.10 with gcc 4.6 when linking the
        Java sound native library against libasound2, the ALSA shared library.

        It appears that in this instance gcc only tries to resolve undefined
        symbols against a library if the library is named on the command line
        after the object files containing those symbols. This behavior is in
        accordance with the GNU ld specification [1]. On earlier versions of
        Ubuntu, however, this link step worked even though the asound library
        was named on the gcc command line ahead of the object files that refer
        to it.

        The fix is simply to move -lasound to the end of the gcc invocation.

        This may or may not be related to the conversion of libasound2 to the
        multiarch format in Ubuntu 11.10 [2].

        [1] http://stackoverflow.com/questions/45135/linker-order-gcc/409402#409402
        [2] http://wiki.debian.org/Multiarch

        Attachments

          Issue Links

            Activity

              People

                mr Mark Reinhold
                mr Mark Reinhold
                Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: