-
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
CMakeLists: Introduce AMD64 (to fix x86_64/--native builds) #670
base: master
Are you sure you want to change the base?
Conversation
Have you actually tested this on a Pi? ARM64 is a define passed in from the buildme script - https://github.com/raspberrypi/userland/blob/master/buildme#L24 I don't see you having added a similar flag for ARM, therefore it is never going to be defined and you'll never build any of the libraries under you MMAL should build for x86_64 - it was one of the test platforms for the framework, and used to be used under Windows. There may be some 32bit assumptions/checks in some of the structs. Those should be resolved when we unrevert the 64bit support. The |
I wasn't using the I updated a new version, which now includes the necessary changes in the
Yes, this indeed didn't build for me. For now, I made it ARM32 only. Also, had to disable some targets that link against it. I successfully built this natively for x86_64-linux and aarch64-linux, and cross-compiled from x86_64-linux to armv6l-linux and aarch64-linux. I couldn't test on armv6/7l natively (as I don't have access to the hardware). |
TBH I'd prefer to go the other way - default to ARM and add a NATIVE flag. This repo is specifically targetted at the Pi, therefore that is the absolute priority, anything else is the odd-ball. |
How would the semantics of If we build this on a raspberry pi or on x86-64-linux, that's both no cross-compilation, it's just that less of the tools can build in the x86-64-linux case. |
i was following the ```--native`` option from buildme (https://github.com/raspberrypi/userland/blob/master/buildme#L20). ARM/ARM64 has already been filtered off, so it's build for the host vs cross-compile on non-ARM platforms. Perhaps better to add it as an |
Yeah, It's really a pity CMake has no standardized concept to get this information, like meson or autotools have. I'll change this to |
If you'd make the |
CMakeLists.txt currently assumes everything not ARM64 to be ARM32. When compiling on x86_64-linux, this tries to build some binaries that are arm(32) only. Some tools make some sense to use even on non-ARM workstations. For example, `dtmerge` can be used to merge .dtb files with overlays on a x86_64 machine (while mounting an sdcard for example). This introduces a "AMD64" cmake flag, that's set in the `buildme` script only when compiling for x86_64. Signed-off-by: Florian Klink <[email protected]>
I updated the patch, now introducing the Successfully natively compiled on x86_64, aarch64, and crosscompiled from x86_64 to armv6,7,aarch64. |
We are actively relying on this patch downstream in NixOS and we'de be happy if it could be merged upstream. |
CMakeLists.txt currently assume everything not ARM64 to be ARM. When
compiling on x86_64-linux, this pulls in some binaries that are arm32
only.
Some tools make some sense to have accessible even on non-ARM
workstations. For example,
dtmerge
can be used to merge .dtb fileswith overlays on a x86_64 machine (while mounting an sdcard for
example).
Simply by adding this conditionals, we're able to get a
dtmerge
binarythat runs on x86_64-linux.