0002-fix-mips-build.patch 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. From 9d5981eecde2133b9d6099eb99f96b1c29c3e520 Mon Sep 17 00:00:00 2001
  2. From: Bernd Kuhls <bernd.kuhls@t-online.de>
  3. Date: Mon, 13 Apr 2020 12:03:01 +0200
  4. Subject: [PATCH] fix mips build
  5. In total three PR were sent upstream to fix mips builds:
  6. https://github.com/cisco/openh264/pull/3185
  7. https://github.com/cisco/openh264/pull/3217
  8. https://github.com/cisco/openh264/pull/3225
  9. Buildroot used the first version
  10. https://git.buildroot.net/buildroot/commit/package/libopenh264?id=e8d0df569e1844f7ba28918a53ee38027b325b8f
  11. downloaded from https://github.com/cisco/openh264/pull/3185
  12. During discussion the gcc option '-march=loongson3a' was changed to
  13. '-Wa,-mloongson-mmi,-mloongson-ext':
  14. https://github.com/cisco/openh264/pull/3185#discussion_r337818960
  15. This causes build errors with gcc version 8.3.0 (Buildroot 2020.02)
  16. tmp/cctgEQaw.s:662: Error: opcode not supported on this processor: loongson3a (mips64r2) `bc .L22'
  17. /tmp/cctgEQaw.s:1679: Error: opcode not supported on this processor: loongson3a (mips64r2) `bc .L27'
  18. /tmp/cctgEQaw.s:2218: Error: opcode not supported on this processor: loongson3a (mips64r2) `jrc $31'
  19. This patch partly reverts the change to fix mips build.
  20. $ /home/bernd/buildroot/br5/output/host/bin/mips64el-linux-gcc -v
  21. Using built-in specs.
  22. COLLECT_GCC=/home/bernd/buildroot/br5/output/host/opt/ext-toolchain/bin/mips64el-linux-gcc.br_real
  23. COLLECT_LTO_WRAPPER=/home/bernd/buildroot/br5/output/host/opt/ext-toolchain/bin/../libexec/gcc/mips64el-buildroot-linux-gnu/8.3.0/lto-wrapper
  24. Target: mips64el-buildroot-linux-gnu
  25. Configured with: ./configure --prefix=/opt/br-mips64r6-n64-el-hf-2020.02 --sysconfdir=/opt/br-mips64r6-n64-el-hf-2020.02/etc --enable-static --target=mips64el-buildroot-linux-gnu --with-sysroot=/opt/br-mips64r6-n64-el-hf-2020.02/mips64el-buildroot-linux-gnu/sysroot --enable-__cxa_atexit --with-gnu-ld --disable-libssp --disable-multilib --disable-decimal-float --with-gmp=/opt/br-mips64r6-n64-el-hf-2020.02 --with-mpc=/opt/br-mips64r6-n64-el-hf-2020.02 --with-mpfr=/opt/br-mips64r6-n64-el-hf-2020.02 --with-pkgversion='Buildroot 2020.02' --with-bugurl=http://bugs.buildroot.net/ --disable-libquadmath --enable-tls --enable-threads --without-isl --without-cloog --with-arch=mips64r6 --with-abi=64 --with-nan=2008 --enable-languages=c,c++ --with-build-time-tools=/opt/br-mips64r6-n64-el-hf-2020.02/mips64el-buildroot-linux-gnu/bin --enable-shared --disable-libgomp
  26. Thread model: posix
  27. gcc version 8.3.0 (Buildroot 2020.02)
  28. Patch sent upstream: https://github.com/cisco/openh264/pull/3267
  29. Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
  30. ---
  31. build/arch.mk | 2 +-
  32. build/mips-simd-check.sh | 2 +-
  33. 2 files changed, 2 insertions(+), 2 deletions(-)
  34. diff --git a/build/arch.mk b/build/arch.mk
  35. index 1bf318ab..c6570ed4 100644
  36. --- a/build/arch.mk
  37. +++ b/build/arch.mk
  38. @@ -41,7 +41,7 @@ ASMFLAGS += -I$(SRC_PATH)codec/common/mips/
  39. ifeq ($(ENABLE_MMI), Yes)
  40. ENABLE_MMI = $(shell $(SRC_PATH)build/mips-simd-check.sh $(CC) mmi)
  41. ifeq ($(ENABLE_MMI), Yes)
  42. -CFLAGS += -DHAVE_MMI -Wa,-mloongson-mmi,-mloongson-ext
  43. +CFLAGS += -DHAVE_MMI -march=loongson3a
  44. endif
  45. endif
  46. #msa
  47. diff --git a/build/mips-simd-check.sh b/build/mips-simd-check.sh
  48. index 5efffbef..d0d72f9e 100755
  49. --- a/build/mips-simd-check.sh
  50. +++ b/build/mips-simd-check.sh
  51. @@ -15,7 +15,7 @@ TMPO=$(mktemp tmp.XXXXXX.o)
  52. if [ $2 == "mmi" ]
  53. then
  54. echo "void main(void){ __asm__ volatile(\"punpcklhw \$f0, \$f0, \$f0\"); }" > $TMPC
  55. - $1 -Wa,-mloongson-mmi $TMPC -o $TMPO &> /dev/null
  56. + $1 -march=loongson3a $TMPC -o $TMPO &> /dev/null
  57. if test -s $TMPO
  58. then
  59. echo "Yes"
  60. --
  61. 2.25.0