Review request (XS): 7110396: Sound code fails to build on multiarch Linux systems

mark.reinhold at mark.reinhold at
Thu Nov 10 05:24:56 UTC 2011

Some Linux distros have started to adopt a "multiarch" filesystem layout for
shared libraries in order to support the installation of packages for multiple
hardware architectures on a single system.  For more information see, e.g.,

In Ubuntu 11.10 the ALSA shared library, libasound2, was converted to the
multiarch format and so its files moved from their old location, /usr/lib,
to /usr/lib/${ARCH_TRIPLET}.  This caused the JDK build to fail when linking
the Java sound library.  The root cause appears to be that gcc only tries to
resolve undefined symbols against a multiarch library if the library is named
on the command line after the object files containing those symbols.

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

I'll push this into JDK 8.  It would trivially backport to 7.


--- a/make/javax/sound/jsoundalsa/Makefile
+++ b/make/javax/sound/jsoundalsa/Makefile
@@ -65,7 +65,7 @@
        $(MIDIFILES_export) \
-LDFLAGS += -lasound
+EXTRA_LIBS += -lasound

- Mark

More information about the build-dev mailing list