Skip to content

error: invalid output size for constraint '=a' for ARCH=i386 after e2ffa15b9baa #2121

Open

Description

@nathanchance

After commit e2ffa15b9baa ("kbuild: Disable CC_HAS_ASM_GOTO_OUTPUT on clang < 17"), which exposes a separate code path that was not used before, there is an error when building mm/maccess.c for ARCH=i386 with LLVM 15 or 16 (the only supported versions impacted):

$ make -skj"$(nproc)" ARCH=i386 LLVM=1 clean defconfig mm/maccess.o
mm/maccess.c:41:3: error: invalid output size for constraint '=a'
                copy_from_kernel_nofault_loop(dst, src, size, u64, Efault);
                ^
mm/maccess.c:22:3: note: expanded from macro 'copy_from_kernel_nofault_loop'
                __get_kernel_nofault(dst, src, type, err_label);        \
                ^
arch/x86/include/asm/uaccess.h:630:18: note: expanded from macro '__get_kernel_nofault'
        __get_user_size(*((type *)(dst)), (__force type __user *)(src), \
                        ^
mm/maccess.c:41:3: error: invalid output size for constraint '=a'
mm/maccess.c:22:3: note: expanded from macro 'copy_from_kernel_nofault_loop'
                __get_kernel_nofault(dst, src, type, err_label);        \
                ^
arch/x86/include/asm/uaccess.h:630:18: note: expanded from macro '__get_kernel_nofault'
        __get_user_size(*((type *)(dst)), (__force type __user *)(src), \
                        ^

Activity

  1. nickdesaulniers commented on Mar 30, 2026

    @nickdesaulniers
    Member

    So this only affects older releases of clang?

  2. nathanchance commented on Mar 30, 2026

    @nathanchance
    MemberAuthor

    I think the error: invalid output size for constraint '=a' could still be seen even with tip of tree clang but that code path is not taken when asm goto with outputs is used (so clang-17 and newer is “fixed”).

  3. nickdesaulniers commented on Mar 30, 2026

    @nickdesaulniers
    Member

    Can you help reduce a test case to report upstream? (Low priority)

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions