We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 3400

Summary: Compile with PulseAudio breaks enable-sdl-dlopen option on x86_64
Product: SDL Reporter: Zenitur
Component: loadsoAssignee: Sam Lantinga <slouken>
Status: RESOLVED INVALID QA Contact: Sam Lantinga <slouken>
Severity: minor    
Priority: P2 CC: sezeroz
Version: 1.2.15   
Hardware: x86_64   
OS: Linux   

Description Zenitur 2016-07-27 18:11:52 UTC
Hello! I have a build farms with CentOS 5 and 6 in VirtualBox. I compile some open source with LSB rules.

This is my build of Syobon Action (Neko Mario): https://yadi.sk/d/VU8tPelkZrBd7 CentOS 5, GCC 4.8 from devtoolset repo. Launcher is switching between lib32 and lib64 (I've got them in first Humble Bundle). You can see bundled SDL, SDL_image, SDL_gfx and SDL_mixer.

I've installed these 32-bit libraries from official RPMS. They're depends of GLIBC 2.4. However 64-bit libraries are build on CentOS 6 and they wants GLIBC 2.12. I've rebuild them using SRPM-s.

Also I've rebuild 32-bit libSDL with one more dependency: the official build depends of Arts, Esd, OSS, ALSA, but no PulseAudio.

$ ldd libSDL-1.2.so.0.11.4
        linux-gate.so.1 =>  (0x00b54000)
        libm.so.6 => /lib/libm.so.6 (0x00c05000)
        libdl.so.2 => /lib/libdl.so.2 (0x00f42000)
        libpthread.so.0 => /lib/libpthread.so.0 (0x0036c000)
        libc.so.6 => /lib/libc.so.6 (0x0015a000)
        /lib/ld-linux.so.2 (0x004cb000)
$ strings libSDL-1.2.so.0.11.4 | grep lib
libm.so.6
libdl.so.2
libpthread.so.0
libc.so.6
libSDL-1.2.so.0
libasound.so.2
libartsc.so.0
libesd.so.0
libpulse-simple.so.0  !!! New dependency
libX11.so.6
libXext.so.6
libXrender.so.1
libXrandr.so.2
libGL.so.1
/usr/X11R6/lib/X11/Metro/.version
[zenitur@localhost lib]$

It was perfect built on 32-bit:

...
-- dynamic libasound -> libasound.so.2
checking for artsc-config... /usr/bin/artsc-config
checking for aRts development environment... yes
-- dynamic libartsc -> libartsc.so.0
checking for esd-config... /usr/bin/esd-config
checking for ESD - version >= 0.2.8... yes
-- dynamic libesd -> libesd.so.0
checking for pkg-config... /usr/bin/pkg-config
checking for PulseAudio 0.9 support... yes
-- dynamic libpulse-simple -> libpulse-simple.so.0
checking audio/audiolib.h usability... no
...

But it cannot dynamic link on 64-bit system:

...
-- dynamic libasound -> libasound.so.2
checking for artsc-config... /usr/bin/artsc-config
checking for aRts development environment... yes
-- dynamic libartsc -> libartsc.so.0
checking for esd-config... /usr/bin/esd-config
checking for ESD - version >= 0.2.8... yes
-- dynamic libesd -> libesd.so.0
checking for pkg-config... /usr/bin/pkg-config
checking for PulseAudio 0.9 support... yes
checking audio/audiolib.h usability... no
...

$ ldd libSDL-1.2.so.0.11.4 
        linux-vdso.so.1 =>  (0x00007ffff2990000)
        libm.so.6 => /lib64/libm.so.6 (0x00002b5419bd9000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00002b5419e5c000)
        libpulse-simple.so.0 => /usr/lib64/libpulse-simple.so.0 (0x00002b541a061000)
        libpulse.so.0 => /usr/lib64/libpulse.so.0 (0x00002b541a26e000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00002b541a4bc000)
        libc.so.6 => /lib64/libc.so.6 (0x00002b541a6d9000)
        /lib64/ld-linux-x86-64.so.2 (0x00000031d0e00000)
        libcap.so.1 => /lib64/libcap.so.1 (0x00002b541aa32000)
        librt.so.1 => /lib64/librt.so.1 (0x00002b541ac36000)
        libSM.so.6 => /usr/lib64/libSM.so.6 (0x00002b541ae40000)
        libICE.so.6 => /usr/lib64/libICE.so.6 (0x00002b541b04a000)
        libX11.so.6 => /usr/lib64/libX11.so.6 (0x00002b541b265000)
        libXau.so.6 => /usr/lib64/libXau.so.6 (0x00002b541b572000)
        libXdmcp.so.6 => /usr/lib64/libXdmcp.so.6 (0x00002b541b774000)
Comment 1 Zenitur 2016-07-27 18:42:17 UTC
Hey! I've found a dirty hack!

# cd /usr/lib
# ln -s ../lib64/libpulse.so.0 .
# ln -s libpulse.so.0 libpulse.so
# ln -s ../lib64/libpulse-simple.so.0 .
# ln -s libpulse-simple.so.0 libpulse-simple.so

...
checking for PulseAudio 0.9 support... yes
-- dynamic libpulse-simple -> libpulse-simple.so.0
Comment 2 Sam Lantinga 2017-10-13 05:59:22 UTC
This seems like it's unique to your build environment. Please reopen and attach a patch if you find a good way to handle this.

Thanks!
Comment 3 Zenitur 2017-10-13 09:37:47 UTC
Hello  Sam Lantinga! First of all, I'm sorry for my bad English. This is not my native language.

I'd found the reason of this problem. Do you remember a time before multilib in a Linux distributions? Ubuntu 8.04, openSUSE 11.2? In RPM-based Linux distributions, there was /usr/lib for 32-bit libraries, and /usr/lib64 for 64-bit. In DEB-based Linux distributions, there was /usr/lib32 for 32-bit libraries, and /usr/lib for 64-bit. I know that Icculus used Ubuntu in 2008 (when SDL 1.2 was in active developement), so he may didn't know about this.

Offtopic: it was really comfortably to play UT2004 switching between 32-bit and 64-bit Linux installed in dual boot. "openal.so" and "libSDL-1.2.so.0" in the Binary directory were symlinks to /usr/lib/*. No matter, are you using 32-bit or 64-bit system now - symlink is right. But, based on the above facts, on RPM-based Linux a symlinks are always points on a 32-bit libraries.
Comment 4 Zenitur 2017-10-13 09:53:14 UTC
I haven't patch cause I'm not programmer. Do I need to reopen the bug at this case?
Comment 5 Ozkan Sezer 2018-07-31 10:24:44 UTC
This doesn't beem to be a bug at SDL's end. Closing as invalid.