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

Support for cross-compiling kernel modules #16924

Merged
merged 1 commit into from
Jan 6, 2025
Merged

Conversation

n0-1
Copy link
Contributor

@n0-1 n0-1 commented Jan 3, 2025

In order to correctly cross-compile, one has to pass ARCH and CROSS_COMPILE
make flags to kernel module build calls. Facilitate this in the same way as for
custom CC flag by recognizing KERNEL_-prefixed configure environment variables
of same name.

Motivation and Context

Compiling ZFS modules in a buildroot-like environment seems not possible without this.

Description

See above.

How Has This Been Tested?

Successfully compiled for 32bit ARM in OpenADK.

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:

@behlendorf behlendorf added the Status: Code Review Needed Ready for review and testing label Jan 3, 2025
In order to correctly cross-compile, one has to pass ARCH and
CROSS_COMPILE make flags to kernel module build calls. Facilitate this
in the same way as for custom CC flag by recognizing KERNEL_-prefixed
configure environment variables of same name.

Signed-off-by: Phil Sutter <[email protected]>
@behlendorf behlendorf added Status: Accepted Ready to integrate (reviewed, tested) and removed Status: Code Review Needed Ready for review and testing labels Jan 4, 2025
@behlendorf behlendorf merged commit 18c67d2 into openzfs:master Jan 6, 2025
23 of 25 checks passed
behlendorf pushed a commit to behlendorf/zfs that referenced this pull request Jan 6, 2025
In order to correctly cross-compile, one has to pass ARCH and
CROSS_COMPILE make flags to kernel module build calls. Facilitate this
in the same way as for custom CC flag by recognizing KERNEL_-prefixed
configure environment variables of same name.

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Phil Sutter <[email protected]>
Closes openzfs#16924
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.

2 participants