[pulseaudio-tickets] [PulseAudio] #902: build failure with --as-needed: undefined reference to `pa_xmalloc'

PulseAudio trac-noreply at tango.0pointer.de
Thu Feb 3 22:40:28 PST 2011


#902: build failure with --as-needed: undefined reference to `pa_xmalloc'
--------------------+-------------------------------------------------------
 Reporter:  Oxyde   |       Owner:  lennart 
     Type:  defect  |      Status:  new     
Milestone:          |   Component:  libpulse
 Keywords:          |  
--------------------+-------------------------------------------------------
 Building pulseaudio with LDFLAGS="-Wl,--as-needed" fails. I run Fedora,
 but it seems Ubuntu Natty and Debian have set the default linker setting
 to include '--as-needed'.

 A solution would be add libpulse.la in
 [http://git.0pointer.de/?p=pulseaudio.git;a=blob;f=src/Makefile.am;h=0687e40933283a526dd07aca1dae635ef79d4dc1;hb=HEAD#l624
 Makefile.am]:
 {{{
 -libpulsecommon_ at PA_MAJORMINOR@_la_LIBADD = $(AM_LIBADD)
 $(LIBWRAP_LIBS) $(WINSOCK_LIBS) $(LTLIBICONV) $(LIBSAMPLERATE_LIBS)
 $(LIBSNDFILE_LIBS)
 +libpulsecommon_ at PA_MAJORMINOR@_la_LIBADD =
 libpulse.la $(AM_LIBADD) $(LIBWRAP_LIBS) $(WINSOCK_LIBS) $(LTLIBICONV)
 $(LIBSAMPLERATE_LIBS) $(LIBSNDFILE_LIBS)
 }}}

 But this won't work due to the cyclic dependency of libpulse and
 libpulsecommon.
 [http://git.0pointer.de/?p=pulseaudio.git;a=blob;f=src/Makefile.am;h=0687e40933283a526dd07aca1dae635ef79d4dc1;hb=HEAD#l635
 Makefile.am]:
 {{{
 ## Please note that libpulsecommon implicitly also depends on<
 ## libpulse! i.e. we have a cyclic dependancy here. Which is intended
 ## since libpulse only includes stable, official APIs, while
 ## libpulsecommon only includes unofficial APIs.
 }}}

 The build failure is:
 {{{
 libtool: link: gcc -std=gnu99 -I../src -I../src/modules
 -I../src/modules -pthread -D_POSIX_PTHREAD_SEMANTICS
 -DPA_BUILDDIR=\"/home/Oxyde/gnome/pulseaudio/src\"
 -DPA_DLSEARCHPATH=\"/opt/gnome/lib64/pulse-1.0/modules\"
 -DPA_DEFAULT_CONFIG_DIR=\"/opt/gnome/etc/pulse\"
 -DPA_BINARY=\"/opt/gnome/bin/pulseaudio\"
 -DPA_SYSTEM_RUNTIME_PATH=\"/opt/gnome/var/run/pulse\"
 -DPA_SYSTEM_CONFIG_PATH=\"/opt/gnome/var/lib/pulse\"
 -DPA_SYSTEM_STATE_PATH=\"/opt/gnome/var/lib/pulse\" -DAO_REQUIRE_CAS
 -DPULSE_LOCALEDIR=\"/opt/gnome/share/locale\"
 -DPA_MACHINE_ID=\"/opt/gnome/var/lib/dbus/machine-id\"
 -DPA_ALSA_PATHS_DIR=\"/opt/gnome/share/pulseaudio/alsa-mixer/paths\"
 -DPA_ALSA_PROFILE_SETS_DIR=\"/opt/gnome/share/pulseaudio/alsa-mixer
 /profile-sets\"
 -O0 -g -Wall -W -Wextra -pipe -Wno-long-long -Winline -Wvla
 -Wno-overlength-strings -Wunsafe-loop-optimizations -Wundef -Wformat=2
 -Wlogical-op -Wsign-compare -Wformat-security -Wmissing-include-dirs
 -Wformat-nonliteral -Wold-style-definition -Wpointer-arith -Winit-self
 -Wdeclaration-after-statement -Wfloat-equal -Wmissing-prototypes
 -Wstrict-prototypes -Wredundant-decls -Wmissing-declarations
 -Wmissing-noreturn -Wshadow -Wendif-labels -Wcast-align
 -Wstrict-aliasing=2 -Wwrite-strings -Wno-unused-parameter -ffast-math
 -Wp,-D_FORTIFY_SOURCE=2 -fno-common -fdiagnostics-show-option
 -I/opt/gnome/include/dbus-1.0 -I/opt/gnome/lib64/dbus-1.0/include
 -Wl,-z -Wl,nodelete -Wl,--as-needed -o .libs/mcalign-test
 mcalign_test-mcalign-test.o ./.libs/libpulsecore-1.0.so
 -L/opt/gnome/lib64 -lltdl /opt/gnome/lib64/libspeexdsp.so
 /home/Oxyde/gnome/pulseaudio/src/.libs/libpulse.so ./.libs/libpulse.so
 /home/Oxyde/gnome/pulseaudio/src/.libs/libpulsecommon-1.0.so
 ./.libs/libpulsecommon-1.0.so /opt/gnome/lib64/libsndfile.so
 /opt/gnome/lib64/libdbus-1.so -lgdbm -lpthread -lrt -ldl -lm -pthread
 -Wl,-rpath -Wl,/opt/gnome/lib64
 /home/Oxyde/gnome/pulseaudio/src/.libs/libpulsecommon-1.0.so: undefined
 reference to `pa_xmalloc'
 /home/Oxyde/gnome/pulseaudio/src/.libs/libpulsecommon-1.0.so: undefined
 reference to `pa_sample_spec_valid'
 /home/Oxyde/gnome/pulseaudio/src/.libs/libpulsecommon-1.0.so: undefined
 reference to `pa_timeval_store'
 /home/Oxyde/gnome/pulseaudio/src/.libs/libpulsecommon-1.0.so: undefined
 reference to `pa_proplist_from_string'
 /home/Oxyde/gnome/pulseaudio/src/.libs/libpulsecommon-1.0.so: undefined
 reference to `pa_timeval_add'
 /home/Oxyde/gnome/pulseaudio/src/.libs/libpulsecommon-1.0.so: undefined
 reference to `pa_timeval_diff'
 /home/Oxyde/gnome/pulseaudio/src/.libs/libpulsecommon-1.0.so: undefined
 reference to `pa_timeval_load'
 /home/Oxyde/gnome/pulseaudio/src/.libs/libpulsecommon-1.0.so: undefined
 reference to `pa_msleep'
 /home/Oxyde/gnome/pulseaudio/src/.libs/libpulsecommon-1.0.so: undefined
 reference to `pa_bytes_snprint'
 /home/Oxyde/gnome/pulseaudio/src/.libs/libpulsecommon-1.0.so: undefined
 reference to `pa_xmemdup'
 /home/Oxyde/gnome/pulseaudio/src/.libs/libpulsecommon-1.0.so: undefined
 reference to `pa_proplist_contains'
 /home/Oxyde/gnome/pulseaudio/src/.libs/libpulsecommon-1.0.so: undefined
 reference to `pa_proplist_free'
 /home/Oxyde/gnome/pulseaudio/src/.libs/libpulsecommon-1.0.so: undefined
 reference to `pa_get_host_name'
 /home/Oxyde/gnome/pulseaudio/src/.libs/libpulsecommon-1.0.so: undefined
 reference to `pa_sample_format_is_be'
 /home/Oxyde/gnome/pulseaudio/src/.libs/libpulsecommon-1.0.so: undefined
 reference to `pa_get_user_name'
 /home/Oxyde/gnome/pulseaudio/src/.libs/libpulsecommon-1.0.so: undefined
 reference to `pa_proplist_sets'
 /home/Oxyde/gnome/pulseaudio/src/.libs/libpulsecommon-1.0.so: undefined
 reference to `pa_get_fqdn'
 /home/Oxyde/gnome/pulseaudio/src/.libs/libpulsecommon-1.0.so: undefined
 reference to `pa_xstrdup'
 /home/Oxyde/gnome/pulseaudio/src/.libs/libpulsecommon-1.0.so: undefined
 reference to `pa_utf8_to_locale'
 /home/Oxyde/gnome/pulseaudio/src/.libs/libpulsecommon-1.0.so: undefined
 reference to `pa_timeval_cmp'
 /home/Oxyde/gnome/pulseaudio/src/.libs/libpulsecommon-1.0.so: undefined
 reference to `pa_xstrndup'
 /home/Oxyde/gnome/pulseaudio/src/.libs/libpulsecommon-1.0.so: undefined
 reference to `pa_xfree'
 /home/Oxyde/gnome/pulseaudio/src/.libs/libpulsecommon-1.0.so: undefined
 reference to `pa_path_get_filename'
 /home/Oxyde/gnome/pulseaudio/src/.libs/libpulsecommon-1.0.so: undefined
 reference to `pa_get_binary_name'
 /home/Oxyde/gnome/pulseaudio/src/.libs/libpulsecommon-1.0.so: undefined
 reference to `pa_proplist_set'
 /home/Oxyde/gnome/pulseaudio/src/.libs/libpulsecommon-1.0.so: undefined
 reference to `pa_xmalloc0'
 /home/Oxyde/gnome/pulseaudio/src/.libs/libpulsecommon-1.0.so: undefined
 reference to `pa_utf8_valid'
 /home/Oxyde/gnome/pulseaudio/src/.libs/libpulsecommon-1.0.so: undefined
 reference to `pa_ascii_valid'
 /home/Oxyde/gnome/pulseaudio/src/.libs/libpulsecommon-1.0.so: undefined
 reference to `pa_proplist_get'
 /home/Oxyde/gnome/pulseaudio/src/.libs/libpulsecommon-1.0.so: undefined
 reference to `pa_locale_to_utf8'
 /home/Oxyde/gnome/pulseaudio/src/.libs/libpulsecommon-1.0.so: undefined
 reference to `pa_channel_map_valid'
 /home/Oxyde/gnome/pulseaudio/src/.libs/libpulsecommon-1.0.so: undefined
 reference to `pa_rtclock_now'
 /home/Oxyde/gnome/pulseaudio/src/.libs/libpulsecommon-1.0.so: undefined
 reference to `pa_utf8_filter'
 /home/Oxyde/gnome/pulseaudio/src/.libs/libpulsecommon-1.0.so: undefined
 reference to `pa_proplist_iterate'
 /home/Oxyde/gnome/pulseaudio/src/.libs/libpulsecommon-1.0.so: undefined
 reference to `pa_get_home_dir'
 /home/Oxyde/gnome/pulseaudio/src/.libs/libpulsecommon-1.0.so: undefined
 reference to `pa_xrealloc'
 /home/Oxyde/gnome/pulseaudio/src/.libs/libpulsecommon-1.0.so: undefined
 reference to `pa_proplist_gets'
 /home/Oxyde/gnome/pulseaudio/src/.libs/libpulsecommon-1.0.so: undefined
 reference to `pa_ascii_filter'
 /home/Oxyde/gnome/pulseaudio/src/.libs/libpulsecommon-1.0.so: undefined
 reference to `pa_sample_format_is_le'
 /home/Oxyde/gnome/pulseaudio/src/.libs/libpulsecommon-1.0.so: undefined
 reference to `pa_proplist_new'
 /home/Oxyde/gnome/pulseaudio/src/.libs/libpulsecommon-1.0.so: undefined
 reference to `pa_proplist_update'
 /home/Oxyde/gnome/pulseaudio/src/.libs/libpulsecommon-1.0.so: undefined
 reference to `pa_timeval_sub'
 /home/Oxyde/gnome/pulseaudio/src/.libs/libpulsecommon-1.0.so: undefined
 reference to `pa_gettimeofday'
 collect2: ld returned 1 exit status
 make[3]: *** [mcalign-test] Error 1
 make[3]: Leaving directory `/home/Oxyde/gnome/pulseaudio/src'
 make[2]: *** [all] Error 2
 make[2]: Leaving directory `/home/Oxyde/gnome/pulseaudio/src'
 make[1]: *** [all-recursive] Error 1
 make[1]: Leaving directory `/home/Oxyde/gnome/pulseaudio'
 make: *** [all] Error 2
 }}}

-- 
Ticket URL: <http://pulseaudio.org/ticket/902>
PulseAudio <http://pulseaudio.org/>
The PulseAudio Sound Server


More information about the pulseaudio-bugs mailing list