Opened 2 years ago

Last modified 2 years ago

#5164 new defect

clang fails fft compilation for android-arm

Reported by: cehoyos Owned by:
Priority: normal Component: avcodec
Version: git-master Keywords: android osx arm
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

I installed clang for Android as explained in ticket #5158 in a directory android9standalone. If gas-preprocessor is installed, compilation works fine with --disable-fft.
Compilation of all fft-related files fails for the following configure line:

$ ../FFmpeg/configure --cross-prefix=../android9standalone/bin/arm-linux-androideabi- --arch=arm --target-os=android --sysroot=../android9standalone/sysroot --cc=../android9standalone/bin/arm-linux-androideabi-clang --cpu=cortex-a8
$ make V=1 libavcodec/arm/fft_vfp.o
gas-preprocessor.pl -arch arm -as-type clang -- ../android9standalone/bin/arm-linux-androideabi-clang -I. -I/Users/cehoyos/Projects/FFmpeg/ --sysroot=../android9standalone/sysroot -isysroot ../android9standalone/sysroot -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Dstrtod=avpriv_strtod -DPIC -DZLIB_CONST -mcpu=cortex-a8 -fPIC -g -Qunused-arguments -MMD -MF libavcodec/arm/fft_vfp.d -MT libavcodec/arm/fft_vfp.o -c -o libavcodec/arm/fft_vfp.o /Users/cehoyos/Projects/FFmpeg/libavcodec/arm/fft_vfp.S
<stdin>:677:17: error: redefinition of 'gp' does not match original.
        gp .req a1
                ^
<stdin>:852:17: error: redefinition of 'gp' does not match original.
        gp .req a1
                ^
<stdin>:1027:17: error: redefinition of 'gp' does not match original.
        gp .req a1
                ^
<stdin>:1204:17: error: redefinition of 'gp' does not match original.
        gp .req a1
                ^
<stdin>:1385:17: error: redefinition of 'gp' does not match original.
        gp .req a1
                ^
<stdin>:1566:17: error: redefinition of 'gp' does not match original.
        gp .req a1
                ^
<stdin>:1747:17: error: redefinition of 'gp' does not match original.
        gp .req a1
                ^
<stdin>:1928:17: error: redefinition of 'gp' does not match original.
        gp .req a1
                ^
<stdin>:2109:17: error: redefinition of 'gp' does not match original.
        gp .req a1
                ^
<stdin>:2290:17: error: redefinition of 'gp' does not match original.
        gp .req a1
                ^
<stdin>:2471:17: error: redefinition of 'gp' does not match original.
        gp .req a1
                ^
make: *** [libavcodec/arm/fft_vfp.o] Error 1
$ make V=1 libavcodec/arm/fft_neon.o
gas-preprocessor.pl -arch arm -as-type clang -- ../android9standalone/bin/arm-linux-androideabi-clang -I. -I/Users/cehoyos/Projects/FFmpeg/ --sysroot=../android9standalone/sysroot -isysroot ../android9standalone/sysroot -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Dstrtod=avpriv_strtod -DPIC -DZLIB_CONST -mcpu=cortex-a8 -fPIC -g -Qunused-arguments -MMD -MF libavcodec/arm/fft_neon.d -MT libavcodec/arm/fft_neon.o -c -o libavcodec/arm/fft_neon.o /Users/cehoyos/Projects/FFmpeg/libavcodec/arm/fft_neon.S
<stdin>:404:17: error: redefinition of 'gp' does not match original.
        gp .req r12
                ^
<stdin>:439:17: error: redefinition of 'gp' does not match original.
        gp .req r12
                ^
<stdin>:474:17: error: redefinition of 'gp' does not match original.
        gp .req r12
                ^
<stdin>:509:17: error: redefinition of 'gp' does not match original.
        gp .req r12
                ^
<stdin>:544:17: error: redefinition of 'gp' does not match original.
        gp .req r12
                ^
<stdin>:579:17: error: redefinition of 'gp' does not match original.
        gp .req r12
                ^
<stdin>:614:17: error: redefinition of 'gp' does not match original.
        gp .req r12
                ^
<stdin>:649:17: error: redefinition of 'gp' does not match original.
        gp .req r12
                ^
<stdin>:684:17: error: redefinition of 'gp' does not match original.
        gp .req r12
                ^
<stdin>:719:17: error: redefinition of 'gp' does not match original.
        gp .req r12
                ^
<stdin>:754:17: error: redefinition of 'gp' does not match original.
        gp .req r12
                ^
<stdin>:789:17: error: redefinition of 'gp' does not match original.
        gp .req r12
                ^
make: *** [libavcodec/arm/fft_neon.o] Error 1
$ make V=1 libavcodec/arm/fft_fixed_neon.o
gas-preprocessor.pl -arch arm -as-type clang -- ../android9standalone/bin/arm-linux-androideabi-clang -I. -I/Users/cehoyos/Projects/FFmpeg/ --sysroot=../android9standalone/sysroot -isysroot ../android9standalone/sysroot -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Dstrtod=avpriv_strtod -DPIC -DZLIB_CONST -mcpu=cortex-a8 -fPIC -g -Qunused-arguments -MMD -MF libavcodec/arm/fft_fixed_neon.d -MT libavcodec/arm/fft_fixed_neon.o -c -o libavcodec/arm/fft_fixed_neon.o /Users/cehoyos/Projects/FFmpeg/libavcodec/arm/fft_fixed_neon.S
<stdin>:448:17: error: redefinition of 'gp' does not match original.
        gp .req r12
                ^
<stdin>:482:17: error: redefinition of 'gp' does not match original.
        gp .req r12
                ^
<stdin>:516:17: error: redefinition of 'gp' does not match original.
        gp .req r12
                ^
<stdin>:550:17: error: redefinition of 'gp' does not match original.
        gp .req r12
                ^
<stdin>:584:17: error: redefinition of 'gp' does not match original.
        gp .req r12
                ^
<stdin>:618:17: error: redefinition of 'gp' does not match original.
        gp .req r12
                ^
<stdin>:652:17: error: redefinition of 'gp' does not match original.
        gp .req r12
                ^
<stdin>:686:17: error: redefinition of 'gp' does not match original.
        gp .req r12
                ^
<stdin>:720:17: error: redefinition of 'gp' does not match original.
        gp .req r12
                ^
<stdin>:754:17: error: redefinition of 'gp' does not match original.
        gp .req r12
                ^
<stdin>:788:17: error: redefinition of 'gp' does not match original.
        gp .req r12
                ^
make: *** [libavcodec/arm/fft_fixed_neon.o] Error 1
$ make V=1 libavcodec/arm/sbrdsp_neon.o
gas-preprocessor.pl -arch arm -as-type clang -- ../android9standalone/bin/arm-linux-androideabi-clang -I. -I/Users/cehoyos/Projects/FFmpeg/ --sysroot=../android9standalone/sysroot -isysroot ../android9standalone/sysroot -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Dstrtod=avpriv_strtod -DPIC -DZLIB_CONST -mcpu=cortex-a8 -fPIC -g -Qunused-arguments -MMD -MF libavcodec/arm/sbrdsp_neon.d -MT libavcodec/arm/sbrdsp_neon.o -c -o libavcodec/arm/sbrdsp_neon.o /Users/cehoyos/Projects/FFmpeg/libavcodec/arm/sbrdsp_neon.S
<stdin>:515:17: error: redefinition of 'gp' does not match original.
        gp .req r12
                ^
make: *** [libavcodec/arm/sbrdsp_neon.o] Error 1

The errors are related to the macro movrelx in libavutil/arm/asm.S
Workaround is to specify a compatible assembler:

$ ../FFmpeg/configure --cross-prefix=../android9standalone/bin/arm-linux-androideabi- --arch=arm --target-os=android --sysroot=../android9standalone/sysroot --cc=../android9standalone/bin/arm-linux-androideabi-clang --cpu=cortex-a8 --as=../android9standalone/bin/arm-linux-androideabi-gcc

Change History (1)

comment:1 Changed 2 years ago by cehoyos

  • Summary changed from clang fails compilation of pfft for android-arm to clang fails fft compilation for android-arm
Note: See TracTickets for help on using tickets.