Skip to content

sim: posix: add platform-specific timer handling for macOS and Linux#18331

Open
aditya0yadav wants to merge 1 commit intoapache:masterfrom
aditya0yadav:master
Open

sim: posix: add platform-specific timer handling for macOS and Linux#18331
aditya0yadav wants to merge 1 commit intoapache:masterfrom
aditya0yadav:master

Conversation

@aditya0yadav
Copy link


PLEASE DONT MERGE THIS PR

Summary

This change updates the POSIX simulator host timer implementation to
handle platform differences between macOS (Darwin) and Linux.

macOS does not provide full support for POSIX timers such as
timer_create() and timer_settime(). To address this, the simulator
now uses setitimer() on macOS while retaining POSIX timers with
absolute-time scheduling on Linux and other POSIX systems.

The platform selection is handled via the NUTTX_DARWIN macro, keeping
the simulator core logic unchanged while improving portability and
correctness on macOS.


Impact

  • Improves portability of the POSIX simulator on macOS hosts.
  • No functional or behavioral change for Linux or other POSIX platforms.
  • No impact on target hardware, board support, or NuttX core logic.
  • No documentation or security impact.
  • Build behavior remains unchanged on supported Linux systems.

Testing

  • Tested on macOS (Darwin):

    • Host: macOS (Apple Silicon)
    • Simulator: POSIX SIM
    • Verified successful build and runtime execution.
    • Confirmed timer interrupts are delivered via SIGALRM and simulator
      scheduling behaves as expected.
  • Linux testing:

    • Not yet tested on a Linux host.

Since this change affects host timer handling, additional testing on
Linux systems would be valuable before merging.
If anyone is able to test this change on a Linux PC and confirm that the
POSIX simulator builds and runs correctly, that feedback and any logs
would be greatly appreciated.

One more thing ,
For supporting macos, multiple things need to be done like docs and linker too .


@github-actions github-actions bot added Arch: simulator Issues related to the SIMulator Size: S The size of the change in this PR is small labels Feb 3, 2026
@aditya0yadav
Copy link
Author

For macos,
Please disable this
COVERAGE_TOOLCHAIN(=n) "Link toolchain gcov library to the OS"
SYSTEM_GCOV(=n) "gcov tool"

Screenshot 2026-02-03 at 12 46 49 PM

@simbit18 simbit18 marked this pull request as draft February 3, 2026 10:33
@simbit18
Copy link
Contributor

simbit18 commented Feb 3, 2026

Hi @aditya0yadav , I converted PR into draft.

@FelipeMdeO @lupyuen @aviralgarg05 What do you think?
#17818

@jerpelea
Copy link
Contributor

jerpelea commented Feb 3, 2026

please remove the merge commit !

@aviralgarg05
Copy link
Contributor

Hi @aditya0yadav , I converted PR into draft.

@FelipeMdeO @lupyuen @aviralgarg05 What do you think? #17818

Hi @simbit18, thanks for tagging me, the core approach of using setitimer() for macOS makes sense as a workaround for the missing POSIX timers but the addition of #define _POSIX_C_SOURCE 200809L in sim_hosttime.c has broken the Linux build. It causes an implicit declaration error for usleep() because usleep was removed in POSIX 2008. We might need to keep _POSIX_C_SOURCE at an older version or switch usleep to nanosleep.

@aditya0yadav
Copy link
Author

@aviralgarg05 I’ve removed the #define _POSIX_C_SOURCE 200809L in macOS and Ubuntu-based code spaces and it’s working properly. Mind taking a look?

@aditya0yadav
Copy link
Author

@simbit18 One more thing, what should we do with the linker in macOS?
I know it will work perfectly with Linux but not with macOS.

Every time I have to disable the configuration toolchain related to Gcov.

Any suggestions?

@aviralgarg05
Copy link
Contributor

@aviralgarg05 I’ve removed the #define _POSIX_C_SOURCE 200809L in macOS and Ubuntu-based code spaces and it’s working properly. Mind taking a look?

Thanks for the update @aditya0yadav, I checked the latest changes, the approach looks correct. There might be an issue with the setitimer tick scheduling - the simulator isn't booting correctly. Could you check if SIGALRM is being delivered properly?

@aditya0yadav
Copy link
Author

aditya0yadav commented Feb 4, 2026 via email

@simbit18
Copy link
Contributor

simbit18 commented Feb 4, 2026

@simbit18 One more thing, what should we do with the linker in macOS? I know it will work perfectly with Linux but not with macOS.

Every time I have to disable the configuration toolchain related to Gcov.

Any suggestions?

A long time ago, it was possible to build sim:nsh for Linux, macOS, and Windows .
Currently, it does not work on macOS and Windows with MSYS2/Cygwin (the latest version I was able to build and test was 10.2), so I personally think it is right to restore the build by modifying the defconfig file.

Of course, this is just my opinion! :)

@acassis
Copy link
Contributor

acassis commented Feb 4, 2026

@simbit18 One more thing, what should we do with the linker in macOS? I know it will work perfectly with Linux but not with macOS.
Every time I have to disable the configuration toolchain related to Gcov.
Any suggestions?

A long time ago, it was possible to build sim:nsh for Linux, macOS, and Windows . Currently, it does not work on macOS and Windows with MSYS2/Cygwin (the latest version I was able to build and test was 10.2), so I personally think it is right to restore the build by modifying the defconfig file.

Of course, this is just my opinion! :)

I think is makes sense, maybe using git bisect it could be possible to identify which symbols cases the breaking and open an issue to track it.

@simbit18
Copy link
Contributor

simbit18 commented Feb 5, 2026

Hi @raiden00pl, The changes in this PR cause errors in sim:citest. Can you check it?

Traceback (most recent call last):
YAML config:
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
{'config': {'cwd': './', 'timeout_session': 6000},
 'product': {'cores': {'core0': {'conf_path': './.config',
                                 'device': 'sim',
                                 'elf_path': './nuttx',
                                 'name': 'main'}},
             'name': 'ntfc-sim'}}
JSON config:
{'args': {'kv': []},
 'module': {'exclude_module': ['Nuttx_System_Driver_Pm', 'Nuttx_System_Fs_Fs'],
            'include_module': [],
            'order': []}}
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/github/workspace/nuttx-ntfc/venv/lib/python3.10/site-packages/ntfc/__main__.py", line 25, in <module>
    main()  # pylint: disable=no-value-for-parameter
  File "/github/workspace/nuttx-ntfc/venv/lib/python3.10/site-packages/click/core.py", line 1485, in __call__
    return self.main(*args, **kwargs)
  File "/github/workspace/nuttx-ntfc/venv/lib/python3.10/site-packages/click/core.py", line 1416, in main
    ctx.exit()
  File "/github/workspace/nuttx-ntfc/venv/lib/python3.10/site-packages/click/core.py", line 737, in exit
    self.close()
  File "/github/workspace/nuttx-ntfc/venv/lib/python3.10/site-packages/click/core.py", line 621, in close
    self._close_with_exception_info(None, None, None)
  File "/github/workspace/nuttx-ntfc/venv/lib/python3.10/site-packages/click/core.py", line 635, in _close_with_exception_info
    exit_result = self._exit_stack.__exit__(exc_type, exc_value, tb)
  File "/usr/lib/python3.10/contextlib.py", line 576, in __exit__
    raise exc_details[1]
  File "/usr/lib/python3.10/contextlib.py", line 561, in __exit__
    if cb(*exc_details):
  File "/usr/lib/python3.10/contextlib.py", line 449, in _exit_wrapper
    callback(*args, **kwds)
  File "/github/workspace/nuttx-ntfc/venv/lib/python3.10/site-packages/click/decorators.py", line 93, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/github/workspace/nuttx-ntfc/venv/lib/python3.10/site-packages/click/core.py", line 824, in invoke
    return callback(*args, **kwargs)
  File "/github/workspace/nuttx-ntfc/venv/lib/python3.10/site-packages/ntfc/cli/main.py", line 181, in cli_on_close
    ret = test_run(pt, ctx)
  File "/github/workspace/nuttx-ntfc/venv/lib/python3.10/site-packages/ntfc/cli/main.py", line 123, in test_run
    return pt.runner(ctx.testpath, ctx.result, ctx.nologs)
  File "/github/workspace/nuttx-ntfc/venv/lib/python3.10/site-packages/ntfc/pytest/mypytest.py", line 270, in runner
    self._device_start()
  File "/github/workspace/nuttx-ntfc/venv/lib/python3.10/site-packages/ntfc/pytest/mypytest.py", line 222, in _device_start
    product.start()
  File "/github/workspace/nuttx-ntfc/venv/lib/python3.10/site-packages/ntfc/product.py", line 70, in start
    self._cores.start()
  File "/github/workspace/nuttx-ntfc/venv/lib/python3.10/site-packages/ntfc/cores.py", line 73, in start
    core.start()
  File "/github/workspace/nuttx-ntfc/venv/lib/python3.10/site-packages/ntfc/core.py", line 510, in start
    self._device.start()
  File "/github/workspace/nuttx-ntfc/venv/lib/python3.10/site-packages/ntfc/device/sim.py", line 52, in start
    self.host_open(cmd, uptime)
  File "/github/workspace/nuttx-ntfc/venv/lib/python3.10/site-packages/ntfc/device/host.py", line 139, in host_open
    raise TimeoutError("device boot timeout")
TimeoutError: device boot timeout
+ ret=1
+ echo 1
+ deactivate

@simbit18 simbit18 requested a review from raiden00pl February 5, 2026 10:45
@raiden00pl
Copy link
Member

raiden00pl commented Feb 5, 2026

@simbit18 @aditya0yadav sim/citest is broken, NTFC detects that device is broken at init or doesn't boot at all.

When I run binary from this PR, NSH is not functional and it stucks on NSH prompt (not sure what is this init error and if it's realted):

image

probably not everyone knows about it, but you can download built binaries directly from CI:

image

@raiden00pl
Copy link
Member

with this PR sim/citest compiled on my host doesn't work either but sim/nsh works fine

@simbit18
Copy link
Contributor

simbit18 commented Feb 5, 2026

@raiden00pl, thank you very much.

@aditya0yadav
Copy link
Author

@simbit18 One more thing, what should we do with the linker in macOS? I know it will work perfectly with Linux but not with macOS.
Every time I have to disable the configuration toolchain related to Gcov.
Any suggestions?

A long time ago, it was possible to build sim:nsh for Linux, macOS, and Windows . Currently, it does not work on macOS and Windows with MSYS2/Cygwin (the latest version I was able to build and test was 10.2), so I personally think it is right to restore the build by modifying the defconfig file.
Of course, this is just my opinion! :)

I think is makes sense, maybe using git bisect it could be possible to identify which symbols cases the breaking and open an issue to track it.

I just want to check if I’m understanding correctly:
@simbit18 @acassis

The linker issue seems to happen only on macOS, not on Linux. On Linux, it works fine and uses Gcov as expected, but on macOS, I always have to disable the Gcov-related toolchain in the configuration.

If I wanted to find the specific symbol that is causing the linker to fail, doing a git bisect over 2–4 years of changes seems impractical because there’s been too much change in the repository.

One idea I had is to use Docker with Linux to build NuttX, since Linux doesn’t hit the macOS linker problem. But of course, that wouldn’t reproduce the macOS-specific issue.

Do you have any suggestions on how to approach this efficiently for macOS?

@FelipeMdeO
Copy link
Contributor

FelipeMdeO commented Feb 5, 2026 via email

@FelipeMdeO
Copy link
Contributor

Hello @aditya0yadav , @acassis , @simbit18 , @raiden00pl, @linguini1 .

I did several build to try get first macOS build break.

The last OK macOS build (commit sha):
nuttx: 7e925db
apps: f517b66

Crash Commit SHA:
nuttx: 002f3c7
apps: f517b66
002f3c7

Using this SHA, the build output is:

~/nuttx-tests/nuttx on  HEAD (002f3c7) via △ v4.2.0 took 2s 
❯ make -j all      
Create version.h
LN: platform/board to /Users/felipemouradeoliveira/nuttx-tests/apps/platform/dummy
Register: gpio
Register: ostest
Register: nsh
Register: sh
Register: dumpstack
Register: hello
clangclang: : error: unsupported argument 'medium' to option '-mcmodel=' for target 'arm64-apple-macosx26.0.0'
error: unsupported argument 'medium' to option '-mcmodel=' for target 'arm64-apple-macosx26.0.0'
ERROR: cc failed: 1
       command: cc -MT ./nsh_main.c.Users.felipemouradeoliveira.nuttx-tests.apps.system.nsh.o  -M '-g' '-fomit-frame-pointer' '-fno-common' '-fvisibility=hidden' '-ffunction-sections' '-fdata-sections' '-Wall' '-Wstrict-prototypes' '-Wshadow' '-Wundef' '-Wno-attributes' '-Wno-unknown-pragmas' '-fno-pic' '-mcmodel=medium' '-isystem' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/include' '-D__NuttX__' '-DNDEBUG' '-U_AIX' '-U_WIN32' '-U__APPLE__' '-U__FreeBSD__' '-U__NetBSD__' '-U__linux__' '-U__sun__' '-U__unix__' '-U__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' '-D__KERNEL__' '-I' '/Users/felipemouradeoliveira/nuttx-tests/apps/include' ./nsh_main.c
clang: error: unsupported argument 'medium' to option '-mcmodel=' for target 'arm64-apple-macosx26.0.0'
ERROR: cc failed: 1
       command: cc -MT ./mkfatfs.c.Users.felipemouradeoliveira.nuttx-tests.apps.fsutils.mkfatfs.o  -M '-g' '-fomit-frame-pointer' '-fno-common' '-fvisibility=hidden' '-ffunction-sections' '-fdata-sections' '-Wall' '-Wstrict-prototypes' '-Wshadow' '-Wundef' '-Wno-attributes' '-Wno-unknown-pragmas' '-fno-pic' '-mcmodel=medium' '-isystem' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/include' '-D__NuttX__' '-DNDEBUG' '-U_AIX' '-U_WIN32' '-U__APPLE__' '-U__FreeBSD__' '-U__NetBSD__' '-U__linux__' '-U__sun__' '-U__unix__' '-U__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' '-D__KERNEL__' '-I' '/Users/felipemouradeoliveira/nuttx-tests/apps/include' ./mkfatfs.c
clang: error: unsupported argument 'medium' to option '-mcmodel=' for target 'arm64-apple-macosx26.0.0'
clang: error: unsupported argument 'medium' to option '-mcmodel=' for target 'arm64-apple-macosx26.0.0'
clang: ERROR: cc failed: 1
       command: cc -MT ./dumpstack.c.Users.felipemouradeoliveira.nuttx-tests.apps.system.dumpstack.o  -M '-g' '-fomit-frame-pointer' '-fno-common' '-fvisibility=hidden' '-ffunction-sections' '-fdata-sections' '-Wall' '-Wstrict-prototypes' '-Wshadow' '-Wundef' '-Wno-attributes' '-Wno-unknown-pragmas' '-fno-pic' '-mcmodel=medium' '-isystem' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/include' '-D__NuttX__' '-DNDEBUG' '-U_AIX' '-U_WIN32' '-U__APPLE__' '-U__FreeBSD__' '-U__NetBSD__' '-U__linux__' '-U__sun__' '-U__unix__' '-U__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' '-D__KERNEL__' '-I' '/Users/felipemouradeoliveira/nuttx-tests/apps/include' ./dumpstack.c
error: unsupported argument 'medium' to option '-mcmodel=' for target 'arm64-apple-macosx26.0.0'
ERROR: cc failed: 1
ERROR: cc failed: 1
       command: cc -MT ./hello_main.c.Users.felipemouradeoliveira.nuttx-tests.apps.examples.hello.o  -M '-g' '-fomit-frame-pointer' '-fno-common' '-fvisibility=hidden' '-ffunction-sections' '-fdata-sections' '-Wall' '-Wstrict-prototypes' '-Wshadow' '-Wundef' '-Wno-attributes' '-Wno-unknown-pragmas' '-fno-pic' '-mcmodel=medium' '-isystem' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/include' '-D__NuttX__' '-DNDEBUG' '-U_AIX' '-U_WIN32' '-U__APPLE__' '-U__FreeBSD__' '-U__NetBSD__' '-U__linux__' '-U__sun__' '-U__unix__' '-U__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' '-D__KERNEL__' '-I' '/Users/felipemouradeoliveira/nuttx-tests/apps/include' ./hello_main.c
       command: cc -MT ./dummy.c.Users.felipemouradeoliveira.nuttx-tests.apps.platform.o  -M '-g' '-fomit-frame-pointer' '-fno-common' '-fvisibility=hidden' '-ffunction-sections' '-fdata-sections' '-Wall' '-Wstrict-prototypes' '-Wshadow' '-Wundef' '-Wno-attributes' '-Wno-unknown-pragmas' '-fno-pic' '-mcmodel=medium' '-isystem' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/include' '-D__NuttX__' '-DNDEBUG' '-U_AIX' '-U_WIN32' '-U__APPLE__' '-U__FreeBSD__' '-U__NetBSD__' '-U__linux__' '-U__sun__' '-U__unix__' '-U__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' '-D__KERNEL__' '-I' '/Users/felipemouradeoliveira/nuttx-tests/apps/include' ./board/dummy.c
ERROR: cc failed: 1
       command: cc -MT ./getopt.c.Users.felipemouradeoliveira.nuttx-tests.apps.testing.ostest.o  -M '-g' '-fomit-frame-pointer' '-fno-common' '-fvisibility=hidden' '-ffunction-sections' '-fdata-sections' '-Wall' '-Wstrict-prototypes' '-Wshadow' '-Wundef' '-Wno-attributes' '-Wno-unknown-pragmas' '-fno-pic' '-mcmodel=medium' '-isystem' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/include' '-D__NuttX__' '-DNDEBUG' '-U_AIX' '-U_WIN32' '-U__APPLE__' '-U__FreeBSD__' '-U__NetBSD__' '-U__linux__' '-U__sun__' '-U__unix__' '-U__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' '-D__KERNEL__' '-I' '/Users/felipemouradeoliveira/nuttx-tests/apps/include' ./getopt.c
clang: error: unsupported argument 'medium' to option '-mcmodel=' for target 'arm64-apple-macosx26.0.0'
ERROR: cc failed: 1
       command: cc -MT ./gpio_main.c.Users.felipemouradeoliveira.nuttx-tests.apps.examples.gpio.o  -M '-g' '-fomit-frame-pointer' '-fno-common' '-fvisibility=hidden' '-ffunction-sections' '-fdata-sections' '-Wall' '-Wstrict-prototypes' '-Wshadow' '-Wundef' '-Wno-attributes' '-Wno-unknown-pragmas' '-fno-pic' '-mcmodel=medium' '-isystem' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/include' '-D__NuttX__' '-DNDEBUG' '-U_AIX' '-U_WIN32' '-U__APPLE__' '-U__FreeBSD__' '-U__NetBSD__' '-U__linux__' '-U__sun__' '-U__unix__' '-U__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' '-D__KERNEL__' '-I' '/Users/felipemouradeoliveira/nuttx-tests/apps/include' ./gpio_main.c
clang: error: unsupported argument 'medium' to option '-mcmodel=' for target 'arm64-apple-macosx26.0.0'
ERROR: cc failed: 1
       command: cc -MT ./builtin_list.c.Users.felipemouradeoliveira.nuttx-tests.apps.builtin.o  -M '-g' '-fomit-frame-pointer' '-fno-common' '-fvisibility=hidden' '-ffunction-sections' '-fdata-sections' '-Wall' '-Wstrict-prototypes' '-Wshadow' '-Wundef' '-Wno-attributes' '-Wno-unknown-pragmas' '-fno-pic' '-mcmodel=medium' '-isystem' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/include' '-D__NuttX__' '-DNDEBUG' '-U_AIX' '-U_WIN32' '-U__APPLE__' '-U__FreeBSD__' '-U__NetBSD__' '-U__linux__' '-U__sun__' '-U__unix__' '-U__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' '-D__KERNEL__' '-I' '/Users/felipemouradeoliveira/nuttx-tests/apps/include' ./builtin_list.c
clang: error: unsupported argument 'medium' to option '-mcmodel=' for target 'arm64-apple-macosx26.0.0'
ERROR: cc failed: 1
       command: cc -MT ./nsh_init.c.Users.felipemouradeoliveira.nuttx-tests.apps.nshlib.o  -M '-g' '-fomit-frame-pointer' '-fno-common' '-fvisibility=hidden' '-ffunction-sections' '-fdata-sections' '-Wall' '-Wstrict-prototypes' '-Wshadow' '-Wundef' '-Wno-attributes' '-Wno-unknown-pragmas' '-fno-pic' '-mcmodel=medium' '-isystem' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/include' '-D__NuttX__' '-DNDEBUG' '-U_AIX' '-U_WIN32' '-U__APPLE__' '-U__FreeBSD__' '-U__NetBSD__' '-U__linux__' '-U__sun__' '-U__unix__' '-U__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' '-D__KERNEL__' '-I' '/Users/felipemouradeoliveira/nuttx-tests/apps/include' ./nsh_init.c
clang: error: unsupported argument 'medium' to option '-mcmodel=' for target 'arm64-apple-macosx26.0.0'
ERROR: cc failed: 1
       command: cc -MT ./readline.c.Users.felipemouradeoliveira.nuttx-tests.apps.system.readline.o  -M '-g' '-fomit-frame-pointer' '-fno-common' '-fvisibility=hidden' '-ffunction-sections' '-fdata-sections' '-Wall' '-Wstrict-prototypes' '-Wshadow' '-Wundef' '-Wno-attributes' '-Wno-unknown-pragmas' '-fno-pic' '-mcmodel=medium' '-isystem' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/include' '-D__NuttX__' '-DNDEBUG' '-U_AIX' '-U_WIN32' '-U__APPLE__' '-U__FreeBSD__' '-U__NetBSD__' '-U__linux__' '-U__sun__' '-U__unix__' '-U__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' '-D__KERNEL__' '-I' '/Users/felipemouradeoliveira/nuttx-tests/apps/include' ./readline.c
clang: error: unsupported argument 'medium' to option '-mcmodel=' for target 'arm64-apple-macosx26.0.0'
clang: error: unsupported argument 'medium' to option '-mcmodel=' for target 'arm64-apple-macosx26.0.0'
ERROR: cc failed: 1
       command: cc -MT ./clock.o  -M '-g' '-fomit-frame-pointer' '-fno-common' '-fvisibility=hidden' '-ffunction-sections' '-fdata-sections' '-Wall' '-Wstrict-prototypes' '-Wshadow' '-Wundef' '-Wno-attributes' '-Wno-unknown-pragmas' '-fno-pic' '-mcmodel=medium' '-isystem' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/include' '-D__NuttX__' '-DNDEBUG' '-U_AIX' '-U_WIN32' '-U__APPLE__' '-U__FreeBSD__' '-U__NetBSD__' '-U__linux__' '-U__sun__' '-U__unix__' '-U__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' '-D__KERNEL__' '-I' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/sched' ./clock/clock.c
ERROR: cc failed: 1
       command: cc -MT ./clock_gettime.o  -M '-g' '-fomit-frame-pointer' '-fno-common' '-fvisibility=hidden' '-ffunction-sections' '-fdata-sections' '-Wall' '-Wstrict-prototypes' '-Wshadow' '-Wundef' '-Wno-attributes' '-Wno-unknown-pragmas' '-fno-pic' '-mcmodel=medium' '-isystem' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/include' '-D__NuttX__' '-DNDEBUG' '-U_AIX' '-U_WIN32' '-U__APPLE__' '-U__FreeBSD__' '-U__NetBSD__' '-U__linux__' '-U__sun__' '-U__unix__' '-U__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' '-D__KERNEL__' '-I' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/sched' ./clock/clock_gettime.c
clang: error: unsupported argument 'medium' to option '-mcmodel=' for target 'arm64-apple-macosx26.0.0'
ERROR: cc failed: 1
       command: cc -MT ./clock_settime.o  -M '-g' '-fomit-frame-pointer' '-fno-common' '-fvisibility=hidden' '-ffunction-sections' '-fdata-sections' '-Wall' '-Wstrict-prototypes' '-Wshadow' '-Wundef' '-Wno-attributes' '-Wno-unknown-pragmas' '-fno-pic' '-mcmodel=medium' '-isystem' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/include' '-D__NuttX__' '-DNDEBUG' '-U_AIX' '-U_WIN32' '-U__APPLE__' '-U__FreeBSD__' '-U__NetBSD__' '-U__linux__' '-U__sun__' '-U__unix__' '-U__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' '-D__KERNEL__' '-I' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/sched' ./clock/clock_settime.c
clang: error: unsupported argument 'medium' to option '-mcmodel=' for target 'arm64-apple-macosx26.0.0'
gmake[2]: *** [/Users/felipemouradeoliveira/nuttx-tests/nuttx/tools/Config.mk:232: clock.ddc] Error 1
gmake[2]: *** Waiting for unfinished jobs....
gmake[2]: *** [/Users/felipemouradeoliveira/nuttx-tests/nuttx/tools/Config.mk:232: clock_gettime.ddc] Error 1
gmake[2]: *** [/Users/felipemouradeoliveira/nuttx-tests/nuttx/tools/Config.mk:232: clock_settime.ddc] Error 1
ERROR: cc failed: 1
       command: cc -MT ./clock_systime_timespec.o  -M '-g' '-fomit-frame-pointer' '-fno-common' '-fvisibility=hidden' '-ffunction-sections' '-fdata-sections' '-Wall' '-Wstrict-prototypes' '-Wshadow' '-Wundef' '-Wno-attributes' '-Wno-unknown-pragmas' '-fno-pic' '-mcmodel=medium' '-isystem' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/include' '-D__NuttX__' '-DNDEBUG' '-U_AIX' '-U_WIN32' '-U__APPLE__' '-U__FreeBSD__' '-U__NetBSD__' '-U__linux__' '-U__sun__' '-U__unix__' '-U__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' '-D__KERNEL__' '-I' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/sched' ./clock/clock_systime_timespec.c
clang: error: unsupported argument 'medium' to option '-mcmodel=' for target 'arm64-apple-macosx26.0.0'
clang: error: unsupported argument 'medium' to option '-mcmodel=' for target 'arm64-apple-macosx26.0.0'
gmake[2]: *** [/Users/felipemouradeoliveira/nuttx-tests/nuttx/tools/Config.mk:232: clock_systime_timespec.ddc] Error 1
ERROR: cc failed: 1
       command: cc -MT ./clock_initialize.o  -M '-g' '-fomit-frame-pointer' '-fno-common' '-fvisibility=hidden' '-ffunction-sections' '-fdata-sections' '-Wall' '-Wstrict-prototypes' '-Wshadow' '-Wundef' '-Wno-attributes' '-Wno-unknown-pragmas' '-fno-pic' '-mcmodel=medium' '-isystem' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/include' '-D__NuttX__' '-DNDEBUG' '-U_AIX' '-U_WIN32' '-U__APPLE__' '-U__FreeBSD__' '-U__NetBSD__' '-U__linux__' '-U__sun__' '-U__unix__' '-U__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' '-D__KERNEL__' '-I' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/sched' ./clock/clock_initialize.c
ERROR: cc failed: 1
       command: cc -MT ./clock_realtime2absticks.o  -M '-g' '-fomit-frame-pointer' '-fno-common' '-fvisibility=hidden' '-ffunction-sections' '-fdata-sections' '-Wall' '-Wstrict-prototypes' '-Wshadow' '-Wundef' '-Wno-attributes' '-Wno-unknown-pragmas' '-fno-pic' '-mcmodel=medium' '-isystem' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/include' '-D__NuttX__' '-DNDEBUG' '-U_AIX' '-U_WIN32' '-U__APPLE__' '-U__FreeBSD__' '-U__NetBSD__' '-U__linux__' '-U__sun__' '-U__unix__' '-U__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' '-D__KERNEL__' '-I' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/sched' ./clock/clock_realtime2absticks.c
clang: error: unsupported argument 'medium' to option '-mcmodel=' for target 'arm64-apple-macosx26.0.0'
clang: error: unsupported argument 'medium' to option '-mcmodel=' for target 'arm64-apple-macosx26.0.0'
ERROR: cc failed: 1
       command: cc -MT ./clock_systime_ticks.o  -M '-g' '-fomit-frame-pointer' '-fno-common' '-fvisibility=hidden' '-ffunction-sections' '-fdata-sections' '-Wall' '-Wstrict-prototypes' '-Wshadow' '-Wundef' '-Wno-attributes' '-Wno-unknown-pragmas' '-fno-pic' '-mcmodel=medium' '-isystem' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/include' '-D__NuttX__' '-DNDEBUG' '-U_AIX' '-U_WIN32' '-U__APPLE__' '-U__FreeBSD__' '-U__NetBSD__' '-U__linux__' '-U__sun__' '-U__unix__' '-U__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' '-D__KERNEL__' '-I' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/sched' ./clock/clock_systime_ticks.c
gmake[2]: *** [/Users/felipemouradeoliveira/nuttx-tests/nuttx/tools/Config.mk:232: clock_realtime2absticks.ddc] Error 1
gmake[2]: *** [/Users/felipemouradeoliveira/nuttx-tests/nuttx/tools/Config.mk:232: clock_initialize.ddc] Error 1
clang: error: unsupported argument 'medium' to option '-mcmodel=' for target 'arm64-apple-macosx26.0.0'
clang: lang: error: unsupported argument 'medium' to option '-mcmodel=' for target 'arm64-apple-macosx26.0.0'
clang: error: unsupported argument 'medium' to option '-mcmodel=' for target 'arm64-apple-macosx26.0.0'
ERROR: cc failed: 1
       command: cc -MT ./group_leave.o  -M '-g' '-fomit-frame-pointer' '-fno-common' '-fvisibility=hidden' '-ffunction-sections' '-fdata-sections' '-Wall' '-Wstrict-prototypes' '-Wshadow' '-Wundef' '-Wno-attributes' '-Wno-unknown-pragmas' '-fno-pic' '-mcmodel=medium' '-isystem' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/include' '-D__NuttX__' '-DNDEBUG' '-U_AIX' '-U_WIN32' '-U__APPLE__' '-U__FreeBSD__' '-U__NetBSD__' '-U__linux__' '-U__sun__' '-U__unix__' '-U__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' '-D__KERNEL__' '-I' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/sched' ./group/group_leave.c
ERROR: cc failed: 1
       command: cc -MT ./env_getenv.o  -M '-g' '-fomit-frame-pointer' '-fno-common' '-fvisibility=hidden' '-ffunctiongmake[2]: *** [/Users/felipemouradeoliveira/nuttx-tests/nuttx/tools/Config.mk:232: clock_systime_ticks.ddc] Error 1
ERROR: cc failed: 1
       command: cc -MT ./env_findvar.o  -M '-g' '-fomit-frame-pointer' '-fno-common' '-fvisibility=hidden' '-ffunction-sections' '-fdata-sections' '-Wall' '-Wstrict-prototypes' '-Wshadow' '-Wundef' '-Wno-attributes' '-Wno-unknown-pragmas' '-fno-pic' '-mcmodel=medium' '-isystem' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/include' '-D__NuttX__' '-DNDEBUG' '-U_AIX' '-U_WIN32' '-U__APPLE__' '-U__FreeBSD__' '-U__NetBSD__' '-U__linux__' '-U__sun__' '-U__unix__' '-U__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' '-D__KERNEL__' '-I' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/sched' ./environ/env_findvar.c
clang: error: unsupported argument 'medium' to option '-mcmodel=' for target 'arm64-apple-macosx26.0.0'
-sections' '-fdata-sections' '-Wall' '-Wstrict-prototypes' '-Wshadow' '-Wundef' '-Wno-attributes' '-Wno-unknown-pragmas' '-fno-pic' '-mcmodel=medium' '-isystem' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/include' '-D__NuttX__' '-DNDEBUG' '-U_AIX' '-U_WIN32' '-U__APPLE__' '-U__FreeBSD__' '-U__NetBSD__' '-U__linux__' '-U__sun__' '-U__unix__' '-U__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' '-D__KERNEL__' '-I' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/sched' ./environ/env_getenv.c
31merror: unsupported argument 'medium' to option '-mcmodel=' for target 'arm64-apple-macosx26.0.0'
clang: error: unsupported argument 'medium' to option '-mcmodel=' for target 'arm64-apple-macosx26.0.0'
gmake[2]: *** [/Users/felipemouradeoliveira/nuttx-tests/nuttx/tools/Config.mk:232: group_leave.ddc] Error 1
clang: error: unsupported argument 'medium' to option '-mcmodel=' for target 'arm64-apple-macosx26.0.0'
^[[?1;2cERROR: cc failed: 1
       command: cc -MT ./env_release.o  -M '-g' '-fomit-frame-pointer' '-fno-common' '-fvisibility=hidden' '-ffunction-sections' '-fdata-sections' '-Wall' '-Wstrict-prototypes' '-Wshadow' '-Wundef' '-Wno-attributes' '-Wno-unknown-pragmas' '-fno-pic' '-mcmodel=medium' '-isystem' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/include' '-D__NuttX__' '-DNDEBUG' '-U_AIX' '-U_WIN32' '-U__APPLE__' '-U__FreeBSD__' '-U__NetBSD__' '-U__linux__' '-U__sun__' '-U__unix__' '-U__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' '-D__KERNEL__' '-I' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/sched' ./environ/env_release.c
ERROR: cc failed: 1
       command: cc -MT ./env_getenvironptr.o  -M '-g' '-fomit-frame-pointer' '-fno-common' '-fvisibility=hidden' '-ffunctionERROR: cc failed: 1
       command: cc -MT ./env_clearenv.o  -M '-g' '-fomit-frame-pointer' '-fno-common' '-fvisibility=hidden' '-ffunction-sections' '-fdata-sections' '-Wall' '-Wstrict-prototypes' '-Wshadow' '-Wundef' '-Wno-attributes' '-Wno-unknown-pragmas' '-fno-pic' '-mcmodel=medium' '-isystem' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/include' '-D__NuttX__' '-DNDEBUG' '-U_AIX' '-U_WIN32' '-U__APPLE__' '-U__FreeBSD__' '-U__NetBSD__' '-U__linux__' '-U__sun__' '-U__unix__' '-U__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' '-D__KERNEL__' '-I' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/sched' ./environ/env_clearenv.c
clang: error: unsupported argument 'medium' to option '-mcmodel=' for target 'arm64-apple-macosx26.0.0'
-sections' '-fdata-sections' '-Wall' '-Wstrict-prototypes' '-Wshadow' '-Wundef' '-Wno-attributes' '-Wno-unknown-pragmas' '-fno-pic' '-mcmodel=medium' '-isystem' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/include' '-D__NuttX__' '-DNDEBUG' '-U_AIX' '-U_WIN3clang: error: unsupported argument 'medium' to option '-mcmodel=' for target 'arm64-apple-macosx26.0.0'
ERROR: cc failed: 1
       command: cc -MT ./env_setenv.o  -M '-g' '-fomit-frame-pointer' '-fno-common' '-fvisibility=hidden' '-ffunction-sections' '-fdata-sections' '-Wall' '-Wstrict-prototypes' '-Wshadow' '-Wundef' '-Wno-attributes' '-Wno-unknown-pragmas' '-fno-pic' '-mcmodel=medium' '-isystem' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/include' '-D__NuttX__' '-DNDEBUG' '-U_AIX' '-U_WIN32' '-U__APPLE__' '-U__FreeBSD__' '-U__NetBSD__' '-U__linux__' '-U__sun__' '-U__unix__' '-U__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' '-D__KERNEL__' '-I' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/sched' ./environ/env_setenv.c
ERROR: cc failed: 1
       command: cc -MT ./env_removevar.o  -M '-g' '-fomit-frame-pointer' '-fno-common' '-fvisibility=hidden' '-ffunction-sections' '-fdata-sections' '-Wall' '-Wstrict-prototypes' '-Wshadow' '-Wundef' '-Wno-attributes' '-Wno-unknown-pragmas' '-fno-pic' '-mcmodel=medium' '-isystem' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/include' '-D__NuttX__' '-DNDEBUG' '-U_AIX' '-U_WIN32' '-U__APPLE__' '-U__FreeBSD__' '-U__NetBSD__' '-U__linux__' '-U__sun__' '-U__unix__' '-U__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' '-D__KERNEL__' '-I' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/sched' ./environ/env_removevar.c
2' '-U__APPLE__' '-U__FreeBSD__' '-U__NetBSD__' '-U__linux__' '-U__sun__' '-U__unix__' '-U__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' '-D__KERNEL__' '-I' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/sched' ./environ/env_getenvironptr.c
gmake[2]: *** [/Users/felipemouradeoliveira/nuttx-tests/nuttx/tools/Config.mk:232: env_getenv.ddc] Error 1
gmake[2]: *** [/Users/felipemouradeoliveira/nuttx-tests/nuttx/tools/Config.mk:232: env_clearenv.ddc] Error 1
gmake[2]: *** [/Users/felipemouradeoliveira/nuttx-tests/nuttx/tools/Config.mk:232: env_findvar.ddc] Error 1
gmake[2]: *** [/Users/felipemouradeoliveira/nuttx-tests/nuttx/tools/Config.mk:clang: error: unsupported argument 'medium' to option '-mcmodel=' for target 'arm64-apple-macosx26.0.0'
clang: error: unsupported argument 'medium' to option '-mcmodel=' for target 'arm64-apple-macosx26.0.0'
232: env_release.ddc] Error 1
gmake[2]: *** [/Users/felipemouradeoliveira/nuttx-tests/nuttx/tools/Config.mk:232: env_setenv.ddc] Error 1
clang: error: unsupported argument 'medium' to option '-mcmodel=' for target 'arm64-apple-macosx26.0.0'
clang: error: unsupported argument 'medium' to option '-mcmodel=' for target 'arm64-apple-macosx26.0.0'
clang: error: unsupported argument 'medium' to option '-mcmodel=' for target 'arm64-apple-macosx26.0.0'
ERROR: cc failed: 1
       command: cc -MT ./env_dup.o  -M '-g' '-fomit-frame-pointer' '-fno-common' '-fvisibility=hidden' '-ffunction-sections' '-fdata-sections' '-Wall' '-Wstrict-prototypes' '-Wshadow' '-Wundef' '-Wno-attributes' '-Wno-unknown-pragmas'gmake[2]: *** [/Users/felipemouradeoliveira/nuttx-tests/nuttx/tools/Config.mk:232: env_getenvironptr.ddc] Error 1
gmake[2]: *** [/Users/felipemouradeoliveira/nuttx-tests/nuttx/tools/Config.mk:232: env_removevar.ddc] Error 1
 '-fno-pic' '-mcmodel=medium' '-isystem' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/include' '-D__NuttX__' '-DNDEBUG' '-U_AIX' '-U_WIN32' '-U__APPLE__' '-U__FreeBSD__' '-U__NetBSD__' '-U__linux__' '-U__sun__' '-U__unix__' '-U__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' '-D__KERNEL__' '-I' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/sched' ./environ/env_dup.c
clang: error: unsupported argument 'medium' to option '-mcmodel=' for target 'arm64-apple-macosx26.0.0'
ERROR: cc failed: 1
       command: cc -MT ./group_join.o  -M '-g' '-fomit-frame-pointer' '-fno-common' '-fvisibility=hidden' '-ffunction-sections' '-fdata-sections' '-Wall' '-Wstrict-prototypes' '-Wshadow' '-Wundef' '-Wno-attributes' '-Wno-unknown-pragmas' '-fno-pic' '-mcmodel=medium' '-isystem' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/include' '-D__NuttX__' '-DNDEBUG' '-U_AIX' '-U_WIN32' '-U__APPLE__' '-U__FreeBSD__' '-U__NetBSD__' '-U__linux__' '-U__sun__' '-U__unix__' '-U__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' '-D__KERNEL__' '-I' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/sched' ./group/group_join.c
clang: error: unsupported argument 'medium' to option '-mcmodel=' for target 'arm64-apple-macosx26.0.0'
gmake[2]: *** [/Users/felipemouradeoliveira/nuttx-tests/nuttx/tools/Config.mk:232: group_join.ddc] Error 1
gmake[2]: *** [/Users/felipemouradeoliveira/nuttx-tests/nuttx/tools/Config.mk:232: env_dup.ddc] Error 1
clang: error: unsupported argument 'medium' to option '-mcmodel=' for target 'arm64-apple-macosx26.0.0'
clang: error: unsupported argument 'medium' to option '-mcmodel=' for target 'arm64-apple-macosx26.0.0'
ERROR: cc failed: 1
       command: cc -MT ./event_init.o  -M '-g' '-fomit-frame-pointer' '-fno-common' '-fvisibility=hidden' '-ffunction-sections' '-fdata-sections' '-Wall' '-Wstrict-prototypes' '-Wshadow' '-Wundef' '-Wno-attributes' '-Wno-unknown-pragmas' '-fno-pic' '-mcmodel=medium' '-isystem' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/include' '-D__NuttX__' '-DNDEBUG' '-U_AIX' '-U_WIN32' '-U__APPLE__' '-U__FreeBSD__' '-U__NetBSD__' '-U__linux__' '-U__sun__' '-U__unix__' '-U__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' '-D__KERNEL__' '-I' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/sched' ./event/event_init.c
ERROR: cc failed: 1
       command: cc -MT ./clock_perf.o  -M '-g' '-fomit-frame-pointer' '-fno-common' '-fvisibility=hidden' '-ffunction-sections' '-fdata-sections' '-Wall' '-Wstrict-prototypes' '-Wshadow' '-Wundef' '-Wno-attributes' '-Wno-unknown-pragmas' '-fno-pic' '-mcmodel=medium' '-isystem' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/include' '-D__NuttX__' '-DNDEBUG' '-U_AIX' '-U_WIN32' '-U__APPLE__' '-U__FreeBSD__' '-U__NetBSD__' '-U__linux__' '-U__sun__' '-U__unix__' '-U__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' '-D__KERNEL__' '-I' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/sched' ./clock/clock_perf.c
ERROR: cc failed: 1
       command: cc -MT ./event_destroy.o  -M '-g' '-fomit-frame-pointer' '-fno-common' '-fvisibility=hidden' '-ffunction-sections' '-fdata-sections' '-Wall' '-Wstrict-prototypes' '-Wshadow' '-Wundef' '-Wno-attributes' '-Wno-unknown-pragmas' '-fno-pic' '-mcmodel=medium' '-isystem' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/include' '-D__NuttX__' '-DNDEBUG' '-U_AIX'clang: error: unsupported argument 'medium' to option '-mcmodel=' for target 'arm64-apple-macosx26.0.0'
gmake[2]: *** [/Users/felipemouradeoliveira/nuttx-tests/nuttx/tools/Config.mk:232: event_init.ddc] Error 1
ERROR: cc failed: 1
       command: cc -MT ./event_post.o  -M '-g' '-fomit-frame-pointer' '-fno-common' '-fvisibility=hidden' '-ffunction-sections' '-fdata-sections' '-Wall' '-Wstrict-prototypes' '-Wshadow' '-Wundef' '-Wno-attributes' '-Wno-unknown-pragmas' '-fno-pic' '-mcmodel=medium' '-isystem' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/include' '-D__NuttX__' '-DNDEBUG' '-U_AIX' '-U_WIN32' '-U__APPLE__' '-U__FreeBSD__' '-U__NetBSD__' '-U__linux__' '-U__sun__' '-U__unix__' '-U__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' '-D__KERNEL__' '-I' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/sched' ./event/event_post.c
 '-U_WIN32' '-U__APPLE__' '-U__FreeBSD__' '-U__NetBSD__' '-U__linux__' '-U__sun__' '-U__unix__' '-U__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' '-D__KERNEL__' '-I' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/sched' ./event/event_destroy.c
clang: error: ERROR: cc failed: 1
unsupported argument 'medium' to option '-mcmodel=' for target 'arm64-apple-macosx26.0.0'
       command: cc -MT ./group_foreachchild.o  -M '-g' '-fomit-frame-pointer' '-fno-common' '-fvisibility=hidden' '-ffunction-sections' '-fdata-sections' '-Wall' '-Wstrict-prototypes' '-Wshadow' '-Wundef' '-Wno-attributes' '-Wno-unknown-pragmas' '-fno-pic' '-mcmodel=medium' '-isystem' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/include' '-D__NuttX__' '-DNDEBUG' '-U_AIX' '-U_WIN32' '-U__APPLE__' '-U__FreeBSD__' '-U__NetBSD__' '-U__linux__' '-U__sun__' '-U__unix__' '-U__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' '-D__KERNEL__' '-I' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/sched' ./group/group_foreachchild.c
clang: error: unsupported argument 'medium' to option '-mcmodel=' for target 'arm64-apple-macosx26.0.0'
ERROR: cc failed: 1
       command: cc -MT ./event_wait.o  -M '-g' '-fomit-frame-pointer' '-fno-common' '-fvisibility=hidden' '-ffunction-sections' '-fdata-sections' '-Wall' '-Wstrict-prototypes' '-Wshadow' '-Wundef' '-Wno-attributes' '-Wno-unknown-pragmas' '-fno-pic' '-mcmodel=medium' '-isystem' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/include' '-D__NuttX__' '-DNDEBUG' '-U_AIX' '-U_WIN32' '-U__APPLE__' '-U__FreeBSD__' '-U__NetBSD__' '-U__linux__' '-U__sun__' '-U__unix__' '-U__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' '-D__KERNEL__' '-I' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/sched' ./event/event_wait.c
ERROR: cc failed: 1
       command: cc -MT ./env_unsetenv.o  -M '-g' '-fomit-frame-pointer' '-fno-common' '-fvisibility=hidden' '-ffunction-sections' '-fdata-sections' '-Wall' '-Wstrict-prototypes' '-Wshadow' '-Wundef' '-Wno-attributes' '-Wno-unknown-pragmas' '-fnoclang: error: unsupported argument 'medium' to option '-mcmodel=' for target 'arm64-apple-macosx26.0.0'
clang: error: unsupported argument 'medium' to option '-mcmodel=' for target 'arm64-apple-macosx26.0.0'
-pic' '-mcmodel=medium' '-isystem' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/include' '-D__NuttX__' '-DNDEBUG' '-U_AIX' '-U_WIN32' '-U__APPLE__' '-U__FreeBSD__' '-U__NetBSD__' '-U__linux__' '-U__sun__' '-U__unix__' '-U__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' '-D__KERNEL__' '-I' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/sched' ./environ/env_unsetenv.c
gmake[2]: *** [/Users/felipemouradeoliveira/nuttx-tests/nuttx/tools/Config.mk:232: event_post.ddc] Error 1
gmake[2]: *** [/Users/felipemouradeoliveira/nuttx-tests/nuttx/tools/Config.mk:232: event_wait.ddc] Error 1
gmake[2]: *** [/Users/felipemouradeoliveira/nuttx-tests/nuttx/tools/Config.mk:232: clock_perf.ddc] Error 1
ERROR: cc failed: 1
       command: cc -MT ./group_signal.o  -M '-g' '-fomit-frame-pointer' '-fno-common' '-fvisibility=hidden' '-ffunction-sections' '-fdata-sections' '-Wall' '-Wstrict-prototypes' '-Wshadow' '-Wundef' '-Wno-attributes' '-Wno-unknown-pragmas' '-fno-pic' '-mcmodel=medium' '-isystem' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/include' '-D__NuttX__' '-DNDEBUG' '-U_AIX' '-U_WIN32' '-U__APPLE__' '-U__FreeBSD__' '-U__NetBSD__' '-U__linux__' '-U__sun__' '-U__unix__' '-U__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' '-D__KERNEL__' '-I' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/sched' ./group/group_signal.c
ERROR: cc failed: 1
       command: cc -MT ./group_create.o  -M '-g' '-fomit-frame-pointer' '-fno-common' '-fvisibility=hidden' '-ffunction-sections' '-fdata-sections' '-Wall' '-Wstrict-prototypes' '-Wshadow' '-Wundef' '-Wno-attributes' '-Wno-unknown-pragmas' '-fno-pic' '-mcmodel=medium' '-isystem' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/include' '-D__NuttX__' '-DNDEBUG' '-U_AERROR: cc failed: 1
       command: cc -MT ./event_reset.o  -M '-g' '-fomit-frame-pointer' '-fno-common' '-fvisibility=hidden' '-ffunction-sections' '-fdata-sections' '-Wall' '-Wstrict-prototypes' '-Wshadow' '-Wundef' '-Wno-attributes' '-Wno-unknown-pragmas' '-fno-pic' '-mcmodel=medium' '-isystem' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/include' '-D__NuttX__' '-DNDEBUG' '-U_AIX' '-U_WIN32' '-U__APPLE__' '-U__FreeBSD__' '-U__NetBSD__' '-U__linux__' '-U__sun__' '-U__unix__' '-U__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' '-D__KERNEL__' '-I' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/sched' ./event/event_reset.c
gmake[2]: *** [/Users/felipemouradeoliveira/nuttx-tests/nuttx/tools/Config.mk:232: env_unsetenv.ddc] Error 1
gmake[2]: *** [/Users/felipemouradeoliveira/nuttx-tests/nuttx/tools/Config.mk:232: event_reset.ddc] Error 1
clang: error: unsupported argument 'medium' to option '-mcmodel=' for target 'arm64-apple-macosx26.0.0'
ERROR: cc failed: 1
       command: cc -MT ./group_setuptaskfiles.o  -M '-g' '-fomit-frame-pointer' '-fno-common' '-fvisibility=hidden' '-ffunction-sections' '-fdata-sections' '-Wall' '-Wstrict-prototypes' '-Wshadow' '-Wundef' '-Wno-attributes' '-Wno-unknown-pragmas' '-fno-pic' '-mcmodel=medium' '-isystem' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/include' '-D__NuttX__' '-DNDEBUG' '-U_AIX' '-U_WIN32' '-U__APPLE__' '-U__FreeBSD__' '-U__NetBSD__' '-U__linux__' '-U__sun__' '-U__unix__' '-U__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' '-D__KERNEL__' '-I' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/sched' ./group/group_setuptaskfiles.c
clang: error: unsupported argument 'medium' to option '-mcmodel=' for target 'arm64-apple-macosx26.0.0'
clangERROR: cc failed: 1
:        command: cc -MT ./irq_initialize.o  -M '-g' '-fomit-frame-pointer' '-fno-common' '-fvisibility=hidden' '-ffunction-sections' '-fdata-sections' '-Wall' '-Wstrict-prototypes' '-Wshadow' '-Wundef' '-Wno-attributes' '-Wno-unknown-pragmas' '-fno-pic' '-mcmodel=medium' '-isystem' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/include' '-D__NuttX__' '-DNDEBUG' '-U_AIX' '-U_WIN32' '-U__APPLE__' '-U__FreeBSD__' '-U__NetBSD__' '-U__linux__' '-U__sun__' '-U__unix__' '-U__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' '-D__KERNEL__' '-I' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/sched' ./irq/irq_initialize.c
error: unsupported argument 'medium' to option '-mcmodel=' for target 'arm64-apple-macosx26.0.0'
clang: error: unsupported argument 'medium' to option '-mcmodel=' for target 'arm64-apple-macosx26.0.0'
clang: error: unsupported argument 'medium' to option '-mcmodel=' for target 'arm64-apple-macosx26.0.0'
gmake[2]: *** [/Users/felipemouradeoliveira/nuttx-tests/nuttx/tools/Config.mk:232: group_signal.ddc] Error 1
gmake[2]: *** [/Users/felipemouradeoliveira/nuttx-tests/nuttx/tools/Config.mk:232: group_foreachchild.ddc] Error 1
gmake[2]: *** [/Users/felipemouradeoliveira/nuttx-tests/nuttx/tools/Conficlang: error: unsupported argument 'medium' to option '-mcmodel=' for target 'arm64-apple-macosx26.0.0'
g.mk:232: group_setuptaskfiles.ddc] Error 1
IX' '-U_WIN32' '-U__APPLE__' '-U__FreeBSD__' '-U__NetBSD__' '-U__linux__' '-U__sun__' '-U__unix__' '-U__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' '-D__KERNEL__' '-I' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/sched' ./group/group_create.c
gmake[2]: *** [/Users/felipemouradeoliveira/nuttx-tests/nuttx/tools/Config.mk:232: irq_initialize.ddc] Error 1
gmake[2]: *** [/Users/felipemouradeoliveira/nuttx-tests/nuttx/tools/Config.mk:232: event_destroy.ddc] Error 1
ERROR: cc failed: 1
       command: cc -MT ./group_setupidlefiles.o  -M '-g' '-fomit-frame-pointer' '-fno-common' '-fvisibility=hidden' '-ffunction-sections' '-fdata-sections' '-Wall' '-Wstrict-prototypes' '-Wshadow' '-Wundef' '-Wno-attributes' '-Wno-unknown-pragmas' '-fno-pic' '-mcmodel=medium' '-isystem' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/include' '-D__NuttX__' '-ERROR: cc failed: 1
       command: cc -MT ./nx_bringup.o  -M '-g' '-fomit-frame-pointer' '-fno-common' '-fvisibility=hidden' '-ffunction-sections' '-fdata-sections' '-Wall' '-Wstrict-prototypes' '-Wshadow' '-Wundef' '-Wno-attributes' '-Wno-unknown-pragmas' '-fno-pic' '-mcmodel=medium' '-isystem' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/include' '-D__NuttX__' '-DNDEBUG' '-U_AIX' '-U_WIN32' '-U__APPLE__' '-U__FreeBSD__' '-U__NetBSD__' '-U__linux__' '-U__sun__' '-U__unix__' '-U__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' '-D__KERNEL__' '-I' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/sched' ./init/nx_bringup.c
ERROR: cc failed: 1
       command: cc -MT ./group_killchildren.o  -M '-g' '-fomit-frame-pointer' '-fno-common' '-fvisibility=hidden' '-ffunction-sections' '-fdata-sections' '-Wall' '-Wstrict-prototypes' '-Wshadow' '-Wundef' '-Wno-attributes' '-Wno-unknown-pragmas' '-fno-pic' '-mcmodel=medium' '-isystem' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/include' '-D__NuttX__' '-DNDEBUG' '-U_ERROR: cc failed: 1
       command: cc -MT ./irq_dispatch.o  -M '-g' '-fomit-frame-pointer' '-fno-common' '-fvisibility=hidden' '-ffunction-sections' '-fdata-sections' '-Wall' '-Wstrict-prototypes' '-Wshadow' '-Wundef' '-Wno-attributes' '-Wno-unknown-pragmas' '-fno-pic' '-mcmodel=medium' '-isystem' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/include' '-D__NuttX__' '-DNDEBUG' '-U_AIX' '-U_WIN32' '-U__APPLE__' '-U__FreeBSD__' '-U__NetBSD__' '-U__linux__' '-U__sun__' '-U__unix__' '-U__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' '-D__KERNEL__' '-I' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/sched' ./irq/irq_dispatch.c
AIX' '-U_WIN32' '-U__APPLE__' '-U__FreeBSD__' '-U__NetBSD__' '-U__linux__' '-U__sun__' '-U__unix__' '-U__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' '-D__KERNEL__' '-I' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/sched' ./group/group_killchildren.c
DNDEBUG' '-U_AIX' '-U_WIN32' '-U__APPLE__' '-U__FreeBSD__' '-U__NetBSD__' '-U__linux__' '-U__sun__' '-U__unix__' '-U__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' '-D__KERNEL__' '-I' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/sched' ./group/group_setupidlefiles.c
ERROR: cc failed: 1
       command: cc -MT ./env_foreach.o  -M '-g' '-fomit-frame-pointer' '-fno-common' '-fvisibility=hidden' '-ffunction-sections' '-fdata-sections' '-Wall' '-Wstrict-prototypes' '-Wshadow' '-Wundef' '-Wno-attributes' '-Wno-unknown-pragmas' '-fno-pic' '-mcmodel=medium' '-isystem' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/include' '-D__NuttX__' '-DNDEBUG' '-U_AIX' '-U_WIN32' '-U__APPLE__' '-U__FreeBSD__' '-U__NetBSD__' '-U__linux__' '-U__sun__' '-U__unix__' '-U__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' '-D__KERNEL__' '-I' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/sched' ./environ/env_foreach.c
ERROR: cc failed: 1
       command: cc -MT ./env_putenv.o  -M '-g' '-fomit-frame-pointer' '-fno-common' '-fvisibility=hidden' '-ffunction-sections' '-fdata-sections' '-Wall' '-Wstrict-prototypes' '-Wshadow' '-Wundef' '-Wno-attributes' '-Wno-unknown-pragmake[2]: *** [/Users/felipemouradeoliveira/nuttx-tests/nuttx/tools/Config.mk:232: group_create.ddc] Error 1
ERROR: cc failed: 1
ERROR: cc failed: 1
       command: cc -MT ./nx_start.o  -M '-g' '-fomit-frame-pointer' '-fno-common' '-fvisibility=hidden' '-ffunction-sections' '-fdata-sections' '-Wall' '-Wstrict-prototypes' '-Wshadow' '-Wundef' '-Wno-attributes' '-Wno-unknown-pragmas' '-fno-pic' '-mcmodel=medium' '-isystem' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/include' '-D__NuttX__' '-DNDEBUG' '-U_AIX' '-U_WIN32' '-U__APPLE__' '-U__FreeBSD__' '-U__NetBSD__' '-U__linux__' '-U__sun__' '-U__unix__' '-U__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' '-D__KERNEL__' '-I' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/sched' ./init/nx_start.c
       command: cc -MT ./irq_unexpectedisr.o  -M '-g' '-fomit-frame-pointer' '-fno-common' '-fvisibility=hidden' '-ffunction-sections' '-fdata-sections' '-Wall' '-Wstrict-prototypes' '-Wshadow' '-Wundef' '-Wno-attributes' '-Wno-unknown-pragmas' '-fno-pic' '-mcmodel=medium' '-isystem' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/include' '-D__NuttX__' '-DNDEBUG' '-U_AIX' '-U_WIN32' '-U__APPLE__' '-U__FreeBSD__' '-U__NetBSD__' '-U__linux__' '-U__sun__' '-U__unix__' '-U__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' '-D__KERNEL__' '-I' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/sched' ./irq/irq_unexpectedisr.c
gmake[2]: *** [/Users/felipemouradeoliveira/nuttx-tests/nuttx/tools/Config.mk:232: irq_dispatch.ddc] Error 1
gmake[2]: *** [/Users/felipemouradeoliveira/nuttx-tests/nuttx/tools/Config.mk:232: nx_bringup.ddc] Error 1
gmas' '-fno-pic' '-mcmodel=medium' '-isystem' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/include' '-D__NuttX__' '-DNDEBUG' '-U_AIX' '-U_WIN32' '-U__APPLE__' '-U__FreeBSD__' '-U__NetBSD__' '-U__linux__' '-U__sun__' '-U__unix__' '-U__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' '-D__KERNEL__' '-I' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/sched' ./environ/env_putenv.c
gmake[2]: *** [/Users/felipemouradeoliveira/nuttx-tests/nuttx/tools/Config.mk:232: group_killchildren.ddc] Error 1
gmake[2]: *** [/Users/felipemouradeoliveira/nuttx-tests/nuttx/tools/Config.mk:232: env_foreach.ddc] Error 1
gmake[2]: *** [/Users/felipemouradeoliveira/nuttx-tests/nuttx/tools/Config.mk:232: group_setupidlefiles.ddc] Error 1
gmake[2]: *** [/Users/felipemouradeoliveira/nuttx-tests/nuttx/tools/Config.mk:232: irq_unexpectedisr.ddc] Error 1
gmake[2]: *** [/Users/felipemouradeoliveira/nuttx-tests/nuttx/tools/Config.mk:232: nx_start.ddc] Error 1
gmake[2]: *** [/Users/felipemouradeoliveira/nuttx-tests/nuttx/tools/Config.mk:232: env_putenv.ddc] Error 1
clang: error: unsupported argument 'medium' to option '-mcmodel=' for target 'arm64-apple-macosx26.0.0'
ERROR: cc failed: 1
       command: cc -MT ./irq_attach.o  -M '-g' '-fomit-frame-pointer' '-fno-common' '-fvisibility=hidden' '-ffunction-sections' '-fdata-sections' '-Wall' '-Wstrict-prototypes' '-Wshadow' '-Wundef' '-Wno-attributes' '-Wno-unknown-pragmas' '-fno-pic' '-mcmodel=medium' '-isystem' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/include' '-D__NuttX__' '-DNDEBUG' '-U_AIX' '-U_WIN32' '-U__APPLE__' '-U__FreeBSD__' '-U__NetBSD__' '-U__linux__' '-U__sun__' '-U__unix__' '-U__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' '-D__KERNEL__' '-I' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/sched' ./irq/irq_attach.c
gmake[2]: *** [/Users/felipemouradeoliveira/nuttx-tests/nuttx/tools/Config.mk:232: irq_attach.ddc] Error 1
clang: error: unsupported argument 'medium' to option '-mcmodel=' for target 'arm64-apple-macosx26.0.0'
ERROR: cc failed: 1
       command: cc -MT ./instrument.o  -M '-g' '-fomit-frame-pointer' '-fno-common' '-fvisibility=hidden' '-ffunction-sections' '-fdata-sections' '-Wall' '-Wstrict-prototypes' '-Wshadow' '-Wundef' '-Wno-attributes' '-Wno-unknown-pragmas' '-fno-pic' '-mcmodel=medium' '-isystem' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/include' '-D__NuttX__' '-DNDEBUG' '-U_AIX' '-U_WIN32' '-U__APPLE__' '-U__FreeBSD__' '-U__NetBSD__' '-U__linux__' '-U__sun__' '-U__unix__' '-U__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' '-D__KERNEL__' '-I' '/Users/felipemouradeoliveira/nuttx-tests/nuttx/sched' ./instrument/instrument.c
gmake[2]: *** [/Users/felipemouradeoliveira/nuttx-tests/nuttx/tools/Config.mk:232: instrument.ddc] Error 1
gmake[1]: *** [Makefile:74: .depend] Error 2
gmake: *** [tools/Unix.mk:630: pass2dep] Error 2

@raiden00pl
Copy link
Member

@aditya0yadav I don't get it why you try to use gcc when gcc is not supported on your host. Just change CONFIG_SIM_TOOLCHAIN_GCC to CONFIG_SIM_TOOLCHAIN_CLANG. If Mac uses Clang as default, then you should change your defconfig to use Clang, not secretly overwrite configurations in the build system.
CONFIG_COVERAGE_TOOLCHAIN is GCC specific and it is clearly provided by configuration:

config COVERAGE_TOOLCHAIN
bool "Link toolchain gcov library to the OS"
depends on ARCH_TOOLCHAIN_GCC
depends on HAVE_CXXINITIALIZE
---help---
Link the toolchain coverage library to the OS.

@raiden00pl
Copy link
Member

raiden00pl commented Feb 9, 2026

why not just change this:

nuttx/arch/sim/Kconfig

Lines 38 to 49 in e836067

choice
prompt "Toolchain Selection"
default SIM_TOOLCHAIN_GCC
config SIM_TOOLCHAIN_GCC
bool "Generic GNU toolchain"
select ARCH_TOOLCHAIN_GCC
config SIM_TOOLCHAIN_CLANG
bool "LLVM Clang toolchain"
select ARCH_TOOLCHAIN_CLANG

to this:

choice
	prompt "Toolchain Selection"
	default SIM_TOOLCHAIN_GCC if HOST_LINUX
	default SIM_TOOLCHAIN_CLANG if HOST_MAC
	
config SIM_TOOLCHAIN_GCC
	bool "Generic GNU toolchain"
	select ARCH_TOOLCHAIN_GCC

config SIM_TOOLCHAIN_CLANG
	bool "LLVM Clang toolchain"
	select ARCH_TOOLCHAIN_CLANG

endchoice

I'm not sure if tools/configure.sh can auto-detect host OS, if not then you just use ./tools/configure.sh -m <config> to force Mac host

@aditya0yadav
Copy link
Author

@raiden00pl
I agree with the Kconfig approach for better defaults on macOS .

However, the build-system tweaks are still necessary to fix hardcoded GCC-isms—like the forced search for x86_64-elf-gcc and the -lgcov link—which currently break the build even when Clang is explicitly selected.

@raiden00pl
Copy link
Member

@aditya0yadav -lgcov is protected by ifdef CONFIG_COVERAGE_TOOLCHAIN. CONFIG_COVERAGE_TOOLCHAIN is available only when CONFIG_ARCH_TOOLCHAIN_GCC=y. So CONFIG_COVERAGE_TOOLCHAIN=y should not be even possible for CONFIG_ARCH_TOOLCHAIN_CLANG=y

@aditya0yadav
Copy link
Author

aditya0yadav commented Feb 9, 2026

@raiden00pl

Thank you for the guidance; these technical discussions are incredibly valuable for my learning.

I understand that COVERAGE_TOOLCHAIN is currently gated by ARCH_TOOLCHAIN_GCC. However, the current logic assumes that coverage is a GCC-only feature. My goal is to decouple this so that macOS users can leverage Clang’s native profiling (-fprofile-instr-generate). Rather than forcing macOS users to disable coverage entirely, these changes allow the build system to select the correct instrumentation based on the host toolchain.

I am still looking into the best way to handle the Kconfig dependencies. Consider these current tweaks as a way to identify the conflict; I'll continue investigating this over the next few days to propose a cleaner, more permanent solution that satisfies the configuration requirements.

@raiden00pl
Copy link
Member

@aditya0yadav what about these options dedicated for Clang:

config COVERAGE_COMPILER_RT
bool "Builtin libclang_rt.profile"
depends on ARCH_TOOLCHAIN_CLANG
select LIB_BUILTIN
select LIB_COMPILER_RT
---help---
Compile the LLVM Compiler-rt library into the OS.
Support adding native rich compilation options "-fprofile-xxx"
config COVERAGE_MINI
bool "Builtin code coverage analysis mini library"
select LIB_BUILTIN
---help---
This is a mini version of the library, which is
used for code coverage analysis. If the toolchain
is clang, only support the compilation option
"-fprofile-instr-generate -fcoverage-mapping"

-fprofile-instr-generate is supported for sim when you enable CONFIG_COVERAGE_ALL

@aditya0yadav
Copy link
Author

@raiden00pl
I did not know about COVERAGE_COMPILER_RT
using this whole new feat of error are coming,
I will be taking my time understanding them

Really thanks for your help

@raiden00pl
Copy link
Member

@aditya0yadav Quick tip: use "git grep" to search for keywords you're working with. It's the most useful tool for working with the nuttx codebase :)

@FelipeMdeO
Copy link
Contributor

hello @aditya0yadav , can I help you to finish this fix?
This fix is very important for us.

@aditya0yadav
Copy link
Author

aditya0yadav commented Feb 17, 2026 via email

@FelipeMdeO
Copy link
Contributor

Hello @aditya0yadav , @raiden00pl I did some changes on my side, can you check it and if it is ok add it to your PR, please?

https://github.com/FelipeMdeO/nuttx
branch: sim-macos-toolchain-fix
sha: 6a386fc

FelipeMdeO@6a386fc

@raiden00pl
Copy link
Member

@FelipeMdeO lgtm

*
****************************************************************************/

int host_settimer(uint64_t nsec)
Copy link
Contributor

Choose a reason for hiding this comment

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

@aditya0yadav please keep the function description. If you think the description is wrong, please fix it.

Copy link
Author

Choose a reason for hiding this comment

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

sure

@aditya0yadav
Copy link
Author

aditya0yadav commented Feb 23, 2026

@raiden00pl @FelipeMdeO
Should we make a new pr for this?
With the clean and final code.

Or @FelipeMdeO can merge his commit if that’s okay.

@acassis
Copy link
Contributor

acassis commented Feb 23, 2026

@raiden00pl @FelipeMdeO Should we make a new pr for this? With the clean and final code.

Or @FelipeMdeO can merge his commit if that’s okay.

@aditya0yadav no, just learn how to use "git rebase -i" :-)
Please read the Contribution Guide, there are usage examples there: https://nuttx.apache.org/docs/latest/contributing/making-changes.html#

@aditya0yadav
Copy link
Author

@acassis @raiden00pl @FelipeMdeO
Done

@FelipeMdeO
Copy link
Contributor

FelipeMdeO commented Feb 28, 2026

Congratulations @aditya0yadav.
Let's remove draft tag.

arch/sim/Kconfig Outdated

choice
prompt "Toolchain Selection"
default SIM_TOOLCHAIN_GCC if HOST_LINUX
Copy link
Contributor

Choose a reason for hiding this comment

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

remvoe this line


now = host_gettime(false);

usec = (nsec <= now) ? 1 : (nsec - now) / 1000;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
usec = (nsec <= now) ? 1 : (nsec - now) / 1000;
usec = (nsec <= now ? 1 : (nsec - now + 99) / 1000);

and remove line 126

@xiaoxiang781216
Copy link
Contributor

@aditya0yadav please squash your change into one patch

now setimer is shared between linux and macos
and remove the use of #define _POSIX_C_SOURCE 200809L

fix the word problem

enhance toolchain selection for simulation: set defaults for GCC on Linux and Clang on macOS

document host_settimer function: add description and parameter details

fix: adjust timer calculation in host_settimer for accurate timing
@aditya0yadav
Copy link
Author

@xiaoxiang781216 Please check now
is it okay now

@acassis acassis marked this pull request as ready for review February 28, 2026 13:33
@acassis
Copy link
Contributor

acassis commented Feb 28, 2026

@simbit18 @raiden00pl any idea what is this error:

+ python3 -m ntfc test --testpath=/github/workspace/nuttx-ntfc/external/nuttx-testing --confpath=/github/workspace/sources/nuttx/boards/sim/sim/sim/configs/citest/config.yaml --jsonconf=/github/workspace/sources/nuttx/boards/sim/sim/sim/configs/citest/session.json
Traceback (most recent call last):
YAML config:
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
{'config': {'cwd': './', 'timeout_session': 6000},
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
 'product': {'cores': {'core0': {'conf_path': './.config',
                                 'device': 'sim',
                                 'elf_path': './nuttx',
                                 'name': 'main'}},
             'name': 'ntfc-sim'}}
JSON config:
{'args': {'kv': []},
 'module': {'exclude_module': ['Nuttx_System_Driver_Pm', 'Nuttx_System_Fs_Fs'],
            'include_module': [],
            'order': []}}
    exec(code, run_globals)
  File "/github/workspace/nuttx-ntfc/venv/lib/python3.10/site-packages/ntfc/__main__.py", line 25, in <module>
    main()  # pylint: disable=no-value-for-parameter
  File "/github/workspace/nuttx-ntfc/venv/lib/python3.10/site-packages/click/core.py", line 1485, in __call__
    return self.main(*args, **kwargs)
  File "/github/workspace/nuttx-ntfc/venv/lib/python3.10/site-packages/click/core.py", line 1416, in main
    ctx.exit()
  File "/github/workspace/nuttx-ntfc/venv/lib/python3.10/site-packages/click/core.py", line 737, in exit
    self.close()
  File "/github/workspace/nuttx-ntfc/venv/lib/python3.10/site-packages/click/core.py", line 621, in close
    self._close_with_exception_info(None, None, None)
  File "/github/workspace/nuttx-ntfc/venv/lib/python3.10/site-packages/click/core.py", line 635, in _close_with_exception_info
    exit_result = self._exit_stack.__exit__(exc_type, exc_value, tb)
  File "/usr/lib/python3.10/contextlib.py", line 576, in __exit__
    raise exc_details[1]
  File "/usr/lib/python3.10/contextlib.py", line 561, in __exit__
    if cb(*exc_details):
  File "/usr/lib/python3.10/contextlib.py", line 449, in _exit_wrapper
    callback(*args, **kwds)
  File "/github/workspace/nuttx-ntfc/venv/lib/python3.10/site-packages/click/decorators.py", line 93, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/github/workspace/nuttx-ntfc/venv/lib/python3.10/site-packages/click/core.py", line 824, in invoke
    return callback(*args, **kwargs)
  File "/github/workspace/nuttx-ntfc/venv/lib/python3.10/site-packages/ntfc/cli/main.py", line 181, in cli_on_close
    ret = test_run(pt, ctx)
  File "/github/workspace/nuttx-ntfc/venv/lib/python3.10/site-packages/ntfc/cli/main.py", line 123, in test_run
    return pt.runner(ctx.testpath, ctx.result, ctx.nologs)
  File "/github/workspace/nuttx-ntfc/venv/lib/python3.10/site-packages/ntfc/pytest/mypytest.py", line 270, in runner
    self._device_start()
  File "/github/workspace/nuttx-ntfc/venv/lib/python3.10/site-packages/ntfc/pytest/mypytest.py", line 222, in _device_start
    product.start()
  File "/github/workspace/nuttx-ntfc/venv/lib/python3.10/site-packages/ntfc/product.py", line 70, in start
    self._cores.start()
  File "/github/workspace/nuttx-ntfc/venv/lib/python3.10/site-packages/ntfc/cores.py", line 73, in start
    core.start()
  File "/github/workspace/nuttx-ntfc/venv/lib/python3.10/site-packages/ntfc/core.py", line 510, in start
    self._device.start()
  File "/github/workspace/nuttx-ntfc/venv/lib/python3.10/site-packages/ntfc/device/sim.py", line 52, in start
    self.host_open(cmd, uptime)
  File "/github/workspace/nuttx-ntfc/venv/lib/python3.10/site-packages/ntfc/device/host.py", line 139, in host_open
    raise TimeoutError("device boot timeout")
TimeoutError: device boot timeout

I just restarted the CI, let's see if it helps

@raiden00pl
Copy link
Member

raiden00pl commented Feb 28, 2026

@acassis because this change breaks sim and nuttx sim doesn't even boot on CI linux (TimeoutError: device boot timeout)

@raiden00pl
Copy link
Member

raiden00pl commented Feb 28, 2026

@acassis you can download sim elf here and run on linux: https://github.com/apache/nuttx/actions/runs/22508690590/job/65219879041#step:14:25 NSH boots OK, but the system is not functional (you can press ENTER and nothing happen, the same issue like before)

@acassis
Copy link
Contributor

acassis commented Feb 28, 2026

@acassis because this change breaks sim and nuttx sim doesn't even boot on CI linux (TimeoutError: device boot timeout)

Thank you @raiden00pl so it is not a false positive.

@aditya0yadav @FelipeMdeO did you test it?

@raiden00pl
Copy link
Member

Simple sim/nsh config boots fine, but sim/citest config is broken

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Arch: simulator Issues related to the SIMulator Size: S The size of the change in this PR is small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants