Skip to content
This repository was archived by the owner on Mar 7, 2021. It is now read-only.

Remove kernel-cflags-finder (fixes #191) #236

Merged
merged 1 commit into from
Aug 11, 2020
Merged

Conversation

geofft
Copy link
Collaborator

@geofft geofft commented Aug 11, 2020

The bulk of this is the changes from #185 that didn't make it into #188.

We also upgrade Travis's Clang/LLVM version to 9 to pick up some sort
of bugfix in relocation processing. With older versions, we get

[ 1827.072410] module: x86/modules: Skipping invalid relocation target, existing value is nonzero for type 1, loc 00000000197e607d, val ffffffffc0703520

(where that "loc" seems to be random/garbage data, disconcertingly).
Clang 9 is already required by kernels 5.0+ so this shouldn't be too
much of a problem.

Co-authored-by: Alex Gaynor [email protected]

@@ -1,6 +1,5 @@
matrix:
include:
- dist: xenial
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Doesn't have clang-9 in repo, and it uses the same kernel anyway (see #229). If we think it's valuable I can use apt.llvm.org

@@ -3,8 +3,11 @@ helloworld-objs := hello_world.rust.o

CARGO ?= cargo

export c_flags
export abs_srctree ?= ${CURDIR}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is exported by v5.2+ (torvalds/linux@25b146c) but it's pretty easy to keep compatibility with older ones.

$(src)/target/x86_64-linux-kernel/debug/libhello_world.a: $(src)/Cargo.toml $(wildcard $(src)/src/*.rs)
cd $(src); env -u MAKE -u MAKEFLAGS $(CARGO) build -Z build-std=core,alloc --target=x86_64-linux-kernel
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Didn't seem to be necessary.

@geofft geofft requested a review from alex August 11, 2020 04:39
@geofft
Copy link
Collaborator Author

geofft commented Aug 11, 2020

The weird relocation problem seems to be the same as https://lists.linuxfoundation.org/pipermail/llvmlinux/2018-July/001589.html , which implies it's alternatively solved by newer kernels than 4.15. That gives you a very narrow window of kernel versions because 5.0 wants clang 9 for asm goto, so I figured we just just formally drop support for older versions.

@geofft
Copy link
Collaborator Author

geofft commented Aug 11, 2020

Sigh, we now need to call clippy from inside Kbuild.

@geofft
Copy link
Collaborator Author

geofft commented Aug 11, 2020

That's enough churn that I spun it out into #237. Will rebase once that lands.

The bulk of this is the changes from #185 that didn't make it into #188.

We also upgrade Travis's Clang/LLVM version to 9 to pick up some sort
of bugfix in relocation processing. With older versions, we get

[ 1827.072410] module: x86/modules: Skipping invalid relocation target, existing value is nonzero for type 1, loc 00000000197e607d, val ffffffffc0703520

(where that "loc" seems to be random/garbage data, disconcertingly).
Clang 9 is already required by kernels 5.0+ so this shouldn't be too
much of a problem.

Co-authored-by: Alex Gaynor <[email protected]>
@geofft geofft force-pushed the no-kernel-cflags-finder branch from a337e7f to a4d1e80 Compare August 11, 2020 13:58
Copy link
Member

@alex alex left a comment

Choose a reason for hiding this comment

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

Wooo! I think the next step here will be to figure out how to factor out teh common bits of all the KBuilds.

@geofft geofft merged commit fb18729 into master Aug 11, 2020
@geofft geofft deleted the no-kernel-cflags-finder branch August 11, 2020 14:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants