-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add ARM64 CMake variable for 64-bit targets #347
Conversation
At the moment, much of the codebase compiles on 64-bit targets, but not all (mostly 32-bit assembly). -DARM64=ON allows for skipping directories which currently do not compile correctly. This is backwards compatible with existing behavior (i.e. no -DARM on a 32-bit target compiles everything as before), and hopefully will ultimately become unnecessary as remaining components are fixed for 64-bit use.
There is existing C code to replace the ARMv6 assemly at "interface/khronos/common/khrn_int_hash.c", but I don`t know enough about CMAKE to conditionally disable https://github.com/raspberrypi/userland/blob/master/interface/khronos/CMakeLists.txt#L55 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm probably being very stupid here, but is there anything in the existing CMakeLists.txt files to actually build for arm64 at all (i.e. set arch=armv8-a, I guess) ?
Actually, I was able to get this to work just fine. So maybe the PR should be accepted. Here are the build steps: I didn't use buildme Rather cool actually! |
I'm even able to run some of the commands: Here is the list of binary that actually build: |
Yeah, a good chunk of the userland codebase works fine on ARM64, when used with @Electron752 's 64-bit kernel base. This PR simply adds the ability to do -DARM64=ON to skip the code which is currently broken. There's a certainly a lot to fix and some might be simple for people with better CMAKE experience (e.g. @ED6E0F17 pointing out that khronos might be workable if it uses the .c version of a file instead of the ASM version), but this should not hold up accepting this PR. Ideally this PR is accepted first to at least allow for 64-bit compilation, and as things are fixed by people in subsequent PRs, what -DARM64=ON masks out is slowly reduced. FYI, this patch is currently in use to enable arm64 .deb compilation at https://launchpad.net/~ubuntu-raspi2/+archive/ubuntu/ppa-nightly/+packages |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like a good start then!
At the moment, much of the codebase compiles on 64-bit targets, but not
all (mostly 32-bit assembly). -DARM64=ON allows for skipping
directories which currently do not compile correctly.
This is backwards compatible with existing behavior (i.e. no -DARM on a
32-bit target compiles everything as before), and hopefully will
ultimately become unnecessary as remaining components are fixed for
64-bit use.
FYI, everything not skipped by -DARM64=ON compiles correctly (albeit with some warnings), but I haven't tested everything for actually working. However I have verified vcgencmd and tvservice work fine with 64-bit kernel/userland.