Skip to content

Conversation

@intelfx
Copy link
Contributor

@intelfx intelfx commented Jan 28, 2025

Motivation and Context

  • general cleanup of build system, improves correctness of status messages

Description

  • config: cleanup KERNEL_CC checks, fix broken status output
  • config: add and use KERNEL_CC check for -Wno-format-zero-length

How Has This Been Tested?

  • build-tested on x86_64

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Library ABI change (libzfs, libzfs_core, libnvpair, libuutil and libzfsbootenv)
  • Documentation (a change to man pages or other documentation)

Checklist:

@amotin amotin added the Status: Code Review Needed Ready for review and testing label Jan 28, 2025
@tonyhutter
Copy link
Contributor

Just trying to understand this PR - is the goal here to be able to build the kernel modules with a different compiler than the userspace code? For example, it looks like our current code is already detecting -Wno-format-zero-length:

module/Kbuild.in:7: ZFS_MODULE_CFLAGS += @KERNEL_DEBUG_CFLAGS@  @NO_FORMAT_ZERO_LENGTH@

If $KERNEL_CC was not defined, configure status output would print an
empty string where the kernel compiler should have been. Fix this and
simplify the code generally.

Signed-off-by: Ivan Shapovalov <intelfx@intelfx.name>
Signed-off-by: Ivan Shapovalov <intelfx@intelfx.name>
@intelfx intelfx force-pushed the work/build-cleanup-kernel-cc branch from cc75978 to dd0797f Compare August 23, 2025 18:23
@intelfx
Copy link
Contributor Author

intelfx commented Aug 23, 2025

Just trying to understand this PR - is the goal here to be able to build the kernel modules with a different compiler than the userspace code? For example, it looks like our current code is already detecting -Wno-format-zero-length:

module/Kbuild.in:7: ZFS_MODULE_CFLAGS += @KERNEL_DEBUG_CFLAGS@  @NO_FORMAT_ZERO_LENGTH@

Mostly because I noticed that there are $KERNEL_CC-specific checks for other flags, but not this one — so the original motivation was just a cleanup for consistency. But yes, compiling userspace and kernel parts with different $CC (i.e. $CC != $KERNEL_CC) is one case where this would matter.

Copy link
Contributor

@behlendorf behlendorf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, thanks for noticing this and taking the time to clean it up.

@behlendorf behlendorf added Status: Accepted Ready to integrate (reviewed, tested) and removed Status: Code Review Needed Ready for review and testing labels Aug 25, 2025
behlendorf pushed a commit that referenced this pull request Aug 25, 2025
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ivan Shapovalov <intelfx@intelfx.name>
Closes #16997
spauka pushed a commit to spauka/zfs that referenced this pull request Aug 30, 2025
If $KERNEL_CC was not defined, configure status output would print an
empty string where the kernel compiler should have been. Fix this and
simplify the code generally.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ivan Shapovalov <intelfx@intelfx.name>
Closes openzfs#16997
spauka pushed a commit to spauka/zfs that referenced this pull request Aug 30, 2025
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ivan Shapovalov <intelfx@intelfx.name>
Closes openzfs#16997
behlendorf pushed a commit to behlendorf/zfs that referenced this pull request Sep 10, 2025
If $KERNEL_CC was not defined, configure status output would print an
empty string where the kernel compiler should have been. Fix this and
simplify the code generally.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ivan Shapovalov <intelfx@intelfx.name>
Closes openzfs#16997
behlendorf pushed a commit to behlendorf/zfs that referenced this pull request Sep 10, 2025
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ivan Shapovalov <intelfx@intelfx.name>
Closes openzfs#16997
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Status: Accepted Ready to integrate (reviewed, tested)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants