Skip to content

Unable to compile on ARM64 with clang #13260

Closed
@derzahla

Description

@derzahla

System information

Type Lenovo c630 w/Snapdragon sdm850 cortex.a75-cortex.a55
Distribution Name Arch
Distribution Version Current w/ clang 13.0.1
Kernel Version 5.17.0
Architecture ARM64
OpenZFS Version 2.1.4 and latest git

Describe the problem you're observing

While building under GCC works fine, I am unable to with clang+lto or -lto

Describe how to reproduce the problem

Compile linux kernel with ZFS +clang or compile ZFS as a dkms module for a kernel compiled with clang

Include any warning/errors/backtraces from the system logs

LTO [M] drivers/bluetooth/btrsi.lto.o

LTO [M] drivers/target/target_core_user.lto.o
GEN .version
CHK include/generated/compile.h
GEN .tmp_initcalls.lds
GEN .tmp_symversions.lds
LTO vmlinux.o
ld.lld: error: couldn't allocate output register for constraint '{v0}' at line 2150099659
ld.lld: error: couldn't allocate output register for constraint '{v7}' at line 2150100117
ld.lld: error: couldn't allocate input reg for constraint '{v1}' at line 2150100832
ld.lld: error: couldn't allocate output register for constraint '{v0}' at line 2150101251
ld.lld: error: couldn't allocate output register for constraint '{v7}' at line 2150101709
ld.lld: error: couldn't allocate input reg for constraint '{v1}' at line 2150102484
ld.lld: error: couldn't allocate output register for constraint '{v0}' at line 2157696494
ld.lld: error: couldn't allocate input reg for constraint '{v0}' at line 2157700699
ld.lld: error: couldn't allocate output register for constraint '{v0}' at line 2157704887
ld.lld: error: couldn't allocate input reg for constraint '{v0}' at line 2157709206
ld.lld: error: couldn't allocate output register for constraint '{v0}' at line 2157714137
ld.lld: error: couldn't allocate output register for constraint '{v0}' at line 2157718730
ld.lld: error: couldn't allocate input reg for constraint '{v0}' at line 2157724053
ld.lld: error: couldn't allocate output register for constraint '{v0}' at line 2157728241
ld.lld: error: couldn't allocate output register for constraint '{v0}' at line 2157732948
ld.lld: error: couldn't allocate input reg for constraint '{v0}' at line 2157738385
ld.lld: error: couldn't allocate output register for constraint '{v16}' at line 2157781218
ld.lld: error: couldn't allocate output register for constraint '{v0}' at line 2157782350
ld.lld: error: couldn't allocate output register for constraint '{v4}' at line 2157786517
ld.lld: error: couldn't allocate output register for constraint '{v4}' at line 2157789877
ld.lld: error: too many errors emitted, stopping now (use -error-limit=0 to see all errors)
make: *** [Makefile:1156: vmlinux] Error 1
==> ERROR: A failure occurred in build().
Aborting...

More detail is obtained when not using LTO, here is output without LTO and using with "make v=1" :

CC fs/proc/inode.o
fs/zfs/zcommon/zfs_fletcher_aarch64_neon.c:151:2: error: couldn't allocate output register for constraint '{v0}'
NEON_INIT_LOOP();
^
fs/zfs/zcommon/zfs_fletcher_aarch64_neon.c:75:6: note: expanded from macro 'NEON_INIT_LOOP'
asm("eor %[ZERO].16b,%[ZERO].16b,%[ZERO].16b\n"
^
fs/zfs/zcommon/zfs_fletcher_aarch64_neon.c:154:3: error: couldn't allocate output register for constraint '{v7}'
NEON_MAIN_LOOP(NEON_DONT_REVERSE);
^
fs/zfs/zcommon/zfs_fletcher_aarch64_neon.c:93:6: note: expanded from macro 'NEON_MAIN_LOOP'
asm("ld1 { %[SRC].4s }, %[IP]\n"
^
fs/zfs/zcommon/zfs_fletcher_aarch64_neon.c:157:2: error: couldn't allocate input reg for constraint '{v1}'
NEON_FINI_LOOP();
^
fs/zfs/zcommon/zfs_fletcher_aarch64_neon.c:112:6: note: expanded from macro 'NEON_FINI_LOOP'
asm("st1 { %[ACC0].4s },%[DST0]\n"
^
fs/zfs/zcommon/zfs_fletcher_aarch64_neon.c:190:2: error: couldn't allocate output register for constraint '{v0}'
NEON_INIT_LOOP();
^
fs/zfs/zcommon/zfs_fletcher_aarch64_neon.c:75:6: note: expanded from macro 'NEON_INIT_LOOP'
asm("eor %[ZERO].16b,%[ZERO].16b,%[ZERO].16b\n"
^
fs/zfs/zcommon/zfs_fletcher_aarch64_neon.c:193:3: error: couldn't allocate output register for constraint '{v7}'
NEON_MAIN_LOOP(NEON_DO_REVERSE);
^
fs/zfs/zcommon/zfs_fletcher_aarch64_neon.c:93:6: note: expanded from macro 'NEON_MAIN_LOOP'
asm("ld1 { %[SRC].4s }, %[IP]\n"
^
fs/zfs/zcommon/zfs_fletcher_aarch64_neon.c:196:2: error: couldn't allocate input reg for constraint '{v1}'
NEON_FINI_LOOP();
^
fs/zfs/zcommon/zfs_fletcher_aarch64_neon.c:112:6: note: expanded from macro 'NEON_FINI_LOOP'
asm("st1 { %[ACC0].4s },%[DST0]\n"
^
6 errors generated.
make[3]: *** [scripts/Makefile.build:288: fs/zfs/zcommon/zfs_fletcher_aarch64_neon.o] Error 1
make[2]: *** [scripts/Makefile.build:550: fs/zfs/zcommon] Error 2
make[1]: *** [scripts/Makefile.build:550: fs/zfs] Error 2
make[1]: *** Waiting for unfinished jobs....


Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: BuildingIndicates an issue related to building binariesType: DefectIncorrect behavior (e.g. crash, hang)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions