zfs
zfs copied to clipboard
Unable to compile builtin 2.2.4
System information
| Type | Version/Name |
|---|---|
| Distribution Name | Gentoo |
| Distribution Version | amd64 |
| Kernel Version | 6.6.30 |
| Architecture | x86-64 |
| OpenZFS Version | 2.2.4 |
Describe the problem you're observing
Unable to compile zfs builtin
Describe how to reproduce the problem
./copy-builtin /usr/src/linux
cd /usr/src/linux
make -j10
Include any warning/errors/backtraces from the system logs
vmlinux.o: warning: objtool: luaD_throw() falls through to next function resume_error()
vmlinux.o: warning: objtool: zfs_sha256_transform_x64+0x1d: unsupported stack pointer realignment
vmlinux.o: warning: objtool: zfs_sha256_transform_ssse3+0x1d: unsupported stack pointer realignment
vmlinux.o: warning: objtool: zfs_sha256_transform_avx+0x1d: unsupported stack pointer realignment
vmlinux.o: warning: objtool: zfs_sha256_transform_avx2+0x1c: unsupported stack pointer realignment
vmlinux.o: warning: objtool: zfs_sha512_transform_x64+0x20: unsupported stack pointer realignment
vmlinux.o: warning: objtool: zfs_sha512_transform_avx+0x20: unsupported stack pointer realignment
vmlinux.o: warning: objtool: zfs_sha512_transform_avx2+0x1c: unsupported stack pointer realignment
vmlinux.o: warning: objtool: _aesni_ctr32_ghash_6x+0x57a: return with modified stack frame
vmlinux.o: warning: objtool: _aesni_ctr32_ghash_no_movbe_6x+0x59a: return with modified stack frame
vmlinux.o: warning: objtool: aesni_gcm_decrypt+0x48: unsupported stack pointer realignment
vmlinux.o: warning: objtool: aesni_gcm_encrypt+0x52: unsupported stack pointer realignment
OBJCOPY modules.builtin.modinfo
GEN modules.builtin
GEN .vmlinux.objs
MODPOST Module.symvers
CC .vmlinux.export.o
UPD include/generated/utsversion.h
CC init/version-timestamp.o
LD vmlinux
ld: error: unplaced orphan section `.eh_frame' from `vmlinux.o'
make[2]: *** [scripts/Makefile.vmlinux:37: vmlinux] Error 1
make[1]: *** [/usr/src/linux-6.6.30-gentoo-zfs/Makefile:1165: vmlinux] Error 2
make: *** [Makefile:234: __sub-make] Error 2
I've seen others having similar issues, but they were using clang, but this is with gcc
CONFIG_CC_IS_GCC=y
Same, Gentoo + GCC 13.3.1 20240614 + ZFS 2.2.3 + Kernel 6.6.38, make defconfig plus CONFIG_ZFS=y
To pile on a bit, seems like one of the aforementioned issues is #15458.
That said, on GCC14 and LLVM18 (using the blake3 removal patch) i am able to compile and run ZFS with both RAP and kCFI respectively.
I have run into this issue with GCC 14.1.1, kernel 6.10.5, ZFS 2.2.6.
CC fs/zfs/zfs/vdev_raidz_math_ssse3.o
AR fs/zfs/built-in.a
AR fs/built-in.a
AR built-in.a
AR vmlinux.a
LD vmlinux.o
vmlinux.o: warning: objtool: zfs_sha256_transform_x64+0x1d: unsupported stack pointer realignment
vmlinux.o: warning: objtool: zfs_sha256_transform_ssse3+0x1d: unsupported stack pointer realignment
vmlinux.o: warning: objtool: zfs_sha256_transform_avx+0x1d: unsupported stack pointer realignment
vmlinux.o: warning: objtool: zfs_sha256_transform_avx2+0x1c: unsupported stack pointer realignment
vmlinux.o: warning: objtool: zfs_sha512_transform_x64+0x20: unsupported stack pointer realignment
vmlinux.o: warning: objtool: zfs_sha512_transform_avx+0x20: unsupported stack pointer realignment
vmlinux.o: warning: objtool: zfs_sha512_transform_avx2+0x1c: unsupported stack pointer realignment
vmlinux.o: warning: objtool: _aesni_ctr32_ghash_6x+0x57a: return with modified stack frame
vmlinux.o: warning: objtool: _aesni_ctr32_ghash_no_movbe_6x+0x59a: return with modified stack frame
vmlinux.o: warning: objtool: aesni_gcm_decrypt+0x48: unsupported stack pointer realignment
vmlinux.o: warning: objtool: aesni_gcm_encrypt+0x52: unsupported stack pointer realignment
OBJCOPY modules.builtin.modinfo
GEN modules.builtin
MODPOST vmlinux.symvers
UPD include/generated/utsversion.h
CC init/version-timestamp.o
LD .tmp_vmlinux.kallsyms1
ld: error: unplaced orphan section `.eh_frame' from `vmlinux.o'
I'm seeing unplaced orphan section as well, zfs 2.2.5 on kernel 6.6.47 & gcc 13.3.1
naz /usr/src/linux # make
CALL scripts/checksyscalls.sh
DESCEND objtool
make[4]: 'install_headers' is up to date.
UPD include/generated/utsversion.h
CC init/version-timestamp.o
LD .tmp_vmlinux.kallsyms1
ld: error: unplaced orphan section `.eh_frame' from `fs/zfs/icp/asm-x86_64/sha2/sha256-x86_64.o'
ld: error: unplaced orphan section `.eh_frame' from `fs/zfs/icp/asm-x86_64/sha2/sha512-x86_64.o'
ld: error: unplaced orphan section `.eh_frame' from `fs/zfs/icp/asm-x86_64/modes/aesni-gcm-x86_64.o'
ld: error: unplaced orphan section `.eh_frame' from `fs/zfs/icp/asm-x86_64/modes/ghash-x86_64.o'
make[2]: *** [scripts/Makefile.vmlinux:37: vmlinux] Error 1
make[1]: *** [/usr/src/linux-6.6.47-gentoo/Makefile:1164: vmlinux] Error 2
make: *** [Makefile:234: __sub-make] Error 2
naz /usr/src/linux #
I don't doubt this solution is not the best, but I modified my /usr/src/linux/include/asm-generic/vmlinux.lds.h file as:
#define NOTES \
/DISCARD/ : { \
*(.note.GNU-stack) \
+ *(.eh_frame) \
*(.note.gnu.property) \
} \
and the kernel now builds with the zfs driver built-in.
Do the crypto tests pass with that change @dylandn?
How would I go about to verify this? As of now, my system boots, no error messages seen, my zpool is up (although currently degraded because the drive letters changed)
Updating to zfs-2.2.7 on kernel 6.12.4, still the same issue (and fix)
To build AlmaLinux 9 kernel 5.14.0-503.16.1 with openzfs-2.2.7 built-in I used this patch:
diff '--color=auto' -uNrp linux-5.14.0-503.16.1.zfs.el9.x86_64.orig/include/asm-generic/vmlinux.lds.h linux-5.14.0-503.16.1.zfs.el9.x86_64/include/asm-generic/vmlinux.lds.h
--- linux-5.14.0-503.16.1.zfs.el9.x86_64.orig/include/asm-generic/vmlinux.lds.h 2024-12-23 09:01:29.532629778 +0200
+++ linux-5.14.0-503.16.1.zfs.el9.x86_64/include/asm-generic/vmlinux.lds.h 2024-12-23 09:03:06.420975500 +0200
@@ -995,6 +995,7 @@
*(.modinfo) \
/* ld.bfd warns about .gnu.version* even when not emitted */ \
*(.gnu.version*) \
+ *(.eh_frame)
#define DISCARDS \
/DISCARD/ : { \