From patchwork Mon Sep 20 10:00:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Martin_Storsj=C3=B6?= X-Patchwork-Id: 30377 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:6506:0:0:0:0:0 with SMTP id z6csp1303404iob; Mon, 20 Sep 2021 03:01:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwry3M1iINxM3XPH2wVpPwq1eqVQ6I60YkhsSgT/QA/qrf3h1gI3g7wCunxE3tSPax0WMsk X-Received: by 2002:a17:906:645:: with SMTP id t5mr27747049ejb.163.1632132060141; Mon, 20 Sep 2021 03:01:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632132060; cv=none; d=google.com; s=arc-20160816; b=eqJvlfK6Ax1Eb7+gdlWQI9W1gPRLhtE4Vohmfr6goMGRT3re5pOgdejRaZsTs4bSh/ xEor5e3iot7asKORMRBLYRQlR8bh2tAAXdUyC3V482k2cqm/FOYrZMoGk9ZgKL1fLgNV ifR1w5upoWxqYpbCnfvx6ViqnY6ML8EHUhvR8Co3HT6sO18JbiqetuzjUQHbZEILyvgQ F58mkCb9pIafaimhNQBFggplKRuM/erA7ShItA+ajK8jOwlQ0lGWJ4TcMAkjnb9wUHxI qQHaaAOt9t47ZAYvKnN9z9n2QyNaqnl1NWOXmcwnxTuuNVOXPuXaStMHttAVIclliVL3 S+eA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:message-id:date:to:from :dkim-signature:delivered-to; bh=LOwk21x+l6gtVG4Id9nLJezX0l+5CRVB4QHtloJ9qHw=; b=E1YATqrk4bMRXscN96+Kmzzw/RiNsc+H6ncER4CZOMeI/t+zm1JxvHf3URb8aUbZFB kac6Iqfp5d/U6ggQjAHEkEuRvzniyalqSFRMzFDwEPdc5LwrmKyIbB22IOyx19yMCOKX /YU6mLFt5AT972MGL9ozQekET+TPD5M34+fQqoI6ZpL/LZN08aPJEH7ztxcBnpHexoU5 Y9FKfLR9P4uJp8SKEdyJxdHC/rB3CqzzLGETZiLR3SypjF0YO60wnt9j7+Xmyy0h50Wz RGN4J2tFgcqRoGT0i7EsKrhjKng5TV9jp8n1hxFNYe1AuJAjGmiiC4HAtABYe/mkhc79 y/sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@martin-st.20210112.gappssmtp.com header.s=20210112 header.b=R1LfaP8X; 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 w13si20905921ede.389.2021.09.20.03.00.55; Mon, 20 Sep 2021 03:01:00 -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=@martin-st.20210112.gappssmtp.com header.s=20210112 header.b=R1LfaP8X; 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 5082A68AD28; Mon, 20 Sep 2021 13:00:50 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-lf1-f54.google.com (mail-lf1-f54.google.com [209.85.167.54]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C545368A8EE for ; Mon, 20 Sep 2021 13:00:43 +0300 (EEST) Received: by mail-lf1-f54.google.com with SMTP id u8so14080703lff.9 for ; Mon, 20 Sep 2021 03:00:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=martin-st.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=UdcG0RaLcTTQlp2Cg1G+RL5TRqZX6c+0I0kvp0SEhE0=; b=R1LfaP8XYMkBwQEdXGn96nX9EEbJE+GvyyqiggLzyoQds+gip7MrcO1dkmNkzwWTZ3 iSn+qqFnJa61QT1w8DXEmeTINz3EbOKkncLwFMNVbZJVUrb9GaPDgcHG/kdMuvf8U2A3 ZCIS1r58z8L6I7UFQXWvhZgKrFWpMxJRNISUvx96wMKXRyFg+0kIfJdXMf1dwv9FZ09x 3WGND65662Y7tWOpcfmbYqHSHKxQYEHI70/d+keFjl+rXgLHc0JoTuBlm0Vbm0M7wHSo glYo1Ms7/BVsVjwXRgog1cmp24AKeC0Kr9uEL2iw32XaARgdaNLp/QR0L0RJ42vzrtD6 S77w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=UdcG0RaLcTTQlp2Cg1G+RL5TRqZX6c+0I0kvp0SEhE0=; b=XY3tsmmMz7Z/yCqx26OBtO0+69XiBr0W3YDOcW5y2Z5HCLrci+pIniizTFbRvpSxam MQlly1qi1v8BgzEjmGnn79rFNhYtdB9QDVZUO3ufVDTrxl9hNFLqrRh7VAnVXou7TK7o Go5KPoiw5E4H5T4hpwoFsnLswj1PkvRFDTsxJHy2VqPI/AJmQVJrlV85QeELAPx/LiyZ BKREKsTgEVhWDKl+lYT5wjhlmF3g3oIoqTaZvFjSZWBdbqeLuvAiL9dAJUI4+MWnauSL 0V+EwVT/FBuqCVxkY9gAxvz5UiDskh2Sm34bezURoZzyLbooVONMrabbo0rfBfADAnOI 8wnQ== X-Gm-Message-State: AOAM532dfAwg4Rp7MLSaqzu9Wl6QJfVpkZeqwwpuF/W2sqRib4aTo8Dm LpbH7iZ+lwyQvfWqCN43g7HFN1AK1mRYFjHNOeo= X-Received: by 2002:a2e:1511:: with SMTP id s17mr21619029ljd.197.1632132041674; Mon, 20 Sep 2021 03:00:41 -0700 (PDT) Received: from localhost.localdomain (dsl-tkubng21-58c01c-243.dhcp.inet.fi. [88.192.28.243]) by smtp.gmail.com with ESMTPSA id i26sm1220294lfl.288.2021.09.20.03.00.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Sep 2021 03:00:41 -0700 (PDT) From: =?utf-8?q?Martin_Storsj=C3=B6?= To: ffmpeg-devel@ffmpeg.org Date: Mon, 20 Sep 2021 13:00:40 +0300 Message-Id: <20210920100040.3359213-1-martin@martin.st> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] configure: arm: Don't add -march= to the compiler if no preference was passed 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 Cc: =?utf-8?q?Martin_Storsj=C3=B6?= , costamagna.gianfranco@gmail.com Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 2qiZGD67nhyN If no --cpu= option was passed to configure, we detect what the compiler defaults to. This detected value was then fed back to the rest of the configure logic, as if it was an explicit choice. This breaks on Ubuntu 21.10 with GCC 11.1. Since GCC 8, it's possible to add configure extra features via the -march option, like e.g. -march=armv7-a+neon. If the -mfpu= option is configured to default to 'auto', the fpu setting gets taken from the -march option. GCC 11.1 in Ubuntu seems to be configured to use -mfpu=auto. This has the effect of breaking any compilation command that specifies -march=armv7-a, because the driver implicitly also adds -mfloat-abi=hard, and that combination results in this error: cc1: error: ‘-mfloat-abi=hard’: selected processor lacks an FPU Therefore, restructure configure. If no specific preference was set (and the 'cpu' configure variable was set as the output of probe_arm_arch), the value we tried to set via -march= was the same value that we just tried to detect as the compiler default. So instead, just try to detect what the compiler defaults to, with to allow setting other configure settings (such as 'fast_unaligned'), but don't try to spell out the compiler's default via the -march flag. Signed-off-by: Martin Storsjö --- configure | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/configure b/configure index 9249254b70..3a05b8294b 100755 --- a/configure +++ b/configure @@ -5009,9 +5009,11 @@ elif enabled arm; then fi } - [ "$cpu" = generic ] && cpu=$(probe_arm_arch) case $cpu in + generic) + subarch=$(probe_arm_arch | sed 's/[^a-z0-9]//g') + ;; armv*) cpuflags="-march=$cpu" subarch=$(echo $cpu | sed 's/[^a-z0-9]//g')