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

ICP build error with --enable-linux-builtin and separate kernel source and build directories #9988

Closed
nivedita76 opened this issue Feb 12, 2020 · 5 comments · Fixed by #10021
Labels
Type: Building Indicates an issue related to building binaries

Comments

@nivedita76
Copy link
Contributor

System information

Type Version/Name
Distribution Name Gentoo
Distribution Version NA
Linux Kernel 5.5
Architecture x86_64
ZFS Version git
SPL Version NA

Describe the problem you're observing

When building zfs builtin to the kernel, using
configure --with-config=kernel --enable-linux-builtin --with-linux=${KSRC} --with-linux-obj=${KOBJ}
the icp subdirectory fails because it can't find include files.

Describe how to reproduce the problem

Include any warning/errors/backtraces from the system logs

@nivedita76
Copy link
Contributor Author

The error is because module/icp/Makefile.in adds -I options using $(src), and copy-builtin deletes the src/obj definitions from the Makefile. This results in the options being added as -Ifs/zfs/icp/include. This does not work with a separate kernel build directory, as the compiler is run from the build directory.

The attached patch fixes the issue for me.
icp.txt

@nivedita76
Copy link
Contributor Author

Are the src/obj defines needed for a modular build? Or are they always unnecessary in the module/ subdir?

@behlendorf behlendorf added the Type: Building Indicates an issue related to building binaries label Feb 13, 2020
@sempervictus
Copy link
Contributor

There arent buildbots for the in-tree stuff, so breakage in this functionality of usually detected by someone trying to actually do it :). Part of the reason my shop has been staying on modified versions of stable tags is that there's a bunch of OS-related rework going on, which tends to hit the build system - we've found it easier to divine and backport the requirements for some feature/commit to the stable branches than trying to keep up with the OS code churn.
Thanks for the patch.

@behlendorf
Copy link
Contributor

@nivedita76 thanks for the patch. The obj and src defines are needed to support VPATH in the out-of-tree modular builds, but your fix looks like a reasonable way to address the in-kernel issue. Would you mind opening a PR with the proposed change?

The CI does test in-kernel builds but it doesn't happen to cover this case. It would be nice to update the test scripts to provide coverage for this. @nivedita76 would you mind posting the steps you used to hit this issue. For reference, this is the script used by CI to test in-kernel builds.

@nivedita76
Copy link
Contributor Author

Attached script can be used to repro.

test-zfs.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Building Indicates an issue related to building binaries
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants