From patchwork Tue Jun 2 14:15:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiaxun Yang X-Patchwork-Id: 20070 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 443B644A526 for ; Tue, 2 Jun 2020 17:16:45 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2D8EF68AA33; Tue, 2 Jun 2020 17:16:45 +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 D9D31680180 for ; Tue, 2 Jun 2020 17:16:37 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; t=1591107388; cv=none; d=zoho.com.cn; s=zohoarc; b=aTCNjIcitvvfvz7TLihTKs7eimtsJEM0O+6HLFU647H9/Eqxp/XHH8gijSOyq2xyeeK5NbE1+9s9xwZ2/O+bn/zwqHMFCKT72bYXeogLrn5jUtcNWl4+51bwfdTAX4YWAsd4Xr8DbfEUOiGUqJfiLI4JDFpW+RdJVHqE0cI1+e8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com.cn; s=zohoarc; t=1591107388; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=776ABoDI53Smb3q6iebMTjxBWz7lUS6GqHbxsewqaNc=; b=Ki6VMaV7aIzLVAlZWs5+jFJR6IyRoagNEZ3H+jOGDajk8KLa9rDrHf3mSGI1crc2M1Oagp6kqVToiy88Eeuc1Rd9islfeMmM4DwfUpNnYScltUlSt5Giy40SNZVUXDlPDM8AVl0LAMUZb1gwPEbsbb31vfEUb/QOw0uzlx8t+vw= 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=1591107388; 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=JO3iV2NeLOpX8w5ZaNqzI+N8qgpvaQ5c0AdP7e76MaCgeHtFjQRAOuIlzuTQ9cFb 4E/BiTBMraD2tMRnLPuZoGFznNb8s9upTyYaZfjfh0hGrHb4jPpjEbtdQ4M+qi8CvOq AoozIdeS7ZzvTS3JvmB9CDGlBdIQBAhLLlkHmEpU= Received: from halation.net.flygoat.com (60.177.188.90 [60.177.188.90]) by mx.zoho.com.cn with SMTPS id 1591107386205496.07892354021305; Tue, 2 Jun 2020 22:16:26 +0800 (CST) From: Jiaxun Yang To: ffmpeg-devel@ffmpeg.org Message-ID: <20200602141507.11151-2-jiaxun.yang@flygoat.com> Date: Tue, 2 Jun 2020 22:15:04 +0800 X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200602141507.11151-1-jiaxun.yang@flygoat.com> References: <20200602141507.11151-1-jiaxun.yang@flygoat.com> MIME-Version: 1.0 X-ZohoCNMailClient: External Subject: [FFmpeg-devel] [PATCH v2 1/4] 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 <