Skip to content

tests/subsys/llext/simple/llext.simple.loader_build fails to build for native_posix in main #81136

@aescolar

Description

@aescolar

Describe the bug
The test tests/subsys/llext/simple/llext.simple.loader_build fails to build for native_posix in main

11c350e changed a linker script snippet to set no_syscall_impl (in section llext_no_syscall_impl) hard in address 0, but in a way that sets the address of any further section/symbols after that until the current address is set to something else.

Side notes

  • Is this llext_no_syscall_impl needed even if USERSPACE is not enabled?
  • Note: native_posix is deprecated, so maybe just filtering it is an option. But still, it does not feel too nice to have sideffects in snippets.
  • Just doing this (assuming the current way of doing things is necessary) would avoid the issue:
+       silly = .;
        SECTION_PROLOGUE(llext_no_syscall_impl, 0 (COPY), )
        {
          *(llext_no_syscall_impl)
        }
+       . = silly;

To Reproduce
Steps to reproduce the behavior:

  1. mkdir build; cd build
  2. cmake -GNinja -DBOARD=native_posix ../tests/subsys/llext/simple/ && ninja
  3. ninja
  4. See error

Expected behavior
No build failures in enabled platforms.

Impact
2 failures in weekly CI (for native_posix and native_posix//64)
https://github.com/zephyrproject-rtos/zephyr/runs/32564635154
(note there is some other platforms failing this test)

Logs and console output

/usr/bin/ld.bfd: zephyr/zephyr.elf: error: PHDR segment not covered by LOAD segment
collect2: error: ld returned 1 exit status

Environment (please complete the following information):

  • OS: Ubuntu 24.04
  • Toolchain (e.g Zephyr SDK, ...): gcc 14.2
  • Commit SHA or Version used: Main since 11c350e

Additional context
It fails to build since 11c350e

Metadata

Metadata

Assignees

Labels

area: llextLinkable Loadable ExtensionsbugThe issue is a bug, or the PR is fixing a bug

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions