[libav-devel] [PATCH] configure: remove malloc_aligned.

Måns Rullgård mans at mansr.com
Tue May 1 21:06:42 CEST 2012


Luca Barbato <lu_zero at gentoo.org> writes:

> On 01/05/12 09:43, Ronald S. Bultje wrote:
>> Hi,
>> 
>> On Tue, May 1, 2012 at 9:40 AM, Måns Rullgård <mans at mansr.com> wrote:
>>> "Ronald S. Bultje" <rsbultje at gmail.com> writes:
>>>
>>>> From: "Ronald S. Bultje" <rsbultje at gmail.com>
>>>>
>>>> It was to signal that allocations are 16-byte aligned, but AVX requires
>>>> 32-byte alignment, thus the check is no longer useful (and causes
>>>> crashes).
>>>> ---
>>>>  configure |    7 +------
>>>>  1 file changed, 1 insertion(+), 6 deletions(-)
>>>>
>>>> diff --git a/configure b/configure
>>>> index bc12f33..c8bb63f 100755
>>>> --- a/configure
>>>> +++ b/configure
>>>> @@ -2465,7 +2465,6 @@ case $target_os in
>>>>          oss_outdev_extralibs="-lossaudio"
>>>>          ;;
>>>>      openbsd)
>>>> -        enable malloc_aligned
>>>>          # On OpenBSD 4.5. the compiler does not use PIC unless
>>>>          # explicitly using -fPIC. Libav builds fine without PIC,
>>>>          # however the generated executable will not do anything
>>>> @@ -2478,17 +2477,14 @@ case $target_os in
>>>>          oss_outdev_extralibs="-lossaudio"
>>>>          ;;
>>>>      dragonfly)
>>>> -        enable malloc_aligned
>>>>          disable symver
>>>>          ;;
>>>>      freebsd)
>>>> -        enable malloc_aligned
>>>>          ;;
>>>>      bsd/os)
>>>>          add_extralibs -lpoll -lgnugetopt
>>>>          ;;
>>>>      darwin)
>>>> -        enable malloc_aligned
>>>>          gas="gas-preprocessor.pl $cc"
>>>>          enabled ppc && add_asflags -force_cpusubtype_ALL
>>>>          SHFLAGS='-dynamiclib -Wl,-single_module -Wl,-install_name,$(SHLIBDIR)/$(SLIBNAME_WITH_MAJOR),-current_version,$(LIBVERSION),-compatibility_version,$(LIBMAJOR)'
>>>> @@ -2511,7 +2507,6 @@ case $target_os in
>>>>          fi
>>>>          LIBTARGET=i386
>>>>          if enabled x86_64; then
>>>> -            enable malloc_aligned
>>>>              LIBTARGET="i386:x86-64"
>>>>          elif enabled arm; then
>>>>              LIBTARGET=arm-wince
>>>> @@ -3191,7 +3186,7 @@ check_deps $CONFIG_LIST       \
>>>>
>>>>  enabled asm || { arch=c; disable $ARCH_LIST $ARCH_EXT_LIST; }
>>>>
>>>> -! enabled_any memalign posix_memalign malloc_aligned &&
>>>> +! enabled_any memalign posix_memalign &&
>>>>      enabled_any $need_memalign && enable memalign_hack
>>>>
>>>>  echo "install prefix            $prefix"
>>>> --
>>>
>>> Which of those systems lack both memalign() and posix_memalign()?  Do
>>> any of these support AVX at all?
>> 
>> osx has posix_memalign. Mingw lacks both. Rest don't know.
>
> bsds should have memalign and posix_memalign.
>
> The posix_memalign() function first appeared in FreeBSD 7.0.

What alignment is provided by malloc() on 64-bit mingw, and does anyone
care if the manual alignment gets needlessly enabled there in some case?
Since all the other systems appear to have [posix_]memalign, this should
be fine on those.

-- 
Måns Rullgård
mans at mansr.com


More information about the libav-devel mailing list