From patchwork Wed Jan 19 11:54:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 33655 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:cd86:0:0:0:0:0 with SMTP id d128csp4703985iog; Wed, 19 Jan 2022 03:55:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJxKTamg0g+ekEgLAKvn+CM7PtvpqySHjnc+gK/08a72NTOe6TszfHQCqrPwg7k0CRF36XP+ X-Received: by 2002:a17:907:86ab:: with SMTP id qa43mr24656325ejc.119.1642593336916; Wed, 19 Jan 2022 03:55:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642593336; cv=none; d=google.com; s=arc-20160816; b=w8my+Y+kXamUtXM+dDNGBdgxLOHsNxSp0oWg1EOssQo9JZG00nDcD9+y81NZmsqnGy 3yTB8ugicjJYlm3iL6fbkumkEPZFtIceV/F/C8nQjzf/a/HjSWxMRN9GT5hK8zh1LKYX TNGGoQUf7JPAH3WnE53cgdl1AOMX41oUwFluFlf8JQC24WK3lKa4dpha5UG8ntcGCwdn kXBH20ZfqnHn3/L0+h5AqwB5j4NDZQ6Mhejnq+ocPYFTCcTKejt8hhPhi6vzTsOhkrjg 6G2lCVSfvjpQ2zqy5H3WbKSqdbDNwRp+FcvCYjBwRUdHBmLmP0UP8/rLKu2tzkC4Wsou elRQ== 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 :delivered-to; bh=XzrRQP5eKVOlD5OHV4kWkjlI8F5rlZmsMD8+1JiWSKI=; b=LiQXzsqQcZG2XCKOYqiLVD9nqwhjB45CodEGg29bTw1kaPDpyiNvz8GZBD3HqlIFWf HEXzspYiuI5YCPpeWZNHOGmP/DTM1d0uMKe3aI4A/XJ9JVk6uZWOORPnesAkhbrqSETc gHWKJ/BoNq7+Q54ifTqi/dXe/BUuuEAYH00uhNG5jJEa5289k9WaCI60WTfPzypVhEee vyLWi3OEX/VhJZkeX9WEDCv/FTyaNNF/GRZqK+PwZ6H9L+mRLFgqg+Fx7ECVukaMEp6c wO9fjhsbIL9qKS4DabwdHDwvNtW3tvm2bcW4ObCsm954aFX8D+1f2YZJJNbPF/Vj5PeX NIcQ== ARC-Authentication-Results: i=1; mx.google.com; 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 cw22si11250727ejc.866.2022.01.19.03.55.36; Wed, 19 Jan 2022 03:55:36 -0800 (PST) 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; 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 EFAD768B0D5; Wed, 19 Jan 2022 13:55:32 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 14DF168AFF5 for ; Wed, 19 Jan 2022 13:55:30 +0200 (EET) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id B273324017E for ; Wed, 19 Jan 2022 12:55:29 +0100 (CET) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id tqiu6s1SNwx7 for ; Wed, 19 Jan 2022 12:55:28 +0100 (CET) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id 65D6424017C for ; Wed, 19 Jan 2022 12:55:28 +0100 (CET) Received: by libav.khirnov.net (Postfix, from userid 1000) id 67D473A067C; Wed, 19 Jan 2022 12:55:28 +0100 (CET) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Wed, 19 Jan 2022 12:54:32 +0100 Message-Id: <20220119115432.12571-1-anton@khirnov.net> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] configure: link to libatomic when it's present 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: 4uxKuMfw3qe5 C11 atomics in some configurations (e.g. 64bit operations on ppc64 with GCC) require linking to libatomic. --- Testing welcome, especially in configurations where * libatomic is not present * libatomic is actually needed --- configure | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/configure b/configure index 1413122d87..1ff5dbee5b 100755 --- a/configure +++ b/configure @@ -6324,7 +6324,14 @@ check_headers asm/types.h # it seems there are versions of clang in some distros that try to use the # gcc headers, which explodes for stdatomic # so we also check that atomics actually work here -check_builtin stdatomic stdatomic.h "atomic_int foo, bar = ATOMIC_VAR_INIT(-1); atomic_store(&foo, 0); foo += bar" +# +# some configurations also require linking to libatomic, so try +# both with -latomic and without +for LATOMIC in "-latomic" ""; do + check_builtin stdatomic stdatomic.h \ + "atomic_int foo, bar = ATOMIC_VAR_INIT(-1); atomic_store(&foo, 0); foo += bar" \ + $LATOMIC && add_extralibs $LATOMIC && break +done check_lib advapi32 "windows.h" RegCloseKey -ladvapi32 check_lib bcrypt "windows.h bcrypt.h" BCryptGenRandom -lbcrypt &&