Skip to content

[BUG] macOS build failure on simulator: missing POSIX timers (timer_t, timer_create, itimerspec) #17818

Closed

Description

@FelipeMdeO

Description / Steps to reproduce the issue

I used Nuttx Link as reference:https://nuttx.apache.org/docs/latest/guides/simulator.html#prerequisites-for-macos

While building the NuttX simulator (sim) on macOS, the build fails due to missing POSIX timer types and APIs. The errors indicate that timer_t, timer_create(), timer_settime(), struct itimerspec, and TIMER_ABSTIME are not available in the macOS SDK.
I tried build the project using Clang as toolchain, but without luck.

sim/posix/sim_hosttime.c:40:8: error: unknown type name 'timer_t'; did you mean 'time_t'?
static timer_t  g_timer;
       ^~~~~~~

sim/posix/sim_hosttime.c:64:10: error: call to undeclared function 'timer_create'
  return timer_create(CLOCK_MONOTONIC, &sigev, &g_timer);

sim/posix/sim_hosttime.c:122:21: error: variable has incomplete type 'struct itimerspec'
  struct itimerspec tspec =

sim/posix/sim_hosttime.c:134:10: error: call to undeclared function 'timer_settime'
  return timer_settime(g_timer, TIMER_ABSTIME, &tspec, NULL);

sim/posix/sim_hosttime.c:134:33: error: use of undeclared identifier 'TIMER_ABSTIME'

@acassis do you know if anyone is using Mac to simulate and use Nuttx?

Environment
OS: macOS (reproducible with current macOS + Xcode CLT)
Toolchain: Apple Clang
Target: sim:nsh
NuttX version: master

On which OS does this issue occur?

[OS: Mac]

What is the version of your OS?

MacOS 26.1

NuttX Version

master

Issue Architecture

[Arch: simulator]

Issue Area

[Area: Build System]

Host information

file sysinfo.h not exists
NuttX CFLAGS:
--g
-fomit-frame-pointer
-fno-common
-fvisibility=hidden
-ffunction-sections
-fdata-sections
-Wall
-Wstrict-prototypes
-Wshadow
-Wundef
-Wno-attributes
-Wno-unknown-pragmas
-fno-pic
-isystem /Users/felipemouradeoliveira/nuttx-space/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__

NuttX CXXFLAGS:
--g
-fomit-frame-pointer
-fno-common
-fvisibility=hidden
-ffunction-sections
-fdata-sections
-Wall
-Wshadow
-Wundef
-Wno-attributes
-Wno-unknown-pragmas
-nostdinc++
-fno-exceptions
-fcheck-new
-fno-rtti
-fno-pic
-isystem /Users/felipemouradeoliveira/nuttx-space/nuttx/include/cxx
-isystem /Users/felipemouradeoliveira/nuttx-space/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__

NuttX LDFLAGS:
-Wl-dead_strip

NuttX configuration options:
CONFIG_HOST_MACOS=y
CONFIG_APPS_DIR=../apps
CONFIG_BASE_DEFCONFIG=\sim:nsh-dirty
CONFIG_BUILD_FLAT=y
CONFIG_OUTPUT_STRIP_PATHS=y
CONFIG_ARCH_HAVE_SETJMP=y
CONFIG_ARCH_SETJMP_H=y
CONFIG_ARCH_NONE_DEBUG_H=y
CONFIG_FORTIFY_SOURCE=0
CONFIG_NDEBUG=y
CONFIG_DEBUG_ALERT=y
CONFIG_DEBUG_FEATURES=y
CONFIG_DEBUG_ERROR=y
CONFIG_DEBUG_WARN=y
CONFIG_DEBUG_INFO=y
CONFIG_DEBUG_ASSERTIONS=y
CONFIG_DEBUG_ASSERTIONS_EXPRESSION=y
CONFIG_DEBUG_ASSERTIONS_FILENAME=y
CONFIG_ARCH_HAVE_STACKCHECK=y
CONFIG_STACKCHECK_MARGIN=-1
CONFIG_STACK_USAGE_WARNING=0
CONFIG_DEBUG_SYMBOLS=y
CONFIG_DEBUG_SYMBOLS_LEVEL=-g
CONFIG_ARCH_HAVE_CUSTOMOPT=y
CONFIG_DEBUG_NOOPT=y
CONFIG_LTO_NONE=y
CONFIG_DEBUG_OPT_UNUSED_SECTIONS=y
CONFIG_DEBUG_LINK_MAP=y
CONFIG_ARCH_SIM=y
CONFIG_ARCH=\sim
CONFIG_ARCH_CHIP=\sim
CONFIG_HOST_ARM64=y
CONFIG_SIM_TOOLCHAIN_CLANG=y
CONFIG_SIM_WALLTIME_SLEEP=y
CONFIG_SIM_LOOP_INTERVAL=10
CONFIG_SIM_STACKSIZE_ADJUSTMENT=65536
CONFIG_SIM_HOSTFS=y
CONFIG_SIM_OFFLOAD_NUM_BUFFERS=2
CONFIG_SIM_OFFLOAD_BUFFER_NUMBYTES=32767
CONFIG_SIM_UART_DMA=y
CONFIG_SIM_UART_NUMBER=0
CONFIG_SIM_CUSTOM_DATA_SECTION=\
CONFIG_ARCH_TOOLCHAIN_GNU=y
CONFIG_ARCH_TOOLCHAIN_CLANG=y
CONFIG_ARCH_64BIT=y
CONFIG_ARCH_HAVE_TEXT_HEAP=y
CONFIG_ARCH_HAVE_MULTICPU=y
CONFIG_ARCH_HAVE_FORK=y
CONFIG_ARCH_HAVE_POWEROFF=y
CONFIG_ARCH_HAVE_TESTSET=y
CONFIG_ARCH_HAVE_RTC_SUBSECONDS=y
CONFIG_ARCH_HAVE_SYSCALL_HOOKS=y
CONFIG_ARCH_HAVE_BACKTRACE=y
CONFIG_ARCH_HAVE_CPUINFO=y
CONFIG_ARCH_CPUINFO_FREQ_KHZ=0
CONFIG_ARCH_HAVE_TCBINFO=y
CONFIG_BOARD_LOOPSPERMSEC=0
CONFIG_BOOT_RUNFROMEXTSRAM=y
CONFIG_RAM_START=0x0
CONFIG_RAM_SIZE=0
CONFIG_ARCH_BOARD_SIM=y
CONFIG_ARCH_BOARD=\sim
CONFIG_ARCH_HAVE_BUTTONS=y
CONFIG_ARCH_HAVE_IRQBUTTONS=y
CONFIG_BOARD_CRASHDUMP_NONE=y
CONFIG_BOARDCTL=y
CONFIG_BOARDCTL_POWEROFF=y
CONFIG_BOARDCTL_MKRD=y
CONFIG_BOARDCTL_APP_SYMTAB=y
CONFIG_BOARD_MEMORY_RANGE=\
CONFIG_DISABLE_OS_API=y
CONFIG_ARCH_HAVE_TICKLESS=y
CONFIG_USEC_PER_TICK=10000
CONFIG_TIMER_ADJUST_USEC=0
CONFIG_ARCH_HAVE_TIMEKEEPING=y
CONFIG_START_YEAR=2008
CONFIG_START_MONTH=6
CONFIG_START_DAY=1
CONFIG_PREALLOC_TIMERS=8
CONFIG_IRQ_NWORKS=8
CONFIG_IRQ_WORK_SECTION=\
CONFIG_IRQ_WORK_STACKSIZE=2048
CONFIG_INIT_ENTRY=y
CONFIG_INIT_ARGS=\
CONFIG_INIT_STACKSIZE=2048
CONFIG_INIT_PRIORITY=100
CONFIG_INIT_ENTRYPOINT=\nsh_main
CONFIG_INIT_ENTRYNAME=\nsh_main
CONFIG_ETC_ROMFS=y
CONFIG_ETC_ROMFSMOUNTPT=/etc
CONFIG_ETC_ROMFSDEVNO=1
CONFIG_ETC_ROMFSSECTSIZE=64
CONFIG_ETC_FATDEVNO=2
CONFIG_ETC_FATSECTSIZE=512
CONFIG_ETC_FATNSECTORS=1024
CONFIG_ETC_FATMOUNTPT=/tmp
CONFIG_RR_INTERVAL=0
CONFIG_TASK_NAME_SIZE=31
CONFIG_SCHED_HAVE_PARENT=y
CONFIG_SCHED_WAITPID=y
CONFIG_PTHREAD_MUTEX_ROBUST=y
CONFIG_PTHREAD_MUTEX_DEFAULT_PRIO_NONE=y
CONFIG_SCHED_CPULOAD_NONE=y
CONFIG_SCHED_CPULOAD_TICKSPERSEC=100
CONFIG_SCHED_PROFILE_TICKSPERSEC=1000
CONFIG_SCHED_STACK_RECORD=0
CONFIG_DEV_CONSOLE=y
CONFIG_NFILE_DESCRIPTORS_PER_BLOCK=8
CONFIG_FILE_STREAM=y
CONFIG_SIG_PREALLOC_ACTIONS=4
CONFIG_SIG_ALLOC_ACTIONS=1
CONFIG_SIG_PREALLOC_IRQ_ACTIONS=8
CONFIG_PREALLOC_MQ_MSGS=8
CONFIG_PREALLOC_MQ_IRQ_MSGS=8
CONFIG_MQ_MAXMSGSIZE=32
CONFIG_SCHED_WORKQUEUE=y
CONFIG_SCHED_HPWORK=y
CONFIG_SCHED_HPNTHREADS=1
CONFIG_SCHED_HPWORKPRIORITY=224
CONFIG_SCHED_HPWORKSTACKSIZE=2048
CONFIG_DEFAULT_TASK_STACKSIZE=2048
CONFIG_IDLETHREAD_STACKSIZE=4096
CONFIG_PTHREAD_STACK_MIN=256
CONFIG_PTHREAD_STACK_DEFAULT=2048
CONFIG_PTHREAD_GUARDSIZE_DEFAULT=0
CONFIG_SCHED_BACKTRACE=y
CONFIG_PID_INITIAL_COUNT=16
CONFIG_SCHED_EVENTS=y
CONFIG_DEV_LOOP=y
CONFIG_ONESHOT=y
CONFIG_ONESHOT_COUNT=y
CONFIG_ALARM_ARCH=y
CONFIG_BCH=y
CONFIG_BCH_BUFFER_ALIGNMENT=0
CONFIG_IOEXPANDER=y
CONFIG_IOEXPANDER_DUMMY=y
CONFIG_IOEXPANDER_DUMMY_INT_NCALLBACKS=4
CONFIG_IOEXPANDER_DUMMY_INT_POLLDELAY=500000
CONFIG_IOEXPANDER_INT_ENABLE=y
CONFIG_IOEXPANDER_NPINS=16
CONFIG_DEV_GPIO=y
CONFIG_DEV_GPIO_NPOLLWAITERS=1
CONFIG_DEV_GPIO_NSIGNALS=1
CONFIG_GPIO_LOWER_HALF=y
CONFIG_GPIO_LOWER_HALF_INTTYPE=14
CONFIG_DEV_NULL=y
CONFIG_DEV_ZERO=y
CONFIG_DEV_OPTEE_NONE=y
CONFIG_DRVR_MKRD=y
CONFIG_PIPES=y
CONFIG_DEV_PIPE_MAXSIZE=65535
CONFIG_DEV_PIPE_SIZE=1024
CONFIG_DEV_FIFO_SIZE=1024
CONFIG_DEV_PIPE_VFS_PATH=/var/pipe
CONFIG_DEV_PIPE_NPOLLWAITERS=4
CONFIG_ARCH_HAVE_SERIAL_TERMIOS=y
CONFIG_SERIAL=y
CONFIG_SERIAL_CONSOLE=y
CONFIG_SERIAL_NPOLLWAITERS=4
CONFIG_SERIAL_IFLOWCONTROL=y
CONFIG_SERIAL_TXDMA=y
CONFIG_SERIAL_RXDMA=y
CONFIG_SYSLOG=y
CONFIG_SYSLOG_DEFAULT_MASK=0xff
CONFIG_SYSLOG_CRLF=y
CONFIG_SYSLOG_MAX_CHANNELS=1
CONFIG_SYSLOG_DEVPATH=/dev/ttyS1
CONFIG_SYSLOG_DEFAULT=y
CONFIG_FS_NEPOLL_DESCRIPTORS=8
CONFIG_FS_LOCK_BUCKET_SIZE=0
CONFIG_PSEUDOFS_ATTRIBUTES=y
CONFIG_PSEUDOFS_SOFTLINKS=y
CONFIG_PSEUDOFS_FILE=y
CONFIG_SENDFILE_BUFSIZE=512
CONFIG_FS_HEAPSIZE=0
CONFIG_FS_BACKTRACE=0
CONFIG_FS_MQUEUE_VFS_PATH=/var/mqueue
CONFIG_FS_MQUEUE_NPOLLWAITERS=4
CONFIG_FS_RAMMAP=y
CONFIG_FS_ANONMAP=y
CONFIG_FS_FAT=y
CONFIG_FAT_LCNAMES=y
CONFIG_FAT_LFN=y
CONFIG_FAT_MAXFNAME=32
CONFIG_FAT_LFN_ALIAS_TRAILCHARS=0
CONFIG_FS_ROMFS=y
CONFIG_FS_ROMFS_CACHE_NODE=y
CONFIG_FS_ROMFS_CACHE_FILE_NSECTORS=1
CONFIG_FS_BINFS=y
CONFIG_FS_PROCFS=y
CONFIG_FS_HOSTFS=y
CONFIG_NXFONTS_PACKEDMSFIRST=y
CONFIG_MM_DEFAULT_MANAGER=y
CONFIG_MM_DEFAULT_ALIGNMENT=8
CONFIG_MM_NODE_GUARDSIZE=0
CONFIG_MM_REGIONS=1
CONFIG_MM_MAP_COUNT_MAX=1024
CONFIG_MM_BACKTRACE=-1
CONFIG_MM_FREE_DELAYCOUNT_MAX=0
CONFIG_MM_HEAP_BIGGEST_COUNT=30
CONFIG_MM_HEAP_MEMPOOL_THRESHOLD=-1
CONFIG_PATH_INITIAL=/bin
CONFIG_BINFMT_ELF_RELOCATABLE=y
CONFIG_STDIO_BUFFER_SIZE=64
CONFIG_STDIO_LINEBUFFER=y
CONFIG_NUNGET_CHARS=2
CONFIG_LIBC_LONG_LONG=y
CONFIG_LIBC_NUMBERED_ARGS=y
CONFIG_LIBC_NL_ARGMAX=9
CONFIG_ARCH_LOWPUTC=y
CONFIG_LIBC_RAND_ORDER=1
CONFIG_LIBC_HOMEDIR=/
CONFIG_LIBC_TMPDIR=/tmp
CONFIG_LIBC_MAX_TMPFILE=32
CONFIG_LIBC_MAX_EXITFUNS=1
CONFIG_LIBC_EXECFUNCS=y
CONFIG_POSIX_SPAWN_DEFAULT_STACKSIZE=2048
CONFIG_LIBC_HOSTNAME=\
CONFIG_LIBC_OPEN_MAX=256
CONFIG_NAME_MAX=32
CONFIG_PATH_MAX=256
CONFIG_LINE_MAX=80
CONFIG_LIBC_STRERROR_ERRNUM=y
CONFIG_LIBC_STRSIGNAL=y
CONFIG_LIBC_LOCALE=y
CONFIG_LIBC_LOCALE_CATALOG=y
CONFIG_LIBC_LOCALE_GETTEXT=y
CONFIG_LIBC_LOCALE_PATH=/etc/locale
CONFIG_TLS_NELEM=0
CONFIG_TLS_TASK_NELEM=0
CONFIG_TLS_NCLEANUP=0
CONFIG_LIBC_GAISTRERROR_ERRNUM=y
CONFIG_LIBC_ENVPATH=y
CONFIG_LIBC_FTOK_VFS_PATH=/var/ftok
CONFIG_LIBC_MEMFD_ERROR=y
CONFIG_LIBC_TEMPBUFFER=y
CONFIG_LIBC_MAX_TEMPBUFFER=2
CONFIG_LIBC_TEMPBUFFER_MALLOC=y
CONFIG_LIBC_BACKTRACE_BUFFSIZE=0
CONFIG_LIBC_MUTEX_BACKTRACE=0
CONFIG_BUILTIN=y
CONFIG_STREAM_OUT_BUFFER_SIZE=64
CONFIG_STREAM_HEXDUMP_BUFFER_SIZE=128
CONFIG_STREAM_BASE64_BUFFER_SIZE=128
CONFIG_LIBC_INLINE_QUEUE=y
CONFIG_LIBM_TOOLCHAIN=y
CONFIG_HAVE_CXXINITIALIZE=y
CONFIG_BUILTIN_TOOLCHAIN=y
CONFIG_COVERAGE_NONE=y
CONFIG_COVERAGE_DEFAULT_PREFIX_STRIP=\0
CONFIG_COVERAGE_DEFAULT_PREFIX=/data
CONFIG_PROFILE_NONE=y
CONFIG_EXAMPLES_GPIO=y
CONFIG_EXAMPLES_GPIO_PROGNAME=\gpio
CONFIG_EXAMPLES_GPIO_PRIORITY=100
CONFIG_EXAMPLES_GPIO_STACKSIZE=2048
CONFIG_EXAMPLES_HELLO=y
CONFIG_EXAMPLES_HELLO_PROGNAME=\hello
CONFIG_EXAMPLES_HELLO_PRIORITY=100
CONFIG_EXAMPLES_HELLO_STACKSIZE=2048
CONFIG_FSUTILS_MKFATFS=y
CONFIG_MKFATFS_BUFFER_ALIGNMENT=0
CONFIG_NSH_LIBRARY=y
CONFIG_NSH_PROMPT_STRING=\nsh>
CONFIG_NSH_PROMPT_MAX=32
CONFIG_NSH_PROMPT_ENV=\PS1
CONFIG_NSH_PROMPT_SUFFIX=>
CONFIG_NSH_READLINE=y
CONFIG_NSH_QUOTE=y
CONFIG_NSH_MAXARGUMENTS=7
CONFIG_NSH_ARGCAT=y
CONFIG_NSH_NESTDEPTH=3
CONFIG_NSH_ALIAS=y
CONFIG_NSH_ALIAS_MAX_AMOUNT=1
CONFIG_NSH_PIPELINE=y
CONFIG_NSH_BUILTIN_APPS=y
CONFIG_NSH_FILE_APPS=y
CONFIG_NSH_DISABLE_DATE=y
CONFIG_NSH_DISABLE_LOSMART=y
CONFIG_NSH_DISABLE_LOMTD=y
CONFIG_NSH_DISABLE_MB=y
CONFIG_NSH_DISABLE_MH=y
CONFIG_NSH_DISABLE_MW=y
CONFIG_NSH_DISABLE_SHUTDOWN=y
CONFIG_NSH_DISABLE_TIMEDATECTL=y
CONFIG_NSH_CODECS_BUFSIZE=128
CONFIG_NSH_PROC_MOUNTPOINT=/proc
CONFIG_NSH_FILEIOSIZE=1024
CONFIG_NSH_SYSINITSCRIPT=\init.d/rc.sysinit
CONFIG_NSH_INITSCRIPT=\init.d/rcS
CONFIG_NSH_SCRIPT_REDIRECT_PATH=\
CONFIG_NSH_CONSOLE=y
CONFIG_NSH_ARCHINIT=y
CONFIG_SYSTEM_DD=y
CONFIG_SYSTEM_DD_PROGNAME=\dd
CONFIG_SYSTEM_DD_PRIORITY=100
CONFIG_SYSTEM_DD_STACKSIZE=2048
CONFIG_SYSTEM_DD_STATS=y
CONFIG_SYSTEM_DUMPSTACK=y
CONFIG_SYSTEM_DUMPSTACK_STACKSIZE=2048
CONFIG_SYSTEM_DUMPSTACK_PRIORITY=100
CONFIG_SYSTEM_NSH=y
CONFIG_SYSTEM_NSH_PRIORITY=100
CONFIG_SYSTEM_NSH_STACKSIZE=2048
CONFIG_SYSTEM_NSH_PROGNAME=\nsh
CONFIG_SYSTEM_READLINE=y
CONFIG_READLINE_HAVE_EXTMATCH=y
CONFIG_READLINE_ECHO=y
CONFIG_READLINE_TABCOMPLETION=y
CONFIG_READLINE_MAX_BUILTINS=64
CONFIG_READLINE_MAX_EXTCMDS=64
CONFIG_TESTING_OSTEST=y
CONFIG_TESTING_OSTEST_LOOPS=1
CONFIG_TESTING_OSTEST_STACKSIZE=8192
CONFIG_TESTING_OSTEST_NBARRIER_THREADS=8
CONFIG_TESTING_OSTEST_RR_RANGE=30000
CONFIG_TESTING_OSTEST_RR_RUNS=10
CONFIG_TESTING_OSTEST_WAITRESULT=y

Host system OS:
macOS 26.1 Darwin Felipes-Air 25.1.0 Darwin Kernel Version 25.1.0: Mon Oct 20 19:32:47 PDT 2025; root:xnu-12377.41.6~2/RELEASE_ARM64_T8103 arm64 arm

Host system PATH:
/Users/felipemouradeoliveira/toolchains/xpack-x86_64-elf-gcc-*/bin
/Users/felipemouradeoliveira/Library/xpacks/@xpack-dev-tools/riscv-none-elf-gcc/15.2.0-1.1/.content/bin
/usr/local/bin
/System/Cryptexes/App/usr/bin
/usr/bin
/bin
/usr/sbin
/sbin
/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin
/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin
/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin
/opt/pmk/env/global/bin
/opt/homebrew/bin
/Users/felipemouradeoliveira/Library/Python/3.9/bin
/Users/felipemouradeoliveira/.local/bin
/Users/felipemouradeoliveira/Library/Python/3.9/bin
/Users/felipemouradeoliveira/.local/bin

Verification

  • I have verified before submitting the report.

Activity

  1. added
    Type: Bug
    on Jan 10, 2026
  2. added
    Arch: simulator
    OS: Mac
    on Jan 10, 2026
  3. simbit18 commented on Jan 12, 2026

    @simbit18
    Contributor

    Hi @FelipeMdeO , unfortunately, the errors you encountered are the same ones we have on NuttX Mirror.

    ====================================================================================
    Configuration/Tool: sim/nsh
    2026-01-12 03:21:15
    ------------------------------------------------------------------------------------
      Cleaning...
    compiler-rt/Make.defs:45: target `bin/compiler-rt/compiler-rt/lib/builtins' given more than once in the same rule.
    compiler-rt/Make.defs:45: target `kbin/compiler-rt/compiler-rt/lib/builtins' given more than once in the same rule.
    compiler-rt/Make.defs:45: target `bin/compiler-rt/compiler-rt/lib/builtins' given more than once in the same rule.
    compiler-rt/Make.defs:45: target `kbin/compiler-rt/compiler-rt/lib/builtins' given more than once in the same rule.
      Configuring...
      Building NuttX...
    compiler-rt/Make.defs:45: target `bin/compiler-rt/compiler-rt/lib/builtins' given more than once in the same rule.
    compiler-rt/Make.defs:45: target `kbin/compiler-rt/compiler-rt/lib/builtins' given more than once in the same rule.
    Error: sim/posix/sim_hosttime.c:40:8: error: unknown type name 'timer_t'; did you mean 'time_t'?
       40 | static timer_t  g_timer;
          |        ^~~~~~~
          |        time_t
    /Applications/Xcode_16.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_time_t.h:31:33: note: 'time_t' declared here
       31 | typedef __darwin_time_t         time_t;
          |                                 ^
    Error: sim/posix/sim_hosttime.c:64:10: error: call to undeclared function 'timer_create'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
       64 |   return timer_create(CLOCK_MONOTONIC, &sigev, &g_timer);
          |          ^
    Error: sim/posix/sim_hosttime.c:122:21: error: variable has incomplete type 'struct itimerspec'
      122 |   struct itimerspec tspec =
          |                     ^
    sim/posix/sim_hosttime.c:122:10: note: forward declaration of 'struct itimerspec'
      122 |   struct itimerspec tspec =
          |          ^
    Error: sim/posix/sim_hosttime.c:134:10: error: call to undeclared function 'timer_settime'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
      134 |   return timer_settime(g_timer, TIMER_ABSTIME, &tspec, NULL);
          |          ^
    Error: sim/posix/sim_hosttime.c:134:33: error: use of undeclared identifier 'TIMER_ABSTIME'
      134 |   return timer_settime(g_timer, TIMER_ABSTIME, &tspec, NULL);
          |                                 ^
    5 errors generated.
    make[1]: *** [sim_hosttime.o] Error 1
    make[1]: Target `nuttx' not remade because of errors.
    make: *** [nuttx] Error 2
    make: Target `all' not remade because of errors.
    /Users/runner/work/nuttx/nuttx/sources/nuttx/tools/testbuild.sh: line 385: /Users/runner/work/nuttx/nuttx/sources/nuttx/../nuttx/nuttx.manifest: No such file or directory
      [1/1] Normalize sim/nsh
    ====================================================================================
    

    https://github.com/NuttX/nuttx/actions/runs/20906117240/job/60059906124#logs

    broken [macOS (sim-01)], [macOS (sim-02)] and [macOS (sim-03)]

  4. FelipeMdeO commented on Jan 12, 2026

    @FelipeMdeO
    ContributorAuthor

    Hello @simbit18, I was able to build the sim env here doing a "work around".
    In my case, I changed sim_hosttime.c file using macros to add/remove code specifically to macOS.
    Do you have any idea about how is the right way to solve this? Will be good fix it.

  5. simbit18 commented on Jan 12, 2026

    @simbit18
    Contributor

    Hi @FelipeMdeO, I don't have a Mac.

    Perhaps @pkarashchenko or @yamt can help.

  6. aditya0yadav commented on Feb 3, 2026

    @aditya0yadav
    Contributor

    I’ve used a different approach to fix this. I’ve made some changes to the code and if you’d like to see them, please take a look at this file: https://github.com/aditya0yadav/nuttx-apache-macos/blob/main/sim_hosttime.c

    If you follow this idea, please disable GCOV in the kconfig or config file.

  7. simbit18 commented on Mar 5, 2026

    @simbit18
    Contributor

    @FelipeMdeO @aditya0yadav Can you please check this PR #18331?
    The issue is still not fixed.

    sim:nsh on our NuttX Mirror

    ====================================================================================
    Configuration/Tool: sim/nsh
    2026-03-05 16:45:18
    ------------------------------------------------------------------------------------
      Cleaning...
    compiler-rt/Make.defs:45: target `bin/compiler-rt/compiler-rt/lib/builtins' given more than once in the same rule.
    compiler-rt/Make.defs:45: target `kbin/compiler-rt/compiler-rt/lib/builtins' given more than once in the same rule.
    compiler-rt/Make.defs:45: target `bin/compiler-rt/compiler-rt/lib/builtins' given more than once in the same rule.
    compiler-rt/Make.defs:45: target `kbin/compiler-rt/compiler-rt/lib/builtins' given more than once in the same rule.
      Configuring...
      Building NuttX...
    compiler-rt/Make.defs:45: target `bin/compiler-rt/compiler-rt/lib/builtins' given more than once in the same rule.
    compiler-rt/Make.defs:45: target `kbin/compiler-rt/compiler-rt/lib/builtins' given more than once in the same rule.
    Error: sim/posix/sim_hosttime.c:40:8: error: unknown type name 'timer_t'; did you mean 'time_t'?
       40 | static timer_t  g_timer;
          |        ^~~~~~~
          |        time_t
    /Applications/Xcode_16.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_time_t.h:31:33: note: 'time_t' declared here
       31 | typedef __darwin_time_t         time_t;
          |                                 ^
    Error: sim/posix/sim_hosttime.c:64:10: error: call to undeclared function 'timer_create'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
       64 |   return timer_create(CLOCK_MONOTONIC, &sigev, &g_timer);
          |          ^
    Error: sim/posix/sim_hosttime.c:122:21: error: variable has incomplete type 'struct itimerspec'
      122 |   struct itimerspec tspec =
          |                     ^
    sim/posix/sim_hosttime.c:122:10: note: forward declaration of 'struct itimerspec'
      122 |   struct itimerspec tspec =
          |          ^
    Error: sim/posix/sim_hosttime.c:134:10: error: call to undeclared function 'timer_settime'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
      134 |   return timer_settime(g_timer, TIMER_ABSTIME, &tspec, NULL);
          |          ^
    Error: sim/posix/sim_hosttime.c:134:33: error: use of undeclared identifier 'TIMER_ABSTIME'
      134 |   return timer_settime(g_timer, TIMER_ABSTIME, &tspec, NULL);
          |                                 ^
    5 errors generated.
    make[1]: *** [sim_hosttime.o] Error 1
    make[1]: Target `nuttx' not remade because of errors.
    make: *** [nuttx] Error 2
    make: Target `all' not remade because of errors.
    /Users/runner/work/nuttx/nuttx/sources/nuttx/tools/testbuild.sh: line 385: /Users/runner/work/nuttx/nuttx/sources/nuttx/../nuttx/nuttx.manifest: No such file or directory
      [1/1] Normalize sim/nsh
    ====================================================================================
    
  8. aditya0yadav commented on Mar 5, 2026

    @aditya0yadav
    Contributor

    @simbit18 that pr right now fixes the issue related to the linker on mac
    but citest always fail for that change

    I am researching on that .

  9. FelipeMdeO commented on Mar 10, 2026

    @FelipeMdeO
    ContributorAuthor

    Hello @acassis let's close this issue please. This issue already solved.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Arch: simulatorArea: Build systemOS: MacType: Bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions