From patchwork Tue May 26 09:48:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiaxun Yang X-Patchwork-Id: 19871 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id E0D504495FF for ; Tue, 26 May 2020 12:49:27 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C878E68A4D4; Tue, 26 May 2020 12:49:27 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from sender2-op-o12.zoho.com.cn (sender2-op-o12.zoho.com.cn [163.53.93.243]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 37C55680ADB for ; Tue, 26 May 2020 12:49:18 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; t=1590486541; cv=none; d=zoho.com.cn; s=zohoarc; b=NVWKuXHiynILToReVUHIFwCJ4fa/exKQfEghyKLLYHqRwzmmN2AcifUyWBgOS0hHNzQzB6MdKa1LLHH3JASU2MNvLfn+KjH0O0Q7A9fT+STke3pI7jA2NP/FJSSJxyfiJi0dEvX+DXV7K4g1S4jRDxeulhkZqWCFUYAXRhWgyT0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com.cn; s=zohoarc; t=1590486541; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=776ABoDI53Smb3q6iebMTjxBWz7lUS6GqHbxsewqaNc=; b=i1y4VNsTY2fKq5PASUldo1+3EqMQLTQdyShjxBRCGx5URFkAYCXpb+Pxq7vQDjFkGUYrOombjBr/F+iRkvbaCxLu8A6wJZkDaeerCx/Hog2KiJTqCinqzcS/VZz2NXek3180piyJOmcujOw2quOvtHWdDz6XzqxQmr7ffUBuoDw= ARC-Authentication-Results: i=1; mx.zoho.com.cn; dkim=pass header.i=flygoat.com; spf=pass smtp.mailfrom=jiaxun.yang@flygoat.com; dmarc=pass header.from= header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1590486541; s=mail; d=flygoat.com; i=jiaxun.yang@flygoat.com; h=From:To:Cc:Message-ID:Subject:Date:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Content-Type; bh=776ABoDI53Smb3q6iebMTjxBWz7lUS6GqHbxsewqaNc=; b=epVBAXn3nLw8FHze3fm0N5Ahxt1fmkfMfZH38wYEju/ItodaaykLqeDfiI7qTpWF ipQntY/iycXdgoIMNsNqfxec99fYPpK6ZvnDTuBqUH1gvmQOuALkp7E51bb8eKkqPv7 32wcNmAKbPxK+qNMyQOIFJx45hwCj8sXccwob/ng= Received: from halation.202.net.flygoat.com (60.177.188.90 [60.177.188.90]) by mx.zoho.com.cn with SMTPS id 159048653926717.736906608589834; Tue, 26 May 2020 17:48:59 +0800 (CST) From: Jiaxun Yang To: ffmpeg-devel@ffmpeg.org Message-ID: <20200526094822.72855-2-jiaxun.yang@flygoat.com> Date: Tue, 26 May 2020 17:48:20 +0800 X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200526094822.72855-1-jiaxun.yang@flygoat.com> References: <20200526094822.72855-1-jiaxun.yang@flygoat.com> MIME-Version: 1.0 X-ZohoCNMailClient: External Subject: [FFmpeg-devel] [PATCH 1/3] ffbuild: Refine MIPS handling X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: yinshiyou@loongson.cn, Jiaxun Yang Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" To enable runtime detection for MIPS, we need to refine ffbuild part to support buildding these feature together. Firstly, we fixed configure, let it probe native ability of toolchain to decide wether a feature can to be enabled, also clearly marked the conflictions between loongson2 & loongson3 and Release 6 & rest. Secondly, we compile MMI and MSA C sources with their own flags to ensure their flags won't pollute the whole program and generate illegal code. Signed-off-by: Jiaxun Yang --- configure | 179 +++++++++++++++++++++++---------------- ffbuild/common.mak | 10 ++- libavcodec/mips/Makefile | 3 +- 3 files changed, 117 insertions(+), 75 deletions(-) diff --git a/configure b/configure index f97cad0298..8dc3874642 100755 --- a/configure +++ b/configure @@ -1113,6 +1113,26 @@ void foo(void){ __asm__ volatile($code); } EOF } +check_extra_inline_asm_flags(){ + log check_extra_inline_asm_flags "$@" + name="$1" + extra=$2 + code="$3" + flags='' + shift 3 + while [ "$1" != "" ]; do + append flags $1 + shift + done; + disable $name + cat > $TMPC <