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

Release build fails with clang10 on Linux 5.6 #10279

Closed
torvic9 opened this issue May 1, 2020 · 1 comment
Closed

Release build fails with clang10 on Linux 5.6 #10279

torvic9 opened this issue May 1, 2020 · 1 comment

Comments

@torvic9
Copy link

torvic9 commented May 1, 2020

System information

Type Version/Name
Distribution Name Manjaro Xfce 'testing'
Distribution Version rolling
Linux Kernel clang-built 5.6.7
Architecture x86_64
ZFS Version 0.8.3 (release)

Describe the problem you're observing

Building with clang10 fails with the errors noted below.
Patches used:
5.5 and 5.6 compat patches mentioned here: #9961 (comment)
clang compat patches mentioned here: #10107

Include any warning/errors/backtraces from the system logs

/tmp/makepkg/linux56-vd-spl_zfs/src/zfs-0.8.3/module/zfs/zfs_vnops.c:3418:23: error: implicit declaration of function 'timespec64_trunc' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
                ZTOI(zp)->i_mtime = zpl_inode_timestamp_truncate(
                                    ^
/tmp/makepkg/linux56-vd-spl_zfs/src/zfs-0.8.3/include/sys/zpl.h:195:2: note: expanded from macro 'zpl_inode_timestamp_truncate'
        timespec64_trunc(ts, (ip)->i_sb->s_time_gran)
        ^
/tmp/makepkg/linux56-vd-spl_zfs/src/zfs-0.8.3/module/zfs/zfs_vnops.c:3418:23: note: did you mean 'timespec64_to_ns'?
/tmp/makepkg/linux56-vd-spl_zfs/src/zfs-0.8.3/include/sys/zpl.h:195:2: note: expanded from macro 'zpl_inode_timestamp_truncate'
        timespec64_trunc(ts, (ip)->i_sb->s_time_gran)
        ^
./include/linux/time64.h:133:19: note: 'timespec64_to_ns' declared here
static inline s64 timespec64_to_ns(const struct timespec64 *ts)
                  ^
/tmp/makepkg/linux56-vd-spl_zfs/src/zfs-0.8.3/module/zfs/zfs_vnops.c:3418:21: error: assigning to 'struct timespec64' from incompatible type 'int'
                ZTOI(zp)->i_mtime = zpl_inode_timestamp_truncate(
                                  ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/makepkg/linux56-vd-spl_zfs/src/zfs-0.8.3/module/zfs/zfs_vnops.c:3427:23: error: implicit declaration of function 'timespec64_trunc' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
                ZTOI(zp)->i_ctime = zpl_inode_timestamp_truncate(vap->va_ctime,
                                    ^
/tmp/makepkg/linux56-vd-spl_zfs/src/zfs-0.8.3/include/sys/zpl.h:195:2: note: expanded from macro 'zpl_inode_timestamp_truncate'
        timespec64_trunc(ts, (ip)->i_sb->s_time_gran)
        ^
/tmp/makepkg/linux56-vd-spl_zfs/src/zfs-0.8.3/module/zfs/zfs_vnops.c:3427:21: error: assigning to 'struct timespec64' from incompatible type 'int'
                ZTOI(zp)->i_ctime = zpl_inode_timestamp_truncate(vap->va_ctime,
                                  ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Let me know if you need more info.

@torvic9
Copy link
Author

torvic9 commented May 1, 2020

Thank you, I confirm that it's compiling correctly now.

@torvic9 torvic9 closed this as completed May 2, 2020
behlendorf pushed a commit that referenced this issue May 4, 2020
Usage of this variable uninitialized triggers -Werror,-Wuninitialized
when compiled under clang for linux kernel 5.6, leading the build system
to believe that the function is not declared.

This commit initializes the variable to suppress the warning and fix the
build for kernel 5.6 with clang.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Hiếu Lê <leorize+oss@disroot.org>
Closes #10279
Closes #10281
as-com pushed a commit to as-com/zfs that referenced this issue Jun 20, 2020
Usage of this variable uninitialized triggers -Werror,-Wuninitialized
when compiled under clang for linux kernel 5.6, leading the build system
to believe that the function is not declared.

This commit initializes the variable to suppress the warning and fix the
build for kernel 5.6 with clang.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Hiếu Lê <leorize+oss@disroot.org>
Closes openzfs#10279
Closes openzfs#10281 
(cherry picked from commit 3e5d41d)
jsai20 pushed a commit to jsai20/zfs that referenced this issue Mar 30, 2021
Usage of this variable uninitialized triggers -Werror,-Wuninitialized
when compiled under clang for linux kernel 5.6, leading the build system
to believe that the function is not declared.

This commit initializes the variable to suppress the warning and fix the
build for kernel 5.6 with clang.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Hiếu Lê <leorize+oss@disroot.org>
Closes openzfs#10279
Closes openzfs#10281
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant