From patchwork Thu Mar 23 13:46:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "J. Dekker" X-Patchwork-Id: 40781 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:d046:b0:cd:afd7:272c with SMTP id hv6csp4227711pzb; Thu, 23 Mar 2023 06:46:45 -0700 (PDT) X-Google-Smtp-Source: AK7set8VsMwBpp536ZN7JgijsicqF9/iY8ovyVdE8FqNhJBzOYjbGJD0GLSX/Wwui5NODgj9sjiv X-Received: by 2002:a17:907:382:b0:921:412b:d8c1 with SMTP id ss2-20020a170907038200b00921412bd8c1mr10163885ejb.71.1679579205724; Thu, 23 Mar 2023 06:46:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679579205; cv=none; d=google.com; s=arc-20160816; b=R4PgqUSKVX0XAIunUu7JaKqu9ULgrjhq9GXiPSTzAhfv4sojTK4ZIspgoF4Ixn/Tiw UHJaAzqEB144HSwXzM/J87v2j/5PolglOzufjhzmhP1ev4TOryASXpwFY2I8jE3dPE+e ZWObS72y7yLbE1+AqR0AqU3hzFA+EEeRwBJboOF/jBi8XV9BxnxHyhLSTQsKDVxC/pXO oxgtIw3J3Ze/jqwFPagID6IZjvHeh8K1Zd78MI7ty2nDmUAyHlxL/vFtlRFdRufTD+fm 8qQjK0o/gE5PXK94TojfZXqnc24oYdqe7asbfDRMLDeWvyyi3ioMrxj51be2Ed6b2u6h WTKA== 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=ppXY6AtJmAQXAeXW1RHEi4FLEy9VPA9Z0nDDhKwmG14=; b=WYYL9QhzxO3tGyS8pBd19274zWVn+1glf96IHNNeKJND0ZXgiOH/GjDzZRG7FWM4I7 9IIMvxFieHLZVFri/bpiWPES+ByKOiBQR/gywelMtfFfUedu5aePlnzB4uzjzGl9tKj6 INDwp3I1xp8A3PG3WJCDOzWn6UlOw0YkoE6dMN1sLvtw+1hbr5Fr9v9xqjo6mM8/LQpO 4DtQDRGVmf8dViy0PwE3CVK0Vvx4scsM+TxD0WOmskNqeca+QyIoE+93l+R8WoPw13fQ ft2F8Pm7+0Xb7mIneqOvosThbpm36gxGELXxfzG17o2CKtQBmMnSkSZ8A60xGXvbImli EOyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@itanimul.li header.s=fm3 header.b=RCWIzj9a; dkim=neutral (body hash did not verify) header.i=@messagingengine.com header.s=fm2 header.b=dTv8vQfR; 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 z9-20020a1709067e4900b009094a93d9b7si17829899ejr.990.2023.03.23.06.46.45; Thu, 23 Mar 2023 06:46:45 -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=RCWIzj9a; dkim=neutral (body hash did not verify) header.i=@messagingengine.com header.s=fm2 header.b=dTv8vQfR; 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 8DC0668C102; Thu, 23 Mar 2023 15:46:41 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4166A68C271 for ; Thu, 23 Mar 2023 15:46:34 +0200 (EET) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 8BEB45C0061 for ; Thu, 23 Mar 2023 09:46:31 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 23 Mar 2023 09:46:31 -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=1679579191; x=1679665591; bh=wcQulSvNs3 z5EGv+3xroSm1Zu4vyYhZF/G7P3pzG2cE=; b=RCWIzj9amKoloOFUSSW6TKu/gt Wg9sbTSNTESAJu2pyHJLwWCt6Y4wQipGihOm05AVu7n3CSRYy89h47EIJWWpeVrd Mdj/eDemdGv4JTGx4NJ7Qk3Cm2AhMcNHe4UKipHAWPbO0RqqzZMyLzeeQlnllAb0 cMdR007ugFwHkt2EzwQqyMTLaNy7+kHz8T21keujV1YWAAWX6mBN6HXLy1rsD2jK zGOoyzI9jrokMh+9c0PMXpuYy4mG9BS2qzZglUI01ugNeby3vTDarJF+0umhRVam XrLpsvgE80BuWpSUOy7r3ALO5w2q1n6qupus1f7l0xwBGMRnLPf3txudbJNg== 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=1679579191; x=1679665591; bh=wcQulSvNs3z5EGv+3xroSm1Zu4vy YhZF/G7P3pzG2cE=; b=dTv8vQfRgonahaov1MHqJvpG2u+LGvV5vlrp99Zr9lo2 6KltEeajhURjf/q9YmSfPQIzBe6hA17zAvYCBbfHz11F3k/o4VvRnm95w9NqRojW kjmbuhuw9d5UzR7j9fQLIn4BLQ6L/FYYRtAVR/0W9MW7tDtrLazFtUzeeqIl5Q8R WCKyStUduk4gTyjPNCLzTcB/GBojp/NhJWTR72fM//2SopJzRP4nmnJodjq6flkt IPfjDd0KKcMephgFYDS8Q1yq+xS4o8UFjqr/Tq2RHe+tw+VGWNxxOZ39QtMUjEIe IY8yCVKOjl/9zD8CFFR4GYcMjeAcWfrc2dEAWAibaQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvdeggedgheehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgggfestdekredtre dttdenucfhrhhomhepfdflrdcuffgvkhhkvghrfdcuoehjuggvkhesihhtrghnihhmuhhl rdhliheqnecuggftrfgrthhtvghrnhepueetgfdtuedvjeejjedvteelffeuhedtfeetud fglefhjeeukeetvddvtdevieeinecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghm pehmrghilhhfrhhomhepjhguvghksehithgrnhhimhhulhdrlhhi X-ME-Proxy: Feedback-ID: i84994747:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Thu, 23 Mar 2023 09:46:30 -0400 (EDT) From: "J. Dekker" To: ffmpeg-devel@ffmpeg.org Date: Thu, 23 Mar 2023 14:46:28 +0100 Message-Id: <20230323134628.88073-1-jdek@itanimul.li> X-Mailer: git-send-email 2.37.1 (Apple Git-137.1) MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] 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: 4LibJXQjZrK0 This allows users to call with './configure --enable-lto' (or more explicitly './configure --enable-lto=full') for the old functionality or specify './configure --enable-lto=thin' to use ThinLTO. Signed-off-by: J. Dekker --- configure | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/configure b/configure index 8980cec7ee..b65001d39d 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,12 @@ for opt do --enable-sdl) enable sdl2 ;; + --enable-lto) + lto=full + ;; + --enable-lto=*) + lto="$optval" + ;; --enable-*=*|--disable-*=*) eval $(echo "${opt%%=*}" | sed 's/--/action=/;s/-/ thing=/') is_in "${thing}s" $COMPONENT_LIST || die_unknown "$opt" @@ -4639,7 +4644,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 +4652,7 @@ icl_flags(){ icc_flags(){ for flag; do case $flag in - -flto) echo -ipo ;; + -flto*) echo -ipo ;; *) echo $flag ;; esac done @@ -7182,17 +7187,17 @@ fi check_optflags(){ check_cflags "$@" - enabled lto && check_ldflags "$@" + [ -z "$lto" ] || check_ldflags "$@" } check_optflags $optflags check_optflags -fno-math-errno check_optflags -fno-signed-zeros -if enabled lto; then +if [ ! -z "$lto" ]; then test "$cc_type" != "$ld_type" && die "LTO requires same compiler and linker" - check_cflags -flto - check_ldflags -flto $cpuflags + check_cflags -flto=$lto + check_ldflags -flto=$lto $cpuflags disable inline_asm_direct_symbol_refs fi @@ -7223,7 +7228,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 + [ -z "$lto" ] || disable symver_asm_label if enabled x86_32; then icc_version=$($cc -dumpversion) test ${icc_version%%.*} -ge 11 &&