Re: Compile problems w/gcc 9.4.0 in linux-next
From: Ingo Molnar
Date: Sat Mar 22 2025 - 03:36:56 EST
* Michael Kelley <mhklinux@xxxxxxxxxxx> wrote:
> From: Ingo Molnar <mingo@xxxxxxxxxx> Sent: Friday, March 21, 2025 12:38 AM
> >
> > * Michael Kelley <mhklinux@xxxxxxxxxxx> wrote:
> >
> > > > What are your thoughts as maintainers of lib/zstd?
> > >
> > > FYI, the same segfault occurs with gcc 10.5. The problem is fixed
> > > in gcc 11.4.
> >
> > So the patch below would work this around on GCC9 and GCC10?
>
> I've confirmed that the patch gives a clean compile with gcc 9.4.
>
> Note that I confirmed yesterday that the gcc problem is fixed with
> 11.4. I don't know about earlier gcc 11 minor versions. Lemme see
> if I can get the original gcc 11 release and try that to confirm that
> your patch has the right version cutoff.
Thank you for the testing!
> > +++ b/lib/zstd/common/portability_macros.h
> > @@ -55,7 +55,7 @@
> > #ifndef DYNAMIC_BMI2
> > #if ((defined(__clang__) && __has_attribute(__target__)) \
> > || (defined(__GNUC__) \
> > - && (__GNUC__ >= 5 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)))) \
> > + && (__GNUC__ >= 11))) \
> > && (defined(__x86_64__) || defined(_M_X64)) \
> > && !defined(__BMI2__)
> > # define DYNAMIC_BMI2 1
Worst case, if it isn't, I suppose we'll get followup bug reports.
Thanks,
Ingo