Skip to content

main fails to compile with gcc 15 #60566

Description

@richardlau

Attempting to build the main branch with gcc 15 (tested on Fedora 42 and Ubuntu 25.10 (container)) fails to compile with

cc1plus: error: attribute 'target' argument 'avx10.2-512' is unknown

This appears to have started after the V8 14.2 update -- possibly highway (which is version sniffing the compiler)?

#ifndef HWY_BROKEN_AVX10_2 // allow override
// AVX10_2 requires clang >= 20.1 (postpone to 23 due to "avx10.2-512" remnant,
// only removed in https://github.com/llvm/llvm-project/pull/157034) or
// gcc >= 15.2 with binutils 2.44.
#if (HWY_COMPILER_CLANG < 2300) && (HWY_COMPILER_GCC_ACTUAL < 1502)
#define HWY_BROKEN_AVX10_2 HWY_AVX10_2
#else
#define HWY_BROKEN_AVX10_2 0
#endif
#endif // HWY_BROKEN_AVX10_2

Switching to clang (on Fedora, clang 20.1.8) or gcc 14 (Ubuntu) succeeds without the error (both of which would cause HWY_BROKEN_AVX10_2 to be defined according to the above snippet).

$ gcc --version
gcc (GCC) 15.2.1 20250808 (Red Hat 15.2.1-1)
Copyright (C) 2025 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$
$ gcc --version
gcc (Ubuntu 15.2.0-4ubuntu4) 15.2.0
Copyright (C) 2025 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$

Activity

  1. richardlau commented on Nov 3, 2025

    @richardlau
    MemberAuthor

    I think the error is originating here (specifically the bit that appends avx10.2-512):

    #if HWY_COMPILER_GCC_ACTUAL >= 1500 || HWY_COMPILER_CLANG >= 2200
    #if HWY_HAVE_EVEX512
    #define HWY_TARGET_STR_AVX10_2 HWY_TARGET_STR_AVX3_SPR ",avx10.2-512"
    #else
    #define HWY_TARGET_STR_AVX10_2 HWY_TARGET_STR_AVX3_SPR ",avx10.2"
    #endif // HWY_HAVE_EVEX512
    #else
    #define HWY_TARGET_STR_AVX10_2 HWY_TARGET_STR_AVX3_SPR
    #endif

    It looks like this code was rewritten in google/highway#2563 and now looks like https://github.com/google/highway/blob/b0a4535743aca3e499d8c8d6d4969b94108ea854/hwy/ops/set_macros-inl.h#L196-L205

    // Support for avx10.2-512 was removed between clang 22 and 23 without a
    // feature test macro.
    #if HWY_COMPILER_CLANG >= 2200 && HWY_HAVE_EVEX512
    #define HWY_TARGET_STR_AVX10_2 HWY_TARGET_STR_AVX3_SPR ",avx10.2-512"
    // Recent compilers drop the -512 suffix because 512 bits are always available.
    #elif HWY_COMPILER_GCC_ACTUAL >= 1500 || HWY_COMPILER_CLANG >= 2200
    #define HWY_TARGET_STR_AVX10_2 HWY_TARGET_STR_AVX3_SPR ",avx10.2"
    #else
    #define HWY_TARGET_STR_AVX10_2 HWY_TARGET_STR_AVX3_SPR
    #endif

    i.e. for gcc 15 it would now use avx10.2 instead of avx10.2-512.

  2. richardlau commented on Nov 3, 2025

    @richardlau
    MemberAuthor
  3. richardlau commented on Nov 11, 2025

    @richardlau
    MemberAuthor

    I can confirm cherry-picking the upstream highway commit fixes the build with gcc 15. It hasn't landed in upstream V8 yet, but I've gone ahead and opened a cherry-pick PR: #60682

  4. added a commit that references this issue on Nov 13, 2025
  5. 137 remaining items

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      Sponsor
      SponsoredKunjungi sekarang
      Promo