Skip to content

Conversation

@cfriedt
Copy link
Member

@cfriedt cfriedt commented Sep 25, 2025

On an x86_64 Ubuntu host, the following command would result in an error.

west build -p -b native_sim/native tests/net/wifi/configs -T wifi.build.hostapd_ap ... In file included from /usr/include/bits/errno.h:26, from /usr/include/errno.h:28, from ~/zephyrproject/zephyr/scripts/native_simulator//common/src/nce.c:24: /usr/include/linux/errno.h:1:10: fatal error: asm/errno.h: No such file or directory 1 | #include <asm/errno.h> | ^~~~~~~~~~~~~ compilation terminated.

Include /usr/include/x86_64-linux-gnu in the search path so that the build succeeds.

Fixes #96566

On an x86_64 Ubuntu host, the following command would result in an error. ```shell west build -p -b native_sim/native tests/net/wifi/configs \ -T wifi.build.hostapd_ap ... In file included from /usr/include/bits/errno.h:26, from /usr/include/errno.h:28, from ~/zephyrproject/zephyr/scripts/native_simulator/\ /common/src/nce.c:24: /usr/include/linux/errno.h:1:10: fatal error: asm/errno.h: \ No such file or directory 1 | #include <asm/errno.h> | ^~~~~~~~~~~~~ compilation terminated. ``` Include `/usr/include/x86_64-linux-gnu` in the search path so that the build succeeds. Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
@cfriedt cfriedt force-pushed the native-sim-include-toolchain-path-for-asm-errno-h branch from f6069fe to 8bedb29 Compare September 25, 2025 16:14
@zephyrbot zephyrbot added area: native port Host native arch port (native_sim) size: XS A PR changing only a single line of code labels Sep 25, 2025
@zephyrbot zephyrbot requested a review from aescolar September 25, 2025 16:15
@cfriedt cfriedt changed the title \native_simulator: include folder for missing <asm/errno.h> native_simulator: include folder for missing <asm/errno.h> Sep 25, 2025
@cfriedt cfriedt added the Hotfix Fix for issues blocking development, i.e. upstream CI issues, tests failing in upstream CI , etc. label Sep 25, 2025
@cfriedt
Copy link
Member Author

cfriedt commented Sep 25, 2025

This fixed the build on my local Ubuntu machine. Not sure if it's absolutely necessary in CI. Also, aarch64 might need a separate path.

There may be a more elegant way of determining the path, so I would be happy to make corrections.

If the path does not exist most compilers that I've worked with will not complain.

NSI_WARNINGS?=-Wall -Wpedantic
# Preprocessor flags
NSI_CPPFLAGS?=-D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED
NSI_CPPFLAGS+=-I/usr/include/x86_64-linux-gnu
Copy link
Member

@henrikbrixandersen henrikbrixandersen Sep 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't usually hardcode system paths like this? Also, I am not building on x86_64, but aarch64.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also mentioned here

#96582 (comment)

Please feel free to suggest something if there is a similar need on aarch64.

I'm also happy to use a more elaborate approach if there is one for getting the path.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is wrong e.g. for openSUSE. And anyway looks like this needs another fix

Copy link
Member

@aescolar aescolar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is wrong. I will look into the issue, but whatever it is, this is not the way to go

@aescolar aescolar removed the Hotfix Fix for issues blocking development, i.e. upstream CI issues, tests failing in upstream CI , etc. label Sep 25, 2025
@cfriedt
Copy link
Member Author

cfriedt commented Sep 25, 2025

This is wrong. I will look into the issue, but whatever it is, this is not the way to go

Thanks - it worked for me, but if there is a better way (or a way that you prefer), I'm happy to use that.

@cfriedt
Copy link
Member Author

cfriedt commented Sep 27, 2025

I think this was a user error - sudo apt install -y linux-libc-dev:i386 fixes it for me.

@cfriedt cfriedt closed this Sep 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: native port Host native arch port (native_sim) size: XS A PR changing only a single line of code

5 participants