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

kselftests try to build with gcc #374

Closed
nickdesaulniers opened this issue Feb 21, 2019 · 14 comments
Closed

kselftests try to build with gcc #374

nickdesaulniers opened this issue Feb 21, 2019 · 14 comments
Assignees
Labels
[BUG] linux A bug that should be fixed in the mainline kernel. good first issue Good for newcomers hermetic builds has implications for doing gcc/binutils-free builds low priority This bug is not critical and not a priority

Comments

@nickdesaulniers
Copy link
Member

$ ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- make CC=clang HOSTCC=clang -j46 quicktest=1 kselftest
...
make[3]: aarch64-linux-gnu-gcc: Command not found
...
@nickdesaulniers nickdesaulniers added [BUG] linux A bug that should be fixed in the mainline kernel. low priority This bug is not critical and not a priority labels Feb 21, 2019
@nickdesaulniers
Copy link
Member Author

They should be using $(HOSTCC), assuming it was exported correctly from the top level Makefile.

@bulwahn bulwahn added the good first issue Good for newcomers label Apr 13, 2019
@bulwahn
Copy link

bulwahn commented Apr 13, 2019

I plan to give this to my student as a good exercise to touch some build scripts and submit his first kernel patch.

@bulwahn bulwahn self-assigned this Apr 13, 2019
@bulwahn
Copy link

bulwahn commented Apr 27, 2019

To reproduce the issue, we actually do not need the cross-compile setup. It suffices to run make CC=clang HOSTCC=clang kselftest and observe that gcc is used for compiling.

@nickdesaulniers
Copy link
Member Author

In particular, the author of the rseq system call mentioned that their kselftests fail to build because they reset KBUILD_CFLAGS, thus dropping -no-integrated-as. They should be using ${CLANG_FLAGS}.

So as part of this issue, it's not just that the kselftests build with GCC, but also that they may fail to build with Clang (and we should fix that, too).

@nickdesaulniers nickdesaulniers added the hermetic builds has implications for doing gcc/binutils-free builds label Feb 8, 2020
@nickdesaulniers
Copy link
Member Author

cc @gctucker

@gctucker
Copy link

Thanks for the heads, up. We're trying to fix all existing build errors we have in our environment with gcc first, then we'll take a look at building kselftests with clang.

@nathanchance
Copy link
Member

@gctucker
Copy link

@nickdesaulniers BTW we've enabled clang builds with kselftest on staging, does this look good?
https://storage.staging.kernelci.org/kernelci/staging-next/staging-next-20210211.0/arm64/defconfig+kselftest/clang-11/build.log

@nathanchance
Copy link
Member

I do see quite a few errors in there but it does look like clang is being used.

@nickdesaulniers
Copy link
Member Author

yeah cool those are clang warnings all right!

@gctucker
Copy link

Nice, we're working on splitting out the kselftest build log, in fact having a build log for each step of the build job, and then that will get turned on in production. It's working on the command line already, hopefully it'll be there by the end of the month.

Then we could include a separate section in the build email reports and on the web dashboard for kselftest errors, or maybe have a "kselftest special" report with both build and test results. We'll be discussing that once we get there.

@nathanchance
Copy link
Member

$ make -skj"$(nproc)" LLVM=1 LLVM_IAS=1 distclean defconfig quicktest=1 kselftest

shows that clang is being used so closing this issue. We can open individual issues for the errors that we see.

@gctucker
Copy link

FYI we now have separate build steps working on staging, here's a sample kselftest log:
https://storage.staging.kernelci.org/kernelci/staging-mainline/staging-mainline-20210423.0/x86_64/x86_64_defconfig+kselftest/clang-10/logs/kselftest.log

This should get enabled in production by the end of the month. We could then look into generating a kselftest special email report with both build and runtime issues.

@nickdesaulniers
Copy link
Member Author

@gctucker nice! Looks like we have a good list of warnings+errors to start fixing in the kselftests!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[BUG] linux A bug that should be fixed in the mainline kernel. good first issue Good for newcomers hermetic builds has implications for doing gcc/binutils-free builds low priority This bug is not critical and not a priority
Projects
None yet
Development

No branches or pull requests

4 participants