Skip to content

Instantly share code, notes, and snippets.

@lupyuen
Last active May 25, 2026 10:15
Show Gist options
  • Select an option

  • Save lupyuen/6016cbcd5ca7068b59e0e6008d04b7b0 to your computer and use it in GitHub Desktop.

Select an option

Save lupyuen/6016cbcd5ca7068b59e0e6008d04b7b0 to your computer and use it in GitHub Desktop.
➜ nuttx-github-metrics git:(main) $ cd /tmp
➜ /tmp $ mkdir 260525a
➜ /tmp $ cd 260525a
➜ 260525a $ git clone https://github.com/toku-mac/nuttx --branch fix_cmake_sim_toolchain
Cloning into 'nuttx'...
remote: Enumerating objects: 909636, done.
remote: Counting objects: 100% (1339/1339), done.
remote: Compressing objects: 100% (541/541), done.
remote: Total 909636 (delta 955), reused 799 (delta 798), pack-reused 908297 (from 3)
Receiving objects: 100% (909636/909636), 367.18 MiB | 20.00 MiB/s, done.
Resolving deltas: 100% (710911/710911), done.
Updating files: 100% (25833/25833), done.
➜ 260525a $ git clone https://github.com/apache/nuttx-apps apps
Cloning into 'apps'...
remote: Enumerating objects: 99863, done.
remote: Counting objects: 100% (12/12), done.
remote: Compressing objects: 100% (11/11), done.
remote: Total 99863 (delta 5), reused 1 (delta 1), pack-reused 99851 (from 1)
Receiving objects: 100% (99863/99863), 26.90 MiB | 9.79 MiB/s, done.
Resolving deltas: 100% (80667/80667), done.
➜ 260525a $ cd nuttx
➜ nuttx git:(fix_cmake_sim_toolchain) $ cmake -S . -B build-debug -DBOARD_CONFIG=sim:nsh -GNinja -DCMAKE_MAKE_PROGRAM=/opt/homebrew/bin/ninja
-- NuttX Host Tools
-- CMake C compiler: AppleClang
-- CMake system name: Darwin
-- CMake host system processor: arm64
TOOLS_DIR path is "/tmp/260525a/nuttx"
HOST = Darwin
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: /tmp/260525a/nuttx/build-debug/bin_host
-- The C compiler identification is AppleClang 17.0.0.17000013
-- The CXX compiler identification is AppleClang 17.0.0.17000013
-- The ASM compiler identification is AppleClang
-- Found assembler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- nuttx_add_subdirectory: Skipping cxx-oot-build
-- Configuring done (1.1s)
-- Generating done (0.4s)
-- Build files have been written to: /tmp/260525a/nuttx/build-debug
➜ nuttx git:(fix_cmake_sim_toolchain) $ printf "CONFIG_SYSTEM_TIME64=y
CONFIG_FS_LARGEFILE=y
CONFIG_TLS_NELEM=16
CONFIG_DEV_URANDOM=y
CONFIG_EXAMPLES_HELLO_RUST_CARGO=y
CONFIG_EXAMPLES_HELLO_RUST_CARGO_STACKSIZE=8192
" >> build-debug/.config
➜ nuttx git:(fix_cmake_sim_toolchain) $ cmake --build build-debug -t olddefconfig
[1/1] cd /tmp/260525a/nuttx && /opt/homebrew/Cellar/cmake/3.30...ake/3.30.1/bin/cmake -E touch /tmp/260525a/nuttx/CMakeLists.txt
/tmp/260525a/nuttx/build-debug/.config:1809: warning: FS_LARGEFILE (defined at fs/Kconfig:20) set more than once. Old value "n", new value "y".
/tmp/260525a/nuttx/build-debug/.config:1810: warning: TLS_NELEM (defined at libs/libc/tls/Kconfig:45) set more than once. Old value "0", new value "16".
/tmp/260525a/nuttx/build-debug/.config:1811: warning: DEV_URANDOM (defined at drivers/crypto/Kconfig:16) set more than once. Old value "n", new value "y".
/tmp/260525a/nuttx/build-debug/.config:1812: warning: EXAMPLES_HELLO_RUST_CARGO (defined at /tmp/260525a/apps/examples/rust/hello/Kconfig:6) set more than once. Old value "n", new value "y".
Loaded configuration '/tmp/260525a/nuttx/build-debug/.config'
Configuration saved to '/tmp/260525a/nuttx/build-debug/.config'
(nuttx) ➜ nuttx git:(fix_cmake_sim_toolchain) ✗ $ cmake --build build-debug
[0/2] Re-checking globbed directories...
[5/8] Linking C executable nuttx
ld: warning: -ld_classic is deprecated and will be removed in a future release
[6/8] Patching Mach-O init section type flags
FAILED: [code=1] arch/sim/src/sim/CMakeFiles/sim_patch_macho_initsection /tmp/260525a/nuttx/build-debug/arch/sim/src/sim/CMakeFiles/sim_patch_macho_initsection
cd /tmp/260525a/nuttx/build-debug/arch/sim/src/sim && /opt/homebrew/Frameworks/Python.framework/Versions/3.13/bin/python3.13 /tmp/260525a/nuttx/arch/sim/src/sim/../patch_macho_initsection.py /tmp/260525a/nuttx/build-debug/nuttx
Error: lief is required. Install with: pip install lief
[7/8] Generating System.map
ninja: build stopped: subcommand failed.
(nuttx) ➜ nuttx git:(fix_cmake_sim_toolchain) ✗ $ ls build-debug
CMakeCache.txt bin_debug defconfig include_apps openamp
CMakeFiles bin_host defconfig.orig libs preapps
System.map binfmt drivers luamod sched
Users boards dummy.c mm syscall
apps build.ninja empty.c net targets
arch cmake_install.cmake fs nuttx wamrmod
audio compile_commands.json graphics nuttx.manifest wireless
bin crypto include nuttx.rel
(nuttx) ➜ nuttx git:(fix_cmake_sim_toolchain) ✗ $ build-debug/nuttx
NuttShell (NSH)
nsh> uname -a
NuttX 0.0.0 db6ec219d1 May 25 2026 18:10:35 sim sim
nsh> hello
Hello, World!!
nsh>
➜ nuttx-github-metrics git:(main) $ neofetch
'c. luppy@5ce91ef07f94
,xNMM. ------------------
.OMMMMo OS: macOS 26.4.1 25E253 arm64
OMMM0, Host: Mac14,12
.;loddo:' loolloddol;. Kernel: 25.4.0
cKMMMMMMMMMMNWMMMMMMMMMM0: Uptime: 25 days, 6 hours, 33 mins
.KMMMMMMMMMMMMMMMMMMMMMMMWd. Packages: 205 (brew)
XMMMMMMMMMMMMMMMMMMMMMMMX. Shell: zsh 5.9
;MMMMMMMMMMMMMMMMMMMMMMMM: Resolution: 3840x2160
:MMMMMMMMMMMMMMMMMMMMMMMM: DE: Aqua
.MMMMMMMMMMMMMMMMMMMMMMMMX. WM: Quartz Compositor
kMMMMMMMMMMMMMMMMMMMMMMMMWd. WM Theme: Blue (Light)
.XMMMMMMMMMMMMMMMMMMMMMMMMMMk Terminal: vscode
.XMMMMMMMMMMMMMMMMMMMMMMMMK. CPU: Apple M2 Pro
kMMMMMMMMMMMMMMMMMMMMMMd GPU: Apple M2 Pro
;KMMMMMMMWXXWMMMMMMMk. Memory: 6151MiB / 32768MiB
.cooc,. .,coo:.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment