[FFmpeg-devel] [PATCH 1/3] configure: Add support for loongarch.

Shiyou Yin yinshiyou at loongson.cn
Tue Nov 9 09:09:08 EET 2021


For la464 cpu: ./configure --cpu=la464
With cross-compiler:
./configure --cross-prefix=loongarch64-linux-gnu- \
--enable-cross-compile --arch=loongarch64 \
--target-os=linux --cpu=la464
---
 Changelog |  1 +
 configure | 17 +++++++++++++++++
 2 files changed, 18 insertions(+)

diff --git a/Changelog b/Changelog
index 765ec82915..60b74a3873 100644
--- a/Changelog
+++ b/Changelog
@@ -30,6 +30,7 @@ version <next>:
 - xcorrelate video filter
 - varblur video filter
 - huesaturation video filter
+- support loongarch.
 
 
 version 4.4:
diff --git a/configure b/configure
index c01aa480c7..b4be706b65 100755
--- a/configure
+++ b/configure
@@ -2020,6 +2020,9 @@ ARCH_LIST="
     avr32_uc
     bfin
     ia64
+    loongarch
+    loongarch32
+    loongarch64
     m68k
     mips
     mips64
@@ -4932,6 +4935,9 @@ case "$arch" in
     arm*|iPad*|iPhone*)
         arch="arm"
     ;;
+    loongarch*)
+        arch="loongarch"
+    ;;
     mips*|IP*)
         case "$arch" in
         *el)
@@ -5079,6 +5085,12 @@ elif enabled bfin; then
 
     cpuflags="-mcpu=$cpu"
 
+elif enabled loongarch; then
+    case $cpu in
+        la464)
+            cpuflags="-march=$cpu"
+        ;;
+    esac
 elif enabled mips; then
 
     if [ "$cpu" != "generic" ]; then
@@ -5335,6 +5347,11 @@ case "$arch" in
     aarch64|alpha|ia64)
         enabled shared && enable_weak pic
     ;;
+    loongarch)
+        check_64bit loongarch32 loongarch64
+        enabled loongarch64 && disable loongarch32
+        enabled shared && enable_weak pic
+    ;;
     mips)
         check_64bit mips mips64 '_MIPS_SIM > 1'
         enabled shared && enable_weak pic
-- 
2.20.1



More information about the ffmpeg-devel mailing list