hansdegoede
05-30-2010, 11:08 AM
Hi All,
I'm the packager of ClanLib for the Fedora Linux distribution. I recently received a bug report that a ClanLib using application would not compile on ppc. I've tracked this down to ClanSound not being compiled there as it only compiles on machines with SSE2 (iow only on Intel platforms).
I've created a patch which allows the usage of ClanSound on non SSE2 platforms, and also fixes a bug in the remainder copy function for unpacking 8 bit mono samples:
http://people.fedoraproject.org/~jwrdegoede/ClanLib-2.1.1-no-sse2.patch
Some further Notes:
1) It would be good to do the same for ClanGDI, I took a look and there are 3 clanGDI files using SSE2 "asm". one of them also hs plain C equivalents already implemented in the file, the other uses a remainder function, so can be fixed like clanSound was fixed, but the 3th needs someone who knows the code better to reimplement that one last bit in C code (under a #ifdef).
2) The "asm" for the (unused) mix_many_to_one function seems wrong, it multiplies the accumulated output with the channel volume, and then adds the channel sample, rather then adding the channel sample multiplied by the channel volume to the accumulated channel output.
3) While working on upgrading the Fedora packages to ClanLib-2.1.1 I also encountered a problem with the new dlopen of libGL code. It op[ens libGL.so but:
3a) There is no guarantee there is a libGL.so, as that is a symlink meant to determine which libGL to link to when compiling apps. So this is packaged in libGL-devel, which is not installed on normal end user installations
3b) Even when it is installed, dlopen-ing libGL.so could result in not doing what you want for example in Fedora the libGL which comes with the binary nvidia drivers gets installed under /usr/lib/nvidia, and depending on which X driver is in use, /usr/lib/nvidia gets pre-pended to the library search path or not. But /usr/lib/nvidia does not contain a libGL.so symlink, so even if it is pre-pended to the path the wrong libGL will get used, resulting in glxChooseVisualInfo always failing.
The fix for both these issues is to dlopen libGL.so.1, which is the official soname for libGL. I've a patch doing that here:
http://people.fedoraproject.org/~jwrdegoede/ClanLib-2.1.1-libGL-soname.patch
I'm the packager of ClanLib for the Fedora Linux distribution. I recently received a bug report that a ClanLib using application would not compile on ppc. I've tracked this down to ClanSound not being compiled there as it only compiles on machines with SSE2 (iow only on Intel platforms).
I've created a patch which allows the usage of ClanSound on non SSE2 platforms, and also fixes a bug in the remainder copy function for unpacking 8 bit mono samples:
http://people.fedoraproject.org/~jwrdegoede/ClanLib-2.1.1-no-sse2.patch
Some further Notes:
1) It would be good to do the same for ClanGDI, I took a look and there are 3 clanGDI files using SSE2 "asm". one of them also hs plain C equivalents already implemented in the file, the other uses a remainder function, so can be fixed like clanSound was fixed, but the 3th needs someone who knows the code better to reimplement that one last bit in C code (under a #ifdef).
2) The "asm" for the (unused) mix_many_to_one function seems wrong, it multiplies the accumulated output with the channel volume, and then adds the channel sample, rather then adding the channel sample multiplied by the channel volume to the accumulated channel output.
3) While working on upgrading the Fedora packages to ClanLib-2.1.1 I also encountered a problem with the new dlopen of libGL code. It op[ens libGL.so but:
3a) There is no guarantee there is a libGL.so, as that is a symlink meant to determine which libGL to link to when compiling apps. So this is packaged in libGL-devel, which is not installed on normal end user installations
3b) Even when it is installed, dlopen-ing libGL.so could result in not doing what you want for example in Fedora the libGL which comes with the binary nvidia drivers gets installed under /usr/lib/nvidia, and depending on which X driver is in use, /usr/lib/nvidia gets pre-pended to the library search path or not. But /usr/lib/nvidia does not contain a libGL.so symlink, so even if it is pre-pended to the path the wrong libGL will get used, resulting in glxChooseVisualInfo always failing.
The fix for both these issues is to dlopen libGL.so.1, which is the official soname for libGL. I've a patch doing that here:
http://people.fedoraproject.org/~jwrdegoede/ClanLib-2.1.1-libGL-soname.patch