From patchwork Fri Mar 24 13:35:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "J. Dekker" X-Patchwork-Id: 40798 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:d046:b0:cd:afd7:272c with SMTP id hv6csp617155pzb; Fri, 24 Mar 2023 06:35:25 -0700 (PDT) X-Google-Smtp-Source: AKy350ZCICaXqECNZ14MiyVi4zx6ecCbNkDJkVUh55TIJfHoHDd0V2M1POYpPxv88B89uOvAaYNW X-Received: by 2002:a17:907:2ced:b0:8f5:8da0:a482 with SMTP id hz13-20020a1709072ced00b008f58da0a482mr2367629ejc.25.1679664924898; Fri, 24 Mar 2023 06:35:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679664924; cv=none; d=google.com; s=arc-20160816; b=ZoWjX59fvRusSEEDd0Y5ro5gR7OCA34jiHiKkMkhcIXEM2qSXJQIwpx+qsTAFOVavZ 5mgQ0iywAdTDeZ2DV7q9lrHMQF9rOM9nQ6bMSxsfCqbiUE5CH1Gh1/ErNdazAVYn0l3s /+qFbzNSf9fCVc9e60l/gGLTYynpNU0MhmtUGuEnVKKCNRFfOmMBWoUe2X3pFcH9wayu z92FzEofOvf5Dca3EditbTuxK9iDAcvK4n6CLsj2vTA0a94uRI6QhsY2EWed+SUZuDFN eLjB0/CG7bmUadvXJz2Jom/6ZfM6mvrjSlzn2B3rl0GcAy5Z58L6rjrQIdHRpZQ+VnGi uxng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:message-id:date:to:from:feedback-id :dkim-signature:dkim-signature:delivered-to; bh=rlDwudV/quwf5zEKhv1ci0u0axpTnAAryP9WXOIw++o=; b=D5Rp70UTzlyMYvzqBTbGNstVrHA15Qv4pF0iO5tSXYxzbwXCoKzJMM5NNaswn/TuD+ 3EYnXrTv2tBdSS+dnDdEMbGiYVf1FLGBCf+CPOWLJX7eN3sj/yS+pvi/jFHNDo77MqSt 7iaSIk703z3w4Uicu7VMfaFHubTjK0ORKZqObcXPC7jquikyT5zVv5pPbdfmvHWlpS4S xWyQtM3mZzL1TynBub7e84mxpFsCdfSndAyG1hQXxZa9Pcad7wQKP3/uIXMEpQzRAHzm YYgNF8W6JTJAORyuFpd494p3H2II42icA1TCLNaAEQ9yPQLkJP6TeigMTs0guwEWdbjC ZvCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@itanimul.li header.s=fm3 header.b=A2imhg5D; dkim=neutral (body hash did not verify) header.i=@messagingengine.com header.s=fm2 header.b=kaS323o3; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id wz8-20020a170906fe4800b0093defbd6277si2115672ejb.1022.2023.03.24.06.35.19; Fri, 24 Mar 2023 06:35:24 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@itanimul.li header.s=fm3 header.b=A2imhg5D; dkim=neutral (body hash did not verify) header.i=@messagingengine.com header.s=fm2 header.b=kaS323o3; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id EF8B568C7E6; Fri, 24 Mar 2023 15:35:15 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8B8CD68C6A5 for ; Fri, 24 Mar 2023 15:35:09 +0200 (EET) Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 31DB15C006A for ; Fri, 24 Mar 2023 09:35:08 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Fri, 24 Mar 2023 09:35:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=itanimul.li; h= cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:message-id:mime-version:reply-to:sender:subject :subject:to:to; s=fm3; t=1679664908; x=1679751308; bh=9w9hSUOaS0 3MxS6eecjIRvdUrOETrS+vNybXxv3ZuYM=; b=A2imhg5DtFNdWIWeij9hFCEhrk c1qdOn/pVT/k6BxVrxQxnUI8I/4cvSNLkH4nvMD0Ue2MPqK2oScKyaZh++37+kPJ 9PtP+znbm/PuuK//gl1paLBj8rA6ZG6mXyRvC0Bwth8dUrn+8rZ2H0fjVgIP2rKB Jlnf3V3tVdWtmOltXAe/KgPbAcoo8xiMx7O0uLj99LW27ZeADaIHIWeU4qML30gL uP4FiooAEhWnr0cYIlbZa0IhG9VU5mW6DCdOC1Xk8qAzGejVqQRfiegOfeBLu8yF Lc0ptJNY5Kde/kzfYex6T7BH5wgiV8z/vyEUDZtj1KNo7ioynF7BCs46Z/EQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:date:feedback-id:feedback-id:from:from:in-reply-to :message-id:mime-version:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1679664908; x=1679751308; bh=9w9hSUOaS03MxS6eecjIRvdUrOET rS+vNybXxv3ZuYM=; b=kaS323o37C31zxqLpo6WiBhIFe2NxNTlarTPRSPdAPSd 7gE/jIcZLCbqVA8haz+dT+hAlHTapJUJ7cgey9w4X14IU1VECrEVNygB/OHDdNlR +NdlT6MseSFzwbsz2JeXOzT/k7iGvJWA5tRAkXmcTIVML68Ebzmhxs5HHMQaU2lh Mc1tXpTgYEdsq0ezkv9BK/4MogMSpcEQlIxTsuMm78omcsJlUgK34ni+xdeuG2SP W/eH2TMpq0qbTtEYzF288TJUqY7PAp6AJvVP3Q0ES0oZ1cTr5XsZN5s2PyK4Gqdn YDmXfpUHnWh+8jtv7G+igkII03kmTAg/B2sTXZlFhQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvdegiedgheegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgggfestdekredtre dttdenucfhrhhomhepfdflrdcuffgvkhhkvghrfdcuoehjuggvkhesihhtrghnihhmuhhl rdhliheqnecuggftrfgrthhtvghrnhepueetgfdtuedvjeejjedvteelffeuhedtfeetud fglefhjeeukeetvddvtdevieeinecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghm pehmrghilhhfrhhomhepjhguvghksehithgrnhhimhhulhdrlhhi X-ME-Proxy: Feedback-ID: i84994747:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Fri, 24 Mar 2023 09:35:07 -0400 (EDT) From: "J. Dekker" To: ffmpeg-devel@ffmpeg.org Date: Fri, 24 Mar 2023 14:35:05 +0100 Message-Id: <20230324133505.23229-1-jdek@itanimul.li> X-Mailer: git-send-email 2.37.1 (Apple Git-137.1) MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2] configure: add LTO optarg X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: od/FdOOgt1Ty This allows users to specify an argument such as './configure --enable-lto=thin' to use ThinLTO with Clang. The old functionality with './configure --enable-lto' is preserved. Signed-off-by: J. Dekker --- configure | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/configure b/configure index 8980cec7ee..bf5ad540cf 100755 --- a/configure +++ b/configure @@ -412,7 +412,7 @@ Toolchain options: --build-suffix=SUFFIX library name suffix [] --enable-pic build position-independent code --enable-thumb compile for Thumb instruction set - --enable-lto use link-time optimization + --enable-lto[=arg] use link-time optimization --env="ENV=override" override the environment variables Advanced options (experts only): @@ -2524,7 +2524,6 @@ CMDLINE_SELECT=" debug extra_warnings logging - lto optimizations rpath stripping @@ -4170,6 +4169,9 @@ for opt do --enable-sdl) enable sdl2 ;; + --enable-lto|--enable-lto=*) + lto=-f${opt#--enable-} + ;; --enable-*=*|--disable-*=*) eval $(echo "${opt%%=*}" | sed 's/--/action=/;s/-/ thing=/') is_in "${thing}s" $COMPONENT_LIST || die_unknown "$opt" @@ -4639,7 +4641,7 @@ icl_flags(){ # on Windows, does enable remarks so disable them here. -Wall) echo $flag -Qdiag-disable:remark ;; -std=c99) echo -Qstd=c99 ;; - -flto) echo -ipo ;; + -flto*) echo -ipo ;; esac done } @@ -4647,7 +4649,7 @@ icl_flags(){ icc_flags(){ for flag; do case $flag in - -flto) echo -ipo ;; + -flto*) echo -ipo ;; *) echo $flag ;; esac done @@ -7182,17 +7184,17 @@ fi check_optflags(){ check_cflags "$@" - enabled lto && check_ldflags "$@" + [ -n "$lto" ] && check_ldflags "$@" } check_optflags $optflags check_optflags -fno-math-errno check_optflags -fno-signed-zeros -if enabled lto; then +if [ -n "$lto" ]; then test "$cc_type" != "$ld_type" && die "LTO requires same compiler and linker" - check_cflags -flto - check_ldflags -flto $cpuflags + check_cflags $lto + check_ldflags $lto $cpuflags disable inline_asm_direct_symbol_refs fi @@ -7223,7 +7225,7 @@ if enabled icc; then # icc 11.0 and 11.1 work with ebp_available, but don't pass the test enable ebp_available # The test above does not test linking - enabled lto && disable symver_asm_label + [ -n "$lto" ] && disable symver_asm_label if enabled x86_32; then icc_version=$($cc -dumpversion) test ${icc_version%%.*} -ge 11 &&