Require aligned memory for everything that needs it

Altivec, NEON, and SSE require more alignment than standard malloc()
guarantees, whereas MMX does not.  Update checks to reflect this.

Originally committed as revision 19438 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Måns Rullgård 2009-07-15 18:33:12 +00:00
parent bd20afc401
commit 89e053f83d

15
configure vendored
View File

@ -1040,6 +1040,8 @@ sse_deps="mmx"
ssse3_deps="sse" ssse3_deps="sse"
vis_deps="sparc" vis_deps="sparc"
need_memalign="altivec neon sse"
# decoders / encoders / hardware accelerators # decoders / encoders / hardware accelerators
aac_decoder_select="fft mdct" aac_decoder_select="fft mdct"
ac3_decoder_select="fft mdct" ac3_decoder_select="fft mdct"
@ -1668,21 +1670,21 @@ case $target_os in
oss_outdev_extralibs="-lossaudio" oss_outdev_extralibs="-lossaudio"
;; ;;
openbsd) openbsd)
disable need_memalign enable malloc_aligned
LIBOBJFLAGS='$(PIC)' LIBOBJFLAGS='$(PIC)'
SHFLAGS='-shared' SHFLAGS='-shared'
oss_indev_extralibs="-lossaudio" oss_indev_extralibs="-lossaudio"
oss_outdev_extralibs="-lossaudio" oss_outdev_extralibs="-lossaudio"
;; ;;
freebsd|dragonfly) freebsd|dragonfly)
disable need_memalign enable malloc_aligned
;; ;;
bsd/os) bsd/os)
osextralibs="-lpoll -lgnugetopt" osextralibs="-lpoll -lgnugetopt"
strip="strip -d" strip="strip -d"
;; ;;
darwin) darwin)
disable need_memalign enable malloc_aligned
SHFLAGS='-dynamiclib -Wl,-single_module -Wl,-install_name,$(SHLIBDIR)/$(SLIBNAME),-current_version,$(LIBVERSION),-compatibility_version,$(LIBMAJOR) -Wl,-read_only_relocs,suppress' SHFLAGS='-dynamiclib -Wl,-single_module -Wl,-install_name,$(SHLIBDIR)/$(SLIBNAME),-current_version,$(LIBVERSION),-compatibility_version,$(LIBMAJOR) -Wl,-read_only_relocs,suppress'
strip="strip -x" strip="strip -x"
FFLDFLAGS="-Wl,-dynamic,-search_paths_first" FFLDFLAGS="-Wl,-dynamic,-search_paths_first"
@ -1697,7 +1699,7 @@ case $target_os in
target_os=mingw32 target_os=mingw32
LIBTARGET=i386 LIBTARGET=i386
if enabled x86_64; then if enabled x86_64; then
disable need_memalign enable malloc_aligned
LIBTARGET=x64 LIBTARGET=x64
elif enabled arm; then elif enabled arm; then
LIBTARGET=arm LIBTARGET=arm
@ -1840,8 +1842,6 @@ enabled version3 && { enabled gpl && enable gplv3 || enable lgplv3; }
check_deps $ARCH_EXT_LIST check_deps $ARCH_EXT_LIST
test -z "$need_memalign" && need_memalign="$mmx"
#Darwin CC versions #Darwin CC versions
if test $target_os = darwin; then if test $target_os = darwin; then
if enabled xlc; then if enabled xlc; then
@ -2091,7 +2091,8 @@ check_header vdpau/vdpau.h
check_header vdpau/vdpau_x11.h check_header vdpau/vdpau_x11.h
check_header X11/extensions/XvMClib.h check_header X11/extensions/XvMClib.h
if enabled sse && { ! enabled_any memalign memalign_hack posix_memalign && enabled need_memalign ;} ; then if ! enabled_any memalign memalign_hack posix_memalign malloc_aligned &&
enabled_any $need_memalign ; then
die "Error, no aligned memory allocator but SSE enabled, disable it or use --enable-memalign-hack." die "Error, no aligned memory allocator but SSE enabled, disable it or use --enable-memalign-hack."
fi fi