Skip to content

[nrf fromtree] net: sockets_offload: Fix build error with NO_OPTIMIZA…#2973

Merged
rlubos merged 1 commit intonrfconnect:mainfrom
rlubos:ncs/net/offload-no-optim-fix
Jun 24, 2025
Merged

[nrf fromtree] net: sockets_offload: Fix build error with NO_OPTIMIZA…#2973
rlubos merged 1 commit intonrfconnect:mainfrom
rlubos:ncs/net/offload-no-optim-fix

Conversation

@rlubos
Copy link
Contributor

@rlubos rlubos commented Jun 23, 2025

Cherry-pick fix for native_sim builds with optimizations disabled.

…TIONS

When CONFIG_NO_OPTIMIZATIONS the compiler will not inline
socket_offload_dns_is_enabled(), which means calls to
socket_offload* remain, and the linker will fail with

in function `zsock_getaddrinfo': undefined reference to
`socket_offload_getaddrinfo'
in function `zsock_freeaddrinfo': undefined reference to
`socket_offload_freeaddrinfo'

Instead of relaying on that function being inlined and the
if'ed code being removed, let's just use the preprocessor.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
(cherry picked from commit dc24583)
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
@sonarqubecloud
Copy link

@rlubos rlubos merged commit 21e025e into nrfconnect:main Jun 24, 2025
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants