From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 7A9AC40245 for ; Wed, 19 Jan 2022 12:34:32 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6586668B087; Wed, 19 Jan 2022 14:34:30 +0200 (EET) Received: from mail-oi1-f171.google.com (mail-oi1-f171.google.com [209.85.167.171]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3FA2068B050 for ; Wed, 19 Jan 2022 14:34:24 +0200 (EET) Received: by mail-oi1-f171.google.com with SMTP id bf5so3876578oib.4 for ; Wed, 19 Jan 2022 04:34:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :references:from:in-reply-to:content-transfer-encoding; bh=G0Ex8UvgHVFtJR3m5FJTqud7iKv4yydPJu16EWjZYks=; b=LYAonTKuL7JlUWs6mcb+BeAhowQhJs5/GXVRKc312KxErJOLYEZgotj5WsvLXi4qei JGXYKJQPpLCTHplCYPd0m+D+O3zkjwhlVPOwf7EZbV/gKljwjvy6kcPM2jUfWyHRJvI7 c3zjCDgD2N2A4T10nRooQPsFS+gFdifsgEg9RnDNBL/8WH3EkM3dES1fVStUqAoTydEU w2QXnasNJlzdm6CHVNVeo4lnbK+InuBaN8LB7jSQNyREAQnBm+NYaGVuUGhPqT+oyxKj vFeW5+4GzyvwVazBtHo3byg0hkLwcr4X9JJWslPd65Fo4liL7ro2O5yBdrCSB8kGHiWx Ur9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=G0Ex8UvgHVFtJR3m5FJTqud7iKv4yydPJu16EWjZYks=; b=i9ZHmgYjVSoiWDRX6HOllFlSMm4M1pI9tM/krKe+SsgthN2aozpSJeD08LO5ZBUcow StEi9j1tlARzs6rUu0JeJSZyDPq4lNEC+Hc1UwSzJFUubHQT27p1+sj2O+dpG+66J86S S5eMQ4KN2tGJkix+UkcnzfWWdLN7MKKIFlQeuPPVCBALj7jJym5oY1FVVtZY1mDGG4eL s0ivv1YNpjswMGbS+xMgpGLOQwbG77H2YvyremDKdtpuQxrdI6W6SOz6ldB3r0hYbRqj Q2y0+QcsOytrYgchyVx2VXPBKKw0D7lALB2+UrFA7L1Tq2NsSVdE69yTyfsRQCjLlFc2 f9HA== X-Gm-Message-State: AOAM533YforLIu9olnnUq6aSZXCSvBLNWM4Zpya/of6xMMwJZpK0W9e6 5Y1XmwSW+3pVgj3/rmkDNYvK4Xo/hew= X-Google-Smtp-Source: ABdhPJwkl4oOw9IuZpwQk60OPJEeNlDQVwbc7cR9zAmFIqLFb7O4YGzAIVA89yv1wCI5723cZxFIYg== X-Received: by 2002:a05:6808:1442:: with SMTP id x2mr2677020oiv.166.1642595662233; Wed, 19 Jan 2022 04:34:22 -0800 (PST) Received: from [192.168.0.13] ([186.136.131.95]) by smtp.gmail.com with ESMTPSA id w7sm6837547ott.4.2022.01.19.04.34.21 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 19 Jan 2022 04:34:21 -0800 (PST) Message-ID: <0bd6970d-e2c9-0ff1-3137-5b01dbff3a86@gmail.com> Date: Wed, 19 Jan 2022 09:34:20 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Content-Language: en-US To: ffmpeg-devel@ffmpeg.org References: <20220119115432.12571-1-anton@khirnov.net> From: James Almer In-Reply-To: <20220119115432.12571-1-anton@khirnov.net> Subject: Re: [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 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On 1/19/2022 8:54 AM, Anton Khirnov wrote: > 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 Shouldn't you try without it first? On my toolchain libatomic is present, but libraries compile without linking to it just fine. That changes after this patch, where it starts linking to it explicitly. > + check_builtin stdatomic stdatomic.h \ > + "atomic_int foo, bar = ATOMIC_VAR_INIT(-1); atomic_store(&foo, 0); foo += bar" \ > + $LATOMIC && add_extralibs $LATOMIC && break You should probably add it to the required libraries' extralibs only. Just replace the add_extralibs part with setting stdatomic_extralibs to $LATOMIC, and then add stdatomic to all the libraries' _suggest lists, same as we do for libm. > +done > > check_lib advapi32 "windows.h" RegCloseKey -ladvapi32 > check_lib bcrypt "windows.h bcrypt.h" BCryptGenRandom -lbcrypt && _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".