[FFmpeg-devel] [PATCH 2/2] Use gcc/clang builtins for av_sat_(add|sub)_64_c if available.

Michael Niedermayer michael at niedermayer.cc
Tue May 19 00:22:26 EEST 2020


On Mon, May 04, 2020 at 11:40:47AM -0700, Dale Curtis wrote:
> On Mon, May 4, 2020 at 11:19 AM James Almer <jamrial at gmail.com> wrote:
> 
> > On 5/4/2020 3:09 PM, Dale Curtis wrote:
> > > Bump. I have 5 integer overflow fuzzing issues awaiting our resolution of
> > > this discussion. Thanks.
> > >
> > > - dale
> >
> > What's the first version of clang with support for __builtin_*_overflow?
> > Because with your patch as is (Checking only __clang__), it's very
> > likely old clang builds could be broken. We have things like Clang 3 on
> > FATE right now.
> >
> 
> Clang 10.0 apparently:
> https://clang.llvm.org/docs/LanguageExtensions.html#feature-checking-macros -
> I'm fine with limiting support to where it works though. Attached patch
> does that.
> 
> 
> >
> > Also, does clang-cl define __clang__ and these builtins? Because maybe
> > we could remove that check and just keep the GCC + Intel one. The former
> > should in theory cover Clang builds that are reportedly compatible with
> > GCC >= 5.1
> >
> 
> Yes, clang-cl defines __clang__ and these builtins.
> 
> - dale

>  common.h |   10 ++++++++++
>  1 file changed, 10 insertions(+)
> 38cfdcfc9d4fa1c1239dc01a766e369b20a0232a  sat_math_builtin_v5.patch
> From 8ac3c2cea0d00c4aec2d1c6278462e6b0f1015b3 Mon Sep 17 00:00:00 2001
> From: Dale Curtis <dalecurtis at chromium.org>
> Date: Fri, 1 May 2020 10:20:43 -0700
> Subject: [PATCH] Use gcc/clang builtins for av_sat_(add|sub)_64_c if
>  available.

doesnt apply cleanly

Applying: Use gcc/clang builtins for av_sat_(add|sub)_64_c if available.
error: patch failed: libavutil/common.h:299
error: libavutil/common.h: patch does not apply
Patch failed at 0001 Use gcc/clang builtins for av_sat_(add|sub)_64_c if available.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I do not agree with what you have to say, but I'll defend to the death your
right to say it. -- Voltaire
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20200518/2efa7bde/attachment.sig>


More information about the ffmpeg-devel mailing list