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

hello-world build and run on Debian 5.6.14 kernel 5.6.0-2-amd64 #219

Open
BartMassey opened this issue Jun 13, 2020 · 8 comments
Open

hello-world build and run on Debian 5.6.14 kernel 5.6.0-2-amd64 #219

BartMassey opened this issue Jun 13, 2020 · 8 comments

Comments

@BartMassey
Copy link

This branch in my repo fork makes the hello-world example build and work on on Debian-5.6.14-1 with Linux kernel 5.6.0-2-amd64. I did not put in a pull request, because this was sort of kludged together. Thought someone might want it, though. I built using clang-11: clang-9 did not work for me, but I don't know whether clang-10 would have.

@alex
Copy link
Member

alex commented Jul 12, 2020

@BartMassey sorry I was so slow to look at this -- I think all of the type issues you had to fix should be resolved on master now -- can you take a look and see what's still required, and do a PR for that?

@geofft
Copy link
Collaborator

geofft commented Aug 9, 2020

#227 adds CONFIG_CC_IS_CLANG.

So it looks like the remaining diffs are

  • eh_personality - this surprises me, we disable unwinding. How'd you run into this? (You might need a newer Rust nightly?)
  • type issues - try rebasing?

@BartMassey
Copy link
Author

Current master 86a8004 seems to compile and run fine on my box now. Requires export CLANG=clang-11 — does not work with clang-9 or clang-10. Suggest updating the README to suggest clang-11 for latest 5.0 kernels.

Thanks much for this project, and for adding the requisite stuff to get it working again.

Linux redacted 5.7.0-2-amd64 #1 SMP Debian 5.7.10-1 (2020-07-26) x86_64 GNU/Linux

@geofft
Copy link
Collaborator

geofft commented Aug 10, 2020

What's your build failure on lower clang versions?

(I can probably reproduce this myself, but I'm currently tracking down an issue where Ubuntu Bionic + clang 9 + kernel 4.15 fails on Travis but not on EC2 and I have yet to figure out what the relevant difference is, so it seems safer to ask...)

geofft added a commit that referenced this issue Aug 11, 2020
4.5 added
 * copy_file_range (torvalds/linux@2973293)
 * clone_file_range (torvalds/linux@04b38d6)
 * dedupe_file_range (torvalds/linux@54dbc15)

4.7 added iterate_shared (torvalds/linux@6192269),
a variant of iterate that takes a non-exclusive lock. It sounds like
it'd be safe to provide an implementation of iterate_shared as iterate.

4.9 removed aio_fsync (torvalds/linux@723c038),
which was never actually used, so we can set it to None in older kernels
and not think about it.

4.13 added wait_for_random_bytes (torvalds/linux@e297a78).
For now, conditionalize the entire random module on it.

All test cases other than random pass on Ubuntu 16.04's kernel.

Update the README to say we expect 4.4 onwards to work, possibly with
newer Clang for really new kernels (refs #219).
geofft added a commit that referenced this issue Aug 11, 2020
4.5 added
 * copy_file_range (torvalds/linux@2973293)
 * clone_file_range (torvalds/linux@04b38d6)
 * dedupe_file_range (torvalds/linux@54dbc15)

4.7 added iterate_shared (torvalds/linux@6192269),
a variant of iterate that takes a non-exclusive lock. It sounds like
it'd be safe to provide an implementation of iterate_shared as iterate.

4.9 removed aio_fsync (torvalds/linux@723c038),
which was never actually used, so we can set it to None in older kernels
and not think about it.

4.13 added wait_for_random_bytes (torvalds/linux@e297a78).
For now, conditionalize the entire random module on it.

All test cases other than random pass on Ubuntu 16.04's kernel.

Update the README to say we expect 4.4 onwards to work, possibly with
newer Clang for really new kernels (refs #219).
@geofft
Copy link
Collaborator

geofft commented Aug 12, 2020

Are you getting something like

arch/x86/include/asm/segment.h:266:2: error: expected '(' after 'asm'

? If so, that's probably https://reviews.llvm.org/D75563 yeah.

@BartMassey
Copy link
Author

Yes, that's the one.

@geofft
Copy link
Collaborator

geofft commented Aug 13, 2020

OK, I updated the README to mention it. Though.. we could work around it by adding a -UCONFIG_CC_HAS_ASM_INLINE in build.rs, which might be worthwhile since this version of clang is literally not released yet. (And hm I think it's actually a matter of what gcc version your kernel was built with.)

@BartMassey
Copy link
Author

I guess it depends on how close we are to the clang-11 release, which I'm not really tracking. I suspect pretty close, since Debian is packaging it in unstable at this point.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants