Skip to content
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

Merged
merged 1 commit into from
Feb 1, 2024

Conversation

fzi-haxel
Copy link
Contributor

Contribution description

Native for Linux x86-64

For the initial version, instead of creating a separate native64 board, I decided to add the variable NATIVE_64BIT to the native board Makefiles. Setting the environment to NATIVE_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

  • Architectures other than x86-64 or operating systems other than Linux
    - No FreeBSD support
    - No Aarch64 support
  • Rust support for x86-64

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:

  • Setting NATIVE_64BIT=1 will skip the unsupported Rust examples and tests. Other than that, nothing else should be skipped.
  • 64 bit native may require additional dependencies. For example, the RIOT docker is missing libsdl2-dev for 64-bit.
  • Currently the CI will not test NATIVE_64BIT=1.

Issues/PRs references

See also

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
@github-actions github-actions bot added Platform: native Platform: This PR/issue effects the native platform Area: doc Area: Documentation Area: pkg Area: External package ports Area: boards Area: Board ports Area: cpu Area: CPU/MCU ports Area: Kconfig Area: Kconfig integration labels Jan 30, 2024
@@ -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
Copy link
Contributor

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.

Copy link
Contributor Author

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).

@benpicco benpicco added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Jan 31, 2024
@riot-ci
Copy link

riot-ci commented Jan 31, 2024

Murdock results

✔️ PASSED

16eff9b native: Linux/x86_64 support

Success Failures Total Runtime
8626 0 8628 09m:21s

Artifacts

@benpicco benpicco added this pull request to the merge queue Feb 1, 2024
Merged via the queue into RIOT-OS:master with commit 5bd879b Feb 1, 2024
29 checks passed
@fzi-haxel fzi-haxel deleted the native-x86-64-support branch February 2, 2024 13:21
chrysn added a commit to chrysn-pull-requests/riot-os.org that referenced this pull request Mar 16, 2024
We now have 64bit support since RIOT-OS/RIOT#20315, so the FAQ item does not make sense any more.
@MrKevinWeiss MrKevinWeiss added this to the Release 2024.04 milestone Apr 30, 2024
@maribu maribu mentioned this pull request May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: boards Area: Board ports Area: cpu Area: CPU/MCU ports Area: doc Area: Documentation Area: Kconfig Area: Kconfig integration Area: pkg Area: External package ports CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Platform: native Platform: This PR/issue effects the native platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants