Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2.1.9] Fails to compile with GCC-13 for AARCH64 #14624

Open
kraj opened this issue Mar 14, 2023 · 21 comments
Open

[2.1.9] Fails to compile with GCC-13 for AARCH64 #14624

kraj opened this issue Mar 14, 2023 · 21 comments
Assignees
Labels
Type: Architecture Indicates an issue is specific to a single processor architecture Type: Defect Incorrect behavior (e.g. crash, hang)

Comments

@kraj
Copy link

kraj commented Mar 14, 2023

System information

Type Version/Name
Distribution Name Yocto
Distribution Version 4.2/master
Kernel Version 5.15.60
Architecture Arm64
OpenZFS Version 2.1.9

Describe the problem you're observing

while exact sources build fine with gcc-12.
Compiling with gcc-13 ends up with following errors

/mnt/b/yoe/master/build/tmp/work/imx8qm_var_som-yoe-linux/zfs/2.1.9-r0/build/../zfs-2.1.9/module/zfs/vdev_raidz_math_aarch64_neon_common.h:549:24: error: the register specified for 'w7' is not general enough to be used as a register variable
  549 | register unsigned char w7 asm("v7") __attribute__((vector_size(16)));
      |                        ^~
/mnt/b/yoe/master/build/tmp/work/imx8qm_var_som-yoe-linux/zfs/2.1.9-r0/build/../zfs-2.1.9/module/zfs/vdev_raidz_math_aarch64_neonx2.c:193:9: note: in expansion of macro 'GEN_X_DEFINE_6_7'
  193 |         GEN_X_DEFINE_6_7()      \
      |         ^~~~~~~~~~~~~~~~
/mnt/b/yoe/master/build/tmp/work/imx8qm_var_som-yoe-linux/zfs/2.1.9-r0/build/../zfs-2.1.9/module/zfs/vdev_raidz_math_impl.h:1360:9: note: in expansion of macro 'REC_PQR_DEFINE'
 1360 |         REC_PQR_DEFINE();
      |         ^~~~~~~~~~~~~~
/mnt/b/yoe/master/build/tmp/work/imx8qm_var_som-yoe-linux/zfs/2.1.9-r0/build/../zfs-2.1.9/module/zfs/vdev_raidz_math_aarch64_neon_common.h:551:24: error: the register specified for 'w8' is not general enough to be used as a register variable
  551 | register unsigned char w8 asm("v8") __attribute__((vector_size(16)));   \
      |                        ^~
/mnt/b/yoe/master/build/tmp/work/imx8qm_var_som-yoe-linux/zfs/2.1.9-r0/build/../zfs-2.1.9/module/zfs/vdev_raidz_math_aarch64_neonx2.c:194:9: note: in expansion of macro 'GEN_X_DEFINE_8_9'
  194 |         GEN_X_DEFINE_8_9()      \
      |         ^~~~~~~~~~~~~~~~
/mnt/b/yoe/master/build/tmp/work/imx8qm_var_som-yoe-linux/zfs/2.1.9-r0/build/../zfs-2.1.9/module/zfs/vdev_raidz_math_impl.h:1360:9: note: in expansion of macro 'REC_PQR_DEFINE'
 1360 |         REC_PQR_DEFINE();
      |         ^~~~~~~~~~~~~~
/mnt/b/yoe/master/build/tmp/work/imx8qm_var_som-yoe-linux/zfs/2.1.9-r0/build/../zfs-2.1.9/module/zfs/vdev_raidz_math_aarch64_neon_common.h:552:24: error: the register specified for 'w9' is not general enough to be used as a register variable
  552 | register unsigned char w9 asm("v9") __attribute__((vector_size(16)));
      |                        ^~
/mnt/b/yoe/master/build/tmp/work/imx8qm_var_som-yoe-linux/zfs/2.1.9-r0/build/../zfs-2.1.9/module/zfs/vdev_raidz_math_aarch64_neonx2.c:194:9: note: in expansion of macro 'GEN_X_DEFINE_8_9'
  194 |         GEN_X_DEFINE_8_9()      \
      |         ^~~~~~~~~~~~~~~~
/mnt/b/yoe/master/build/tmp/work/imx8qm_var_som-yoe-linux/zfs/2.1.9-r0/build/../zfs-2.1.9/module/zfs/vdev_raidz_math_impl.h:1360:9: note: in expansion of macro 'REC_PQR_DEFINE'
 1360 |         REC_PQR_DEFINE();
      |         ^~~~~~~~~~~~~~
make[5]: *** [/mnt/b/yoe/master/build/tmp/work-shared/imx8qm-var-som/kernel-source/scripts/Makefile.build:289: /mnt/b/yoe/master/build/tmp/work/imx8qm_var_som-yoe-linux/zfs/2.1.9-r0/build/module/zfs/vdev_raidz_math_aarch64_neon.o] Error 1

Describe how to reproduce the problem

Use any distribution for aarch64 and use gcc-13 to compile zfs.

Include any warning/errors/backtraces from the system logs

error log

/mnt/b/yoe/master/build/tmp/work/imx8qm_var_som-yoe-linux/zfs/2.1.9-r0/build/../zfs-2.1.9/module/zfs/vdev_raidz_math_aarch64_neon_common.h:549:24: error: the register specified for 'w7' is not general enough to be used as a register variable
  549 | register unsigned char w7 asm("v7") __attribute__((vector_size(16)));
      |                        ^~
/mnt/b/yoe/master/build/tmp/work/imx8qm_var_som-yoe-linux/zfs/2.1.9-r0/build/../zfs-2.1.9/module/zfs/vdev_raidz_math_aarch64_neonx2.c:193:9: note: in expansion of macro 'GEN_X_DEFINE_6_7'
  193 |         GEN_X_DEFINE_6_7()      \
      |         ^~~~~~~~~~~~~~~~
/mnt/b/yoe/master/build/tmp/work/imx8qm_var_som-yoe-linux/zfs/2.1.9-r0/build/../zfs-2.1.9/module/zfs/vdev_raidz_math_impl.h:1360:9: note: in expansion of macro 'REC_PQR_DEFINE'
 1360 |         REC_PQR_DEFINE();
      |         ^~~~~~~~~~~~~~
/mnt/b/yoe/master/build/tmp/work/imx8qm_var_som-yoe-linux/zfs/2.1.9-r0/build/../zfs-2.1.9/module/zfs/vdev_raidz_math_aarch64_neon_common.h:551:24: error: the register specified for 'w8' is not general enough to be used as a register variable
  551 | register unsigned char w8 asm("v8") __attribute__((vector_size(16)));   \
      |                        ^~
/mnt/b/yoe/master/build/tmp/work/imx8qm_var_som-yoe-linux/zfs/2.1.9-r0/build/../zfs-2.1.9/module/zfs/vdev_raidz_math_aarch64_neonx2.c:194:9: note: in expansion of macro 'GEN_X_DEFINE_8_9'
  194 |         GEN_X_DEFINE_8_9()      \
      |         ^~~~~~~~~~~~~~~~
/mnt/b/yoe/master/build/tmp/work/imx8qm_var_som-yoe-linux/zfs/2.1.9-r0/build/../zfs-2.1.9/module/zfs/vdev_raidz_math_impl.h:1360:9: note: in expansion of macro 'REC_PQR_DEFINE'
 1360 |         REC_PQR_DEFINE();
      |         ^~~~~~~~~~~~~~
/mnt/b/yoe/master/build/tmp/work/imx8qm_var_som-yoe-linux/zfs/2.1.9-r0/build/../zfs-2.1.9/module/zfs/vdev_raidz_math_aarch64_neon_common.h:552:24: error: the register specified for 'w9' is not general enough to be used as a register variable
  552 | register unsigned char w9 asm("v9") __attribute__((vector_size(16)));
      |                        ^~
/mnt/b/yoe/master/build/tmp/work/imx8qm_var_som-yoe-linux/zfs/2.1.9-r0/build/../zfs-2.1.9/module/zfs/vdev_raidz_math_aarch64_neonx2.c:194:9: note: in expansion of macro 'GEN_X_DEFINE_8_9'
  194 |         GEN_X_DEFINE_8_9()      \
      |         ^~~~~~~~~~~~~~~~
/mnt/b/yoe/master/build/tmp/work/imx8qm_var_som-yoe-linux/zfs/2.1.9-r0/build/../zfs-2.1.9/module/zfs/vdev_raidz_math_impl.h:1360:9: note: in expansion of macro 'REC_PQR_DEFINE'
 1360 |         REC_PQR_DEFINE();
      |         ^~~~~~~~~~~~~~
make[5]: *** [/mnt/b/yoe/master/build/tmp/work-shared/imx8qm-var-som/kernel-source/scripts/Makefile.build:289: /mnt/b/yoe/master/build/tmp/work/imx8qm_var_som-yoe-linux/zfs/2.1.9-r0/build/module/zfs/vdev_raidz_math_aarch64_neon.o] Error 1

@kraj kraj added the Type: Defect Incorrect behavior (e.g. crash, hang) label Mar 14, 2023
@kraj
Copy link
Author

kraj commented Mar 14, 2023

btw master branch seems to build/compile ok

@behlendorf behlendorf added the Type: Architecture Indicates an issue is specific to a single processor architecture label Mar 14, 2023
@mcmilk mcmilk mentioned this issue Apr 10, 2023
13 tasks
@matoro
Copy link

matoro commented May 2, 2023

This also affects 2.1.11.

@BrainSlayer
Copy link
Contributor

btw master branch seems to build/compile ok

i can reproduce the issue. but the same bug exists on master branch. no change so far. still not working

@Kokokokoka
Copy link

can confirm this issue on gcc-13 zfs-2.1.11 and clang-16.
both compilers are failing in the same spot.
issue #13260 seems to be related.
master fails on zfs-tests/cmd/readmap.c
unknown type name uint_t

@ryao ryao self-assigned this May 16, 2023
@BrainSlayer
Copy link
Contributor

BrainSlayer commented May 23, 2023

this fix here is working for me. is someone able to test it?

`--- Kbuild.in (revision 52656)
+++ Kbuild.in (working copy)
@@ -43,9 +43,9 @@
ccflags-y := $(ZFS_MODULE_CFLAGS) $(ZFS_MODULE_CPPFLAGS)

ifeq ($(CONFIG_ARM64),y)
-CFLAGS_REMOVE_zcommon/zfs_fletcher_aarch64_neon.o += -mgeneral-regs-only
-CFLAGS_REMOVE_zfs/vdev_raidz_math_aarch64_neon.o += -mgeneral-regs-only
-CFLAGS_REMOVE_zfs/vdev_raidz_math_aarch64_neonx2.o += -mgeneral-regs-only
+CFLAGS_REMOVE_zfs_fletcher_aarch64_neon.o = -mgeneral-regs-only
+CFLAGS_REMOVE_vdev_raidz_math_aarch64_neon.o = -mgeneral-regs-only
+CFLAGS_REMOVE_vdev_raidz_math_aarch64_neonx2.o = -mgeneral-regs-only
endif
`

see also git commit in my repo BrainSlayer@aaf28a4

@BrainSlayer
Copy link
Contributor

ping @kraj @ryao @Kokokokoka @matoro

@kraj
Copy link
Author

kraj commented May 24, 2023

it still fails for me. see https://snips.sh/f/YE-061orqo

@BrainSlayer
Copy link
Contributor

@kraj are you sure that you reconfigured your tree? this patch needs that you run ./configure again before compiling.

@kraj
Copy link
Author

kraj commented May 25, 2023

@kraj are you sure that you reconfigured your tree? this patch needs that you run ./configure again before compiling.

yes in yocto we automatically reconfigure packages i.e. run autoreconf

@ryao
Copy link
Contributor

ryao commented May 25, 2023

this fix here is working for me. is someone able to test it?

`--- Kbuild.in (revision 52656) +++ Kbuild.in (working copy) @@ -43,9 +43,9 @@ ccflags-y := (ZFSMODULECFLAGS)(ZFS_MODULE_CPPFLAGS)

ifeq ($(CONFIG_ARM64),y) -CFLAGS_REMOVE_zcommon/zfs_fletcher_aarch64_neon.o += -mgeneral-regs-only -CFLAGS_REMOVE_zfs/vdev_raidz_math_aarch64_neon.o += -mgeneral-regs-only -CFLAGS_REMOVE_zfs/vdev_raidz_math_aarch64_neonx2.o += -mgeneral-regs-only +CFLAGS_REMOVE_zfs_fletcher_aarch64_neon.o = -mgeneral-regs-only +CFLAGS_REMOVE_vdev_raidz_math_aarch64_neon.o = -mgeneral-regs-only +CFLAGS_REMOVE_vdev_raidz_math_aarch64_neonx2.o = -mgeneral-regs-only endif `

see also git commit in my repo BrainSlayer@aaf28a4

This is on my shortlist of things to do, although I don't have my aarch64 hardware setup for testing this right now (it is a RPi3 with an ancient Gentoo install that will take a long time to update). I will check this in an aarch64 cloud VM this week.

@BrainSlayer
Copy link
Contributor

BrainSlayer commented May 25, 2023

@kraj autoreconf does not run ./configure. it just recreates the configure file and Makefile.in files

@BrainSlayer
Copy link
Contributor

this fix here is working for me. is someone able to test it?
--- Kbuild.in (revision 52656) +++ Kbuild.in (working copy) @@ -43,9 +43,9 @@ ccflags-y := (ZFSMODULECFLAGS)(ZFS_MODULE_CPPFLAGS) ifeq ($(CONFIG_ARM64),y) -CFLAGS_REMOVE_zcommon/zfs_fletcher_aarch64_neon.o += -mgeneral-regs-only -CFLAGS_REMOVE_zfs/vdev_raidz_math_aarch64_neon.o += -mgeneral-regs-only -CFLAGS_REMOVE_zfs/vdev_raidz_math_aarch64_neonx2.o += -mgeneral-regs-only +CFLAGS_REMOVE_zfs_fletcher_aarch64_neon.o = -mgeneral-regs-only +CFLAGS_REMOVE_vdev_raidz_math_aarch64_neon.o = -mgeneral-regs-only +CFLAGS_REMOVE_vdev_raidz_math_aarch64_neonx2.o = -mgeneral-regs-only endif
see also git commit in my repo BrainSlayer@aaf28a4

This is on my shortlist of things to do, although I don't have my aarch64 hardware setup for testing this right now (it is a RPi3 with an ancient Gentoo install that will take a long time to update). I will check this in an aarch64 cloud VM this week.

i tested it using a cross compiler in my project. no device was involved (i'm working mainly on embedded systems)

@kraj
Copy link
Author

kraj commented May 25, 2023

@kraj autoreconf does not run ./configure. it just recreates the configure file and Makefile.in files

ofcourse, we run configure after regenerating it in do_configure task and then run resulting makefiles using make in do_compile, the link I have pasted is output of do_compile task alone. If you are interested in seeing do_configure logs, I can upload them too

@BrainSlayer
Copy link
Contributor

@kraj autoreconf does not run ./configure. it just recreates the configure file and Makefile.in files

ofcourse, we run configure after regenerating it in do_configure task and then run resulting makefiles using make in do_compile, the link I have pasted is output of do_compile task alone. If you are interested in seeing do_configure logs, I can upload them too

i have reviewed your pasted output. but the configure was missing. i just saw autoconf / aclocal

@BrainSlayer
Copy link
Contributor

btw. you can also just checkout my tree from my repo (not for productional use, it has a newer zstd version and has patches for musl). might be easier since it worked from scratch for me

@coot
Copy link

coot commented May 28, 2023

For me zfs-2.1.11 fails to compile with gcc-13.1.1 with on aarch64 (on fedora-38):

/root/src/zfs-2.1.11/module/zcommon/zfs_fletcher_aarch64_neon.c: In function ‘fletcher_4_aarch64_neon_byteswa ’:
/root/src/zfs-2.1.11/module/zcommon/zfs_fletcher_aarch64_neon.c:167:24: error: the register specified for ‘ZERO’ is not general enough to be used as a register variable
  167 | register unsigned char ZERO asm("v0") __attribute__((vector_size(16)));
      |                        ^~~~
/root/src/zfs-2.1.11/module/zcommon/zfs_fletcher_aarch64_neon.c:168:24: error: the register specified for ‘ACC0’ is not general enough to be used as a register variable
  168 | register unsigned char ACC0 asm("v1") __attribute__((vector_size(16)));
      |                        ^~~~
/root/src/zfs-2.1.11/module/zcommon/zfs_fletcher_aarch64_neon.c:169:24: error: the register specified for ‘ACC1’ is not general enough to be used as a register variable
  169 | register unsigned char ACC1 asm("v2") __attribute__((vector_size(16)));
      |                        ^~~~
/root/src/zfs-2.1.11/module/zcommon/zfs_fletcher_aarch64_neon.c:170:24: error: the register specified for ‘ACC2’ is not general enough to be used as a register variable
  170 | register unsigned char ACC2 asm("v3") __attribute__((vector_size(16)));
      |                        ^~~~
/root/src/zfs-2.1.11/module/zcommon/zfs_fletcher_aarch64_neon.c:171:24: error: the register specified for ‘ACC3’ is not general enough to be used as a register variable
  171 | register unsigned char ACC3 asm("v4") __attribute__((vector_size(16)));
      |                        ^~~~
/root/src/zfs-2.1.11/module/zcommon/zfs_fletcher_aarch64_neon.c:172:24: error: the register specified for ‘TMP1’ is not general enough to be used as a register variable
  172 | register unsigned char TMP1 asm("v5") __attribute__((vector_size(16)));
      |                        ^~~~
/root/src/zfs-2.1.11/module/zcommon/zfs_fletcher_aarch64_neon.c:173:24: error: the register specified for ‘TMP2’ is not general enough to be used as a register variable
  173 | register unsigned char TMP2 asm("v6") __attribute__((vector_size(16)));
      |                        ^~~~
/root/src/zfs-2.1.11/module/zcommon/zfs_fletcher_aarch64_neon.c:174:24: error: the register specified for ‘SR ’ is not general enough to be used as a register variable
  174 | register unsigned char SRC asm("v7") __attribute__((vector_size(16)));
      |                        ^~~
/root/src/zfs-2.1.11/module/zcommon/zfs_fletcher_aarch64_neon.c: In function ‘fletcher_4_aarch64_neon_native’:
/root/src/zfs-2.1.11/module/zcommon/zfs_fletcher_aarch64_neon.c:128:24: error: the register specified for ‘ZERO’ is not general enough to be used as a register variable
  128 | register unsigned char ZERO asm("v0") __attribute__((vector_size(16)));
      |                        ^~~~
/root/src/zfs-2.1.11/module/zcommon/zfs_fletcher_aarch64_neon.c:129:24: error: the register specified for ‘ACC0’ is not general enough to be used as a register variable
  129 | register unsigned char ACC0 asm("v1") __attribute__((vector_size(16)));
      |                        ^~~~
/root/src/zfs-2.1.11/module/zcommon/zfs_fletcher_aarch64_neon.c:130:24: error: the register specified for ‘ACC1’ is not general enough to be used as a register variable
  130 | register unsigned char ACC1 asm("v2") __attribute__((vector_size(16)));
      |                        ^~~~
/root/src/zfs-2.1.11/module/zcommon/zfs_fletcher_aarch64_neon.c:131:24: error: the register specified for ‘ACC2’ is not general enough to be used as a register variable
  131 | register unsigned char ACC2 asm("v3") __attribute__((vector_size(16)));
      |                        ^~~~
/root/src/zfs-2.1.11/module/zcommon/zfs_fletcher_aarch64_neon.c:132:24: error: the register specified for ‘ACC3’ is not general enough to be used as a register variable
  132 | register unsigned char ACC3 asm("v4") __attribute__((vector_size(16)));
      |                        ^~~~
/root/src/zfs-2.1.11/module/zcommon/zfs_fletcher_aarch64_neon.c:133:24: error: the register specified for ‘TMP1’ is not general enough to be used as a register variable
  133 | register unsigned char TMP1 asm("v5") __attribute__((vector_size(16)));
      |                        ^~~~
/root/src/zfs-2.1.11/module/zcommon/zfs_fletcher_aarch64_neon.c:134:24: error: the register specified for ‘TMP2’ is not general enough to be used as a register variable
  134 | register unsigned char TMP2 asm("v6") __attribute__((vector_size(16)));
      |                        ^~~~
/root/src/zfs-2.1.11/module/zcommon/zfs_fletcher_aarch64_neon.c:135:24: error: the register specified for ‘SR ’ is not general enough to be used as a register variable
  135 | register unsigned char SRC asm("v7") __attribute__((vector_size(16)));

@kraj
Copy link
Author

kraj commented May 28, 2023

I am building master branch and this patch works for me

https://snips.sh/f/MOfaljF07A

@BrainSlayer
Copy link
Contributor

I am building master branch and this patch works for me

https://snips.sh/f/MOfaljF07A

the patch was made for master and for nothing else. btw. your log shows it failed. so what do you want to tell me here

@BrainSlayer
Copy link
Contributor

For me zfs-2.1.11 fails to compile with gcc-13.1.1 with on aarch64 (on fedora-38):

/root/src/zfs-2.1.11/module/zcommon/zfs_fletcher_aarch64_neon.c: In function ‘fletcher_4_aarch64_neon_byteswa ’:
/root/src/zfs-2.1.11/module/zcommon/zfs_fletcher_aarch64_neon.c:167:24: error: the register specified for ‘ZERO’ is not general enough to be used as a register variable
  167 | register unsigned char ZERO asm("v0") __attribute__((vector_size(16)));
      |                        ^~~~
/root/src/zfs-2.1.11/module/zcommon/zfs_fletcher_aarch64_neon.c:168:24: error: the register specified for ‘ACC0’ is not general enough to be used as a register variable
  168 | register unsigned char ACC0 asm("v1") __attribute__((vector_size(16)));
      |                        ^~~~
/root/src/zfs-2.1.11/module/zcommon/zfs_fletcher_aarch64_neon.c:169:24: error: the register specified for ‘ACC1’ is not general enough to be used as a register variable
  169 | register unsigned char ACC1 asm("v2") __attribute__((vector_size(16)));
      |                        ^~~~
/root/src/zfs-2.1.11/module/zcommon/zfs_fletcher_aarch64_neon.c:170:24: error: the register specified for ‘ACC2’ is not general enough to be used as a register variable
  170 | register unsigned char ACC2 asm("v3") __attribute__((vector_size(16)));
      |                        ^~~~
/root/src/zfs-2.1.11/module/zcommon/zfs_fletcher_aarch64_neon.c:171:24: error: the register specified for ‘ACC3’ is not general enough to be used as a register variable
  171 | register unsigned char ACC3 asm("v4") __attribute__((vector_size(16)));
      |                        ^~~~
/root/src/zfs-2.1.11/module/zcommon/zfs_fletcher_aarch64_neon.c:172:24: error: the register specified for ‘TMP1’ is not general enough to be used as a register variable
  172 | register unsigned char TMP1 asm("v5") __attribute__((vector_size(16)));
      |                        ^~~~
/root/src/zfs-2.1.11/module/zcommon/zfs_fletcher_aarch64_neon.c:173:24: error: the register specified for ‘TMP2’ is not general enough to be used as a register variable
  173 | register unsigned char TMP2 asm("v6") __attribute__((vector_size(16)));
      |                        ^~~~
/root/src/zfs-2.1.11/module/zcommon/zfs_fletcher_aarch64_neon.c:174:24: error: the register specified for ‘SR ’ is not general enough to be used as a register variable
  174 | register unsigned char SRC asm("v7") __attribute__((vector_size(16)));
      |                        ^~~
/root/src/zfs-2.1.11/module/zcommon/zfs_fletcher_aarch64_neon.c: In function ‘fletcher_4_aarch64_neon_native’:
/root/src/zfs-2.1.11/module/zcommon/zfs_fletcher_aarch64_neon.c:128:24: error: the register specified for ‘ZERO’ is not general enough to be used as a register variable
  128 | register unsigned char ZERO asm("v0") __attribute__((vector_size(16)));
      |                        ^~~~
/root/src/zfs-2.1.11/module/zcommon/zfs_fletcher_aarch64_neon.c:129:24: error: the register specified for ‘ACC0’ is not general enough to be used as a register variable
  129 | register unsigned char ACC0 asm("v1") __attribute__((vector_size(16)));
      |                        ^~~~
/root/src/zfs-2.1.11/module/zcommon/zfs_fletcher_aarch64_neon.c:130:24: error: the register specified for ‘ACC1’ is not general enough to be used as a register variable
  130 | register unsigned char ACC1 asm("v2") __attribute__((vector_size(16)));
      |                        ^~~~
/root/src/zfs-2.1.11/module/zcommon/zfs_fletcher_aarch64_neon.c:131:24: error: the register specified for ‘ACC2’ is not general enough to be used as a register variable
  131 | register unsigned char ACC2 asm("v3") __attribute__((vector_size(16)));
      |                        ^~~~
/root/src/zfs-2.1.11/module/zcommon/zfs_fletcher_aarch64_neon.c:132:24: error: the register specified for ‘ACC3’ is not general enough to be used as a register variable
  132 | register unsigned char ACC3 asm("v4") __attribute__((vector_size(16)));
      |                        ^~~~
/root/src/zfs-2.1.11/module/zcommon/zfs_fletcher_aarch64_neon.c:133:24: error: the register specified for ‘TMP1’ is not general enough to be used as a register variable
  133 | register unsigned char TMP1 asm("v5") __attribute__((vector_size(16)));
      |                        ^~~~
/root/src/zfs-2.1.11/module/zcommon/zfs_fletcher_aarch64_neon.c:134:24: error: the register specified for ‘TMP2’ is not general enough to be used as a register variable
  134 | register unsigned char TMP2 asm("v6") __attribute__((vector_size(16)));
      |                        ^~~~
/root/src/zfs-2.1.11/module/zcommon/zfs_fletcher_aarch64_neon.c:135:24: error: the register specified for ‘SR ’ is not general enough to be used as a register variable
  135 | register unsigned char SRC asm("v7") __attribute__((vector_size(16)));

check master. this patch was made on top of the master branch and not a release version

@rincebrain
Copy link
Contributor

So, having just tested this, it breaks for me on 2.1.x and not git tip, because git tip already has something like the fix proposed above applied, courtesy of fe97504.

So a cherrypick of that for 2.1.x (which would unfortunately not be clean, since the fragments need to go in different spots in 2.1, but still simple) would do it. A bespoke patch copying just that segment would too, for this one problem.

Fixing that is straightforward, and I'll go open a backport PR shortly once I've tested this a little, but you still run afoul of #14555 on most kernels you might run with gcc 13. In 5.15, not so much, unless they backported it out of spite, but just to mention for anyone else who runs into this thread and wants to report that it still won't build because of GPL-only symbol kernel_neon_begin/kernel_neon_end, that's a different bug.

rincebrain pushed a commit to rincebrain/zfs that referenced this issue Jun 1, 2023
- Clang 15 doesn't support `-fno-ipa-sra` anymore. Do a separate
  check for `-fno-ipa-sra` support by $KERNEL_CC.

- Don't enable `-mgeneral-regs-only` for certain module files.
  Fix openzfs#13260

- Scope `GCC diagnostic ignored` statements to GCC only. Clang
  doesn't need them to compile the code.

Porting notes:
- Moved the stanzas removing -mgeneral-regs-only to Makefile.in
  since they wouldn't readily work in Kbuild.in and that did.

Reviewed-by: Richard Yao <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: szubersk <[email protected]>
Closes openzfs#13260
Closes openzfs#14150

Closes openzfs#14624
Ported-by: Rich Ercolani <[email protected]
Signed-off-by: Rich Ercolani <[email protected]>
rincebrain pushed a commit to rincebrain/zfs that referenced this issue Jun 1, 2023
- Clang 15 doesn't support `-fno-ipa-sra` anymore. Do a separate
  check for `-fno-ipa-sra` support by $KERNEL_CC.

- Don't enable `-mgeneral-regs-only` for certain module files.
  Fix openzfs#13260

- Scope `GCC diagnostic ignored` statements to GCC only. Clang
  doesn't need them to compile the code.

Porting notes:
- Moved the stanzas removing -mgeneral-regs-only to Makefile.in
  since they wouldn't readily work in Kbuild.in and that did.

Reviewed-by: Richard Yao <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: szubersk <[email protected]>
Closes openzfs#13260
Closes openzfs#14150

Closes openzfs#14624
Ported-by: Rich Ercolani <[email protected]
Signed-off-by: Rich Ercolani <[email protected]>
algitbot pushed a commit to alpinelinux/aports that referenced this issue Jun 5, 2023
behlendorf pushed a commit that referenced this issue Jun 5, 2023
- Clang 15 doesn't support `-fno-ipa-sra` anymore. Do a separate
  check for `-fno-ipa-sra` support by $KERNEL_CC.

- Don't enable `-mgeneral-regs-only` for certain module files.
  Fix #13260

- Scope `GCC diagnostic ignored` statements to GCC only. Clang
  doesn't need them to compile the code.

Porting notes:
- Moved the stanzas removing -mgeneral-regs-only to Makefile.in
  since they wouldn't readily work in Kbuild.in and that did.

Reviewed-by: Richard Yao <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: szubersk <[email protected]>
Closes #13260
Closes #14150

Closes #14624
Ported-by: Rich Ercolani <[email protected]
Signed-off-by: Rich Ercolani <[email protected]>
tonyhutter pushed a commit to tonyhutter/zfs that referenced this issue Jun 6, 2023
- Clang 15 doesn't support `-fno-ipa-sra` anymore. Do a separate
  check for `-fno-ipa-sra` support by $KERNEL_CC.

- Don't enable `-mgeneral-regs-only` for certain module files.
  Fix openzfs#13260

- Scope `GCC diagnostic ignored` statements to GCC only. Clang
  doesn't need them to compile the code.

Porting notes:
- Moved the stanzas removing -mgeneral-regs-only to Makefile.in
  since they wouldn't readily work in Kbuild.in and that did.

Reviewed-by: Richard Yao <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: szubersk <[email protected]>
Closes openzfs#13260
Closes openzfs#14150

Closes openzfs#14624
Ported-by: Rich Ercolani <[email protected]
Signed-off-by: Rich Ercolani <[email protected]>
@tonyhutter
Copy link
Contributor

FYI - the zfs-2.1.12 PR (#14942) contains fe97504

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Architecture Indicates an issue is specific to a single processor architecture Type: Defect Incorrect behavior (e.g. crash, hang)
Projects
None yet
Development

No branches or pull requests

9 participants