ports/131021: audio/openal builds broken library when built with nasm present

Dmitry Marakasov amdmi3 at FreeBSD.org
Mon Jan 26 18:40:07 UTC 2009


>Number:         131021
>Category:       ports
>Synopsis:       audio/openal builds broken library when built with nasm present
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jan 26 18:40:06 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator:     Dmitry Marakasov
>Release:        FreeBSD 8.0-CURRENT i386
>Organization:
>Environment:
System: FreeBSD hades.panopticon 8.0-CURRENT FreeBSD 8.0-CURRENT #0: Sat Jan 24 06:27:03 UTC 2009 amdmi3 at chrysalis.panopticon:/mnt/usr/obj/mnt/usr/src/sys/HADES i386


>Description:
When devel/nasm is installed on the system, openal's configure will detect in and include optimized assembly versions of some functions.
However, for some reason this produces unuseable openal library.

--- excerpt from openal build log ---
...
checking for dlopen in -ldl... no
checking for MMX support... yes
checking for nasm... /usr/local/bin/nasm
checking whether /usr/local/libexec/ccache/cc accepts -fvisibility=hidden... yes
...
gmake[4]: Entering directory `/usr/home/amdmi3/projects/freebsd/ports/audio/openal/work/openal-0.0.8/src/arch/i386'
test -d .libs || mkdir .libs
echo '# Generated by ltmain.sh - GNU libtool 1.5 (1.1220 2003/04/05 19:32:58)' >x86_cpu_caps_detect_prk.lo
echo "pic_object='.libs/x86_cpu_caps_detect_prk.o'" >>x86_cpu_caps_detect_prk.lo
echo "non_pic_object='x86_cpu_caps_detect_prk.o'" >>x86_cpu_caps_detect_prk.lo
/usr/local/bin/nasm -f elf x86_cpu_caps_detect_prk.nasm -o .libs/x86_cpu_caps_detect_prk.o -l x86_cpu_caps_detect_prk.lo.lst
x86_cpu_caps_detect_prk.nasm:65: warning: label alone on a line without a colon might be in error
test -d .libs || mkdir .libs
echo '# Generated by ltmain.sh - GNU libtool 1.5 (1.1220 2003/04/05 19:32:58)' >memcpy_mmx_prk.lo
echo "pic_object='.libs/memcpy_mmx_prk.o'" >>memcpy_mmx_prk.lo
echo "non_pic_object='memcpy_mmx_prk.o'" >>memcpy_mmx_prk.lo
/usr/local/bin/nasm -f elf memcpy_mmx_prk.nasm -o .libs/memcpy_mmx_prk.o -l memcpy_mmx_prk.lo.lst
memcpy_mmx_prk.nasm:62: warning: label alone on a line without a colon might be in error
memcpy_mmx_prk.nasm:84: warning: label alone on a line without a colon might be in error
/bin/sh /usr/local/bin/libtool --mode=link /usr/local/libexec/ccache/cc  -O2 -pipe -march=prescott -fno-strict-aliasing  -L/usr/local/lib -o libx86_asm_routines.la   x86_cpu_caps_detect_prk.lo memcpy_mmx_prk.lo  -lpthread 
ar cru .libs/libx86_asm_routines.a .libs/x86_cpu_caps_detect_prk.o .libs/memcpy_mmx_prk.o
ranlib .libs/libx86_asm_routines.a
creating libx86_asm_routines.la
(cd .libs && rm -f libx86_asm_routines.la && ln -s ../libx86_asm_routines.la libx86_asm_routines.la)
gmake[4]: Leaving directory `/usr/home/amdmi3/projects/freebsd/ports/audio/openal/work/openal-0.0.8/src/arch/i386'
...
---

Now trying to link with the library:

---
% cat test.c 
int main() { return 0; }
% cc test.c -o /dev/null -L/usr/local/lib -lopenal
/usr/local/lib/libopenal.so: undefined reference to `_alMMXmemcpy'
/usr/local/lib/libopenal.so: undefined reference to `_alDetectx86CPUCaps'
/usr/local/lib/libopenal.so: undefined reference to `__alMMXmemcpy'
/usr/local/lib/libopenal.so: undefined reference to `__alDetectx86CPUCaps'
%
---

The problem goes away if I deinstall nasm and recompile openal.

>How-To-Repeat:
- Install nasm
- Rebuild openal
- Try to install, say, audio/freealut
>Fix:
1) Hack configure to not detect nasm at all. For some reason, the test for nasm is completely missing from pointyhat/tinderbox builds, and I couldn't determine cause of that from configure
2) Fix it so correct library is produced. No ideas here as well, link command line produced by libtool seems quite correct for me:

cc -shared ... -Wl,--whole-archive ../src/arch/i386/.libs/libx86_asm_routines.a -Wl,--no-whole-archive ...

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list