Problems compiling libmad-0.15.1b on ARM CortexA9

Drasko DRASKOVIC <[email protected]> Thu, 11 Jul 2013 17:44:06 +0200
Newsgroups gmane.comp.audio.mad.devel
Message-ID <CAEk6gTBGhZgRJct26QCzPboTRK5Nd3RPvAX_LjU43uMOsEvp6w@mail.gmail.com>
HI all,
I am trying to compile libmad-0.15.1b on Wandboard with Freescale's
i.MX6 Solo processor (ARM Cortex-A9) running Ubuntu Precise LTS.

First I had to comment out "-fforce-mem" from configure, as suggested here :
http://mpd.wikia.com/wiki/TomTom

Then I have error of this kind :
/tmp/cczQx5fc.s: Assembler messages:
/tmp/cczQx5fc.s:2653: Error: selected processor does not support Thumb
mode `rsc r2,r2,#0'
/tmp/cczQx5fc.s:2920: Error: selected processor does not support Thumb
mode `rsc sl,sl,#0'
/tmp/cczQx5fc.s:3623: Error: selected processor does not support Thumb
mode `rsc r2,r2,#0'
/tmp/cczQx5fc.s:3838: Error: selected processor does not support Thumb
mode `rsc r7,r7,#0'
make[2]: *** [synth.lo] Error 1
make[2]: Leaving directory `/root/libmad/libmad-0.15.1b'
make[1]: *** [all-recursive] Error 1

Here is a build log :
root@marx:~/libmad/libmad-0.15.1b# make
(sed -e '1s|.*|/*|' -e '1b' -e '$s|.*| */|' -e '$b'  \
                -e 's/^.*/ *&/' ./COPYRIGHT; echo;  \
        echo "# ifdef __cplusplus";  \
        echo 'extern "C" {';  \
        echo "# endif"; echo;  \
        if [ ".-DFPM_ARM" != "." ]; then  \
                echo ".-DFPM_ARM" | sed -e 's|^\.-D|# define |'; echo;  \
        fi;  \
        sed -ne 's/^# *define  *\(HAVE_.*_ASM\).*/# define \1/p'  \
                config.h; echo;  \
        sed -ne 's/^# *define  *OPT_\(SPEED\|ACCURACY\).*/# define OPT_\1/p'  \
                config.h; echo;  \
        sed -ne 's/^# *define  *\(SIZEOF_.*\)/# define \1/p'  \
                config.h; echo;  \
        for header in version.h fixed.h bit.h timer.h stream.h frame.h
synth.h decoder.h; do  \
                echo;  \
                sed -n -f ./mad.h.sed ./$header;  \
        done; echo;  \
        echo "# ifdef __cplusplus";  \
        echo '}';  \
        echo "# endif") >mad.h
make  all-recursive
make[1]: Entering directory `/root/libmad/libmad-0.15.1b'
make[2]: Entering directory `/root/libmad/libmad-0.15.1b'
if /bin/bash ./libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.
-DFPM_ARM -DASO_INTERLEAVE1 -DASO_IMDCT    -Wall -g -O -fforce-addr
-fthread-jumps -fcse-follow-jumps -fcse-skip-blocks
-fexpensive-optimizations -fregmove -fschedule-insns2
-fstrength-reduce -MT version.lo -MD -MP -MF ".deps/version.Tpo" -c -o
version.lo version.c; \
        then mv -f ".deps/version.Tpo" ".deps/version.Plo"; else rm -f
".deps/version.Tpo"; exit 1; fi
mkdir .libs
 gcc -DHAVE_CONFIG_H -I. -I. -I. -DFPM_ARM -DASO_INTERLEAVE1
-DASO_IMDCT -Wall -g -O -fforce-addr -fthread-jumps -fcse-follow-jumps
-fcse-skip-blocks -fexpensive-optimizations -fregmove
-fschedule-insns2 -fstrength-reduce -MT version.lo -MD -MP -MF
.deps/version.Tpo -c version.c  -fPIC -DPIC -o .libs/version.o
 gcc -DHAVE_CONFIG_H -I. -I. -I. -DFPM_ARM -DASO_INTERLEAVE1
-DASO_IMDCT -Wall -g -O -fforce-addr -fthread-jumps -fcse-follow-jumps
-fcse-skip-blocks -fexpensive-optimizations -fregmove
-fschedule-insns2 -fstrength-reduce -MT version.lo -MD -MP -MF
.deps/version.Tpo -c version.c -o version.o >/dev/null 2>&1
if /bin/bash ./libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.
-DFPM_ARM -DASO_INTERLEAVE1 -DASO_IMDCT    -Wall -g -O -fforce-addr
-fthread-jumps -fcse-follow-jumps -fcse-skip-blocks
-fexpensive-optimizations -fregmove -fschedule-insns2
-fstrength-reduce -MT fixed.lo -MD -MP -MF ".deps/fixed.Tpo" -c -o
fixed.lo fixed.c; \
        then mv -f ".deps/fixed.Tpo" ".deps/fixed.Plo"; else rm -f
".deps/fixed.Tpo"; exit 1; fi
 gcc -DHAVE_CONFIG_H -I. -I. -I. -DFPM_ARM -DASO_INTERLEAVE1
-DASO_IMDCT -Wall -g -O -fforce-addr -fthread-jumps -fcse-follow-jumps
-fcse-skip-blocks -fexpensive-optimizations -fregmove
-fschedule-insns2 -fstrength-reduce -MT fixed.lo -MD -MP -MF
.deps/fixed.Tpo -c fixed.c  -fPIC -DPIC -o .libs/fixed.o
 gcc -DHAVE_CONFIG_H -I. -I. -I. -DFPM_ARM -DASO_INTERLEAVE1
-DASO_IMDCT -Wall -g -O -fforce-addr -fthread-jumps -fcse-follow-jumps
-fcse-skip-blocks -fexpensive-optimizations -fregmove
-fschedule-insns2 -fstrength-reduce -MT fixed.lo -MD -MP -MF
.deps/fixed.Tpo -c fixed.c -o fixed.o >/dev/null 2>&1
if /bin/bash ./libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.
-DFPM_ARM -DASO_INTERLEAVE1 -DASO_IMDCT    -Wall -g -O -fforce-addr
-fthread-jumps -fcse-follow-jumps -fcse-skip-blocks
-fexpensive-optimizations -fregmove -fschedule-insns2
-fstrength-reduce -MT bit.lo -MD -MP -MF ".deps/bit.Tpo" -c -o bit.lo
bit.c; \
        then mv -f ".deps/bit.Tpo" ".deps/bit.Plo"; else rm -f
".deps/bit.Tpo"; exit 1; fi
 gcc -DHAVE_CONFIG_H -I. -I. -I. -DFPM_ARM -DASO_INTERLEAVE1
-DASO_IMDCT -Wall -g -O -fforce-addr -fthread-jumps -fcse-follow-jumps
-fcse-skip-blocks -fexpensive-optimizations -fregmove
-fschedule-insns2 -fstrength-reduce -MT bit.lo -MD -MP -MF
.deps/bit.Tpo -c bit.c  -fPIC -DPIC -o .libs/bit.o
 gcc -DHAVE_CONFIG_H -I. -I. -I. -DFPM_ARM -DASO_INTERLEAVE1
-DASO_IMDCT -Wall -g -O -fforce-addr -fthread-jumps -fcse-follow-jumps
-fcse-skip-blocks -fexpensive-optimizations -fregmove
-fschedule-insns2 -fstrength-reduce -MT bit.lo -MD -MP -MF
.deps/bit.Tpo -c bit.c -o bit.o >/dev/null 2>&1
if /bin/bash ./libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.
-DFPM_ARM -DASO_INTERLEAVE1 -DASO_IMDCT    -Wall -g -O -fforce-addr
-fthread-jumps -fcse-follow-jumps -fcse-skip-blocks
-fexpensive-optimizations -fregmove -fschedule-insns2
-fstrength-reduce -MT timer.lo -MD -MP -MF ".deps/timer.Tpo" -c -o
timer.lo timer.c; \
        then mv -f ".deps/timer.Tpo" ".deps/timer.Plo"; else rm -f
".deps/timer.Tpo"; exit 1; fi
 gcc -DHAVE_CONFIG_H -I. -I. -I. -DFPM_ARM -DASO_INTERLEAVE1
-DASO_IMDCT -Wall -g -O -fforce-addr -fthread-jumps -fcse-follow-jumps
-fcse-skip-blocks -fexpensive-optimizations -fregmove
-fschedule-insns2 -fstrength-reduce -MT timer.lo -MD -MP -MF
.deps/timer.Tpo -c timer.c  -fPIC -DPIC -o .libs/timer.o
 gcc -DHAVE_CONFIG_H -I. -I. -I. -DFPM_ARM -DASO_INTERLEAVE1
-DASO_IMDCT -Wall -g -O -fforce-addr -fthread-jumps -fcse-follow-jumps
-fcse-skip-blocks -fexpensive-optimizations -fregmove
-fschedule-insns2 -fstrength-reduce -MT timer.lo -MD -MP -MF
.deps/timer.Tpo -c timer.c -o timer.o >/dev/null 2>&1
if /bin/bash ./libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.
-DFPM_ARM -DASO_INTERLEAVE1 -DASO_IMDCT    -Wall -g -O -fforce-addr
-fthread-jumps -fcse-follow-jumps -fcse-skip-blocks
-fexpensive-optimizations -fregmove -fschedule-insns2
-fstrength-reduce -MT stream.lo -MD -MP -MF ".deps/stream.Tpo" -c -o
stream.lo stream.c; \
        then mv -f ".deps/stream.Tpo" ".deps/stream.Plo"; else rm -f
".deps/stream.Tpo"; exit 1; fi
 gcc -DHAVE_CONFIG_H -I. -I. -I. -DFPM_ARM -DASO_INTERLEAVE1
-DASO_IMDCT -Wall -g -O -fforce-addr -fthread-jumps -fcse-follow-jumps
-fcse-skip-blocks -fexpensive-optimizations -fregmove
-fschedule-insns2 -fstrength-reduce -MT stream.lo -MD -MP -MF
.deps/stream.Tpo -c stream.c  -fPIC -DPIC -o .libs/stream.o
 gcc -DHAVE_CONFIG_H -I. -I. -I. -DFPM_ARM -DASO_INTERLEAVE1
-DASO_IMDCT -Wall -g -O -fforce-addr -fthread-jumps -fcse-follow-jumps
-fcse-skip-blocks -fexpensive-optimizations -fregmove
-fschedule-insns2 -fstrength-reduce -MT stream.lo -MD -MP -MF
.deps/stream.Tpo -c stream.c -o stream.o >/dev/null 2>&1
if /bin/bash ./libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.
-DFPM_ARM -DASO_INTERLEAVE1 -DASO_IMDCT    -Wall -g -O -fforce-addr
-fthread-jumps -fcse-follow-jumps -fcse-skip-blocks
-fexpensive-optimizations -fregmove -fschedule-insns2
-fstrength-reduce -MT frame.lo -MD -MP -MF ".deps/frame.Tpo" -c -o
frame.lo frame.c; \
        then mv -f ".deps/frame.Tpo" ".deps/frame.Plo"; else rm -f
".deps/frame.Tpo"; exit 1; fi
 gcc -DHAVE_CONFIG_H -I. -I. -I. -DFPM_ARM -DASO_INTERLEAVE1
-DASO_IMDCT -Wall -g -O -fforce-addr -fthread-jumps -fcse-follow-jumps
-fcse-skip-blocks -fexpensive-optimizations -fregmove
-fschedule-insns2 -fstrength-reduce -MT frame.lo -MD -MP -MF
.deps/frame.Tpo -c frame.c  -fPIC -DPIC -o .libs/frame.o
 gcc -DHAVE_CONFIG_H -I. -I. -I. -DFPM_ARM -DASO_INTERLEAVE1
-DASO_IMDCT -Wall -g -O -fforce-addr -fthread-jumps -fcse-follow-jumps
-fcse-skip-blocks -fexpensive-optimizations -fregmove
-fschedule-insns2 -fstrength-reduce -MT frame.lo -MD -MP -MF
.deps/frame.Tpo -c frame.c -o frame.o >/dev/null 2>&1
if /bin/bash ./libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.
-DFPM_ARM -DASO_INTERLEAVE1 -DASO_IMDCT    -Wall -g -O -fforce-addr
-fthread-jumps -fcse-follow-jumps -fcse-skip-blocks
-fexpensive-optimizations -fregmove -fschedule-insns2
-fstrength-reduce -MT synth.lo -MD -MP -MF ".deps/synth.Tpo" -c -o
synth.lo synth.c; \
        then mv -f ".deps/synth.Tpo" ".deps/synth.Plo"; else rm -f
".deps/synth.Tpo"; exit 1; fi
 gcc -DHAVE_CONFIG_H -I. -I. -I. -DFPM_ARM -DASO_INTERLEAVE1
-DASO_IMDCT -Wall -g -O -fforce-addr -fthread-jumps -fcse-follow-jumps
-fcse-skip-blocks -fexpensive-optimizations -fregmove
-fschedule-insns2 -fstrength-reduce -MT synth.lo -MD -MP -MF
.deps/synth.Tpo -c synth.c  -fPIC -DPIC -o .libs/synth.o
/tmp/cczQx5fc.s: Assembler messages:
/tmp/cczQx5fc.s:2653: Error: selected processor does not support Thumb
mode `rsc r2,r2,#0'
/tmp/cczQx5fc.s:2920: Error: selected processor does not support Thumb
mode `rsc sl,sl,#0'
/tmp/cczQx5fc.s:3623: Error: selected processor does not support Thumb
mode `rsc r2,r2,#0'
/tmp/cczQx5fc.s:3838: Error: selected processor does not support Thumb
mode `rsc r7,r7,#0'
make[2]: *** [synth.lo] Error 1
make[2]: Leaving directory `/root/libmad/libmad-0.15.1b'
make[1]: *** [all-recursive] Error 1


Here is my system :
root@marx:~/libmad/libmad-0.15.1b# uname -a
Linux marx 3.0.35 #3 SMP PREEMPT Fri Jul 5 17:13:24 CEST 2013 armv7l
armv7l armv7l GNU/Linux

And compiler :

root@marx:~/libmad/libmad-0.15.1b# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/arm-linux-gnueabihf/4.6/lto-wrapper
Target: arm-linux-gnueabihf
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro
4.6.3-1ubuntu5'
--with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs
--enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr
--program-suffix=-4.6 --enable-shared --enable-linker-build-id
--with-system-zlib --libexecdir=/usr/lib --without-included-gettext
--enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6
--libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu
--enable-libstdcxx-debug --enable-libstdcxx-time=yes
--enable-gnu-unique-object --enable-plugin --enable-objc-gc
--enable-multilib --disable-sjlj-exceptions --with-arch=armv7-a
--with-float=hard --with-fpu=vfpv3-d16 --with-mode=thumb
--disable-werror --enable-checking=release --build=arm-linux-gnueabihf
--host=arm-linux-gnueabihf --target=arm-linux-gnueabihf
Thread model: posix
gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)


Does anybody have an idea where I can look for debugging this issue?

Best regards,
Drasko