-
Notifications
You must be signed in to change notification settings - Fork 2k
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
native: Linux/x86_64 support #20315
native: Linux/x86_64 support #20315
Conversation
Initial version to test 64 bit compatibility. Instead of a separate board, the inital version for Linux/x86_64 is enabled by setting the environment variable `NATIVE_64BIT=y` and compiling as usual. Not currently implemented: * Architectures other than x86_64 or operating systems other than Linux * No FreeBSD support * No Aarch support * Rust support for x86_64
@@ -4,6 +4,9 @@ NATIVEINCLUDES += -I$(RIOTBASE)/core/lib/include/ | |||
NATIVEINCLUDES += -I$(RIOTBASE)/core/include/ | |||
NATIVEINCLUDES += -I$(RIOTBASE)/drivers/include/ | |||
|
|||
# Set "NATIVE_64BIT=1" to compile for x86_64 | |||
NATIVE_64BIT ?= 0 |
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.
Can we have a native64
board that will just set this and otherwise include the native
board (see e.g. openlabs-kw41z-mini-256kib
).
Otherwise this won't be exercised by CI.
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.
Probably yes, but there are a lot of additional changes needed outside the boards folder to make it work.
For example, the codebase has a lot of checks like ifeq (native, $(BOARD))
that would need to be adapted.
I have a WIP branch that is not yet finished, but it shows the extent of the changes needed WIP: native64 board.
(This one moves most of the native board into a common folder instead of the way it is handled with openlabs-kw41z-mini-256kib
).
We now have 64bit support since RIOT-OS/RIOT#20315, so the FAQ item does not make sense any more.
Contribution description
Native for Linux x86-64
For the initial version, instead of creating a separate
native64
board, I decided to add the variableNATIVE_64BIT
to the native board Makefiles. Setting the environment toNATIVE_64BIT=1
will enable 64-bit mode for native, which is disabled by default.While I don't necessarily think this is the best long-term solution, it does ensure that all tests run with the same configuration as the 32-bit version. A separate board would require a major refactoring of many tests, which often have different configurations in the Makefile, C code, and Python tests if the board is native, and I didn't want to increase the size of an already large pull request.
Almost all of the same features as the 32-bit version are supported by the 64-bit version, but the following are still missing
- No FreeBSD support
- No Aarch64 support
This PR is a suggestion for initial 64-bit support, feel free to suggest any changes.
Testing procedure
Just set the
NATIVE_64BIT=1
environment variable and compile something for native.For example
NATIVE_64BIT=1 ./dist/tools/compile_and_test_for_board/compile_and_test_for_board.py . native
NOTE:
NATIVE_64BIT=1
will skip the unsupported Rust examples and tests. Other than that, nothing else should be skipped.NATIVE_64BIT=1
.Issues/PRs references
See also