NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.94k stars 13.96k forks source link

clangd wrapper script breaks clangd for ARM by adding unwanted x86_64 include paths #348791

Open lukash opened 1 week ago

lukash commented 1 week ago

Describe the bug

clangd extracts x86_64 desktop include flags from arm-none-eabi-gcc, e.g. a python include, QT includes etc.

Reported as clangd issue: https://github.com/clangd/clangd/issues/2181

After some discussion there it seems likely there is some weird NixOS interaction causing this.

$ clangd --query-driver="/nix/store/*/bin/arm-none-eabi-*" --check=src/main.c
I[19:13:48.701] clangd version 18.1.8
I[19:13:48.701] Features: linux
I[19:13:48.701] PID: 2037970
I[19:13:48.701] Working directory: /home/lu/dev/refloat
I[19:13:48.701] argv[0]: /nix/store/0vwmhvjdkli5jz8aygdb6psn9nar660h-clang-tools-18.1.8/bin/clangd
I[19:13:48.701] argv[1]: --query-driver=/nix/store/*/bin/arm-none-eabi-*
I[19:13:48.701] argv[2]: --check=src/main.c
I[19:13:48.701] Entering check mode (no LSP server)
I[19:13:48.701] Testing on source file /home/lu/dev/refloat/src/main.c
I[19:13:48.701] Loading compilation database...
I[19:13:48.702] Loaded compilation database from /home/lu/dev/refloat/compile_commands.json
I[19:13:48.716] System includes extractor: successfully executed /nix/store/9z0l7wpqx3fqybmyp9gjvihw756dg5fi-gcc-arm-embedded-13.2.rel1/bin/arm-none-eabi-gcc
        got includes: "/nix/store/wy8rawky6ml5l02lmkvxrag43m949g63-python3-3.11.8-env/include, /nix/store/1dm1zr8bcbsjcqn53c4701lipyq86fpg-qtdeclarative-5.15.12-dev/include, /nix/store/57bzw90q7i44cspbwdn9xd7wbf49d64x-qtbase-5.15.12-dev/include, /nix/store/bfxa3ky52sx8l9w5cv0z14g09xhlxf9w-libxml2-2.11.7-dev/include, /nix/store/5ij4ccv9cfwx8xmhx0qd38yg4z672xyn-zlib-1.3-dev/include, /nix/store/g51dz84f7d7qinps2p5yy8igf49i77bb-libxslt-1.1.38-dev/include, /nix/store/n9xwya2di22n34s99lj81j3p92cgnahn-openssl-3.0.13-dev/include, /nix/store/g4snrralxm0hdf22a66gvi28i6d7f4hc-sqlite-3.43.2-dev/include, /nix/store/inqb7bvz9m5ic5p77n6ia5zp5baqma8q-harfbuzz-7.3.0-dev/include, /nix/store/42mjgl8r3dvfl19174rpacjzc2qpvr1j-graphite2-1.3.14-dev/include, /nix/store/jf9ry6390py00x739j8zpz0iilfxbg0c-icu4c-73.2-dev/include, /nix/store/xgf6z569v0liabc7i4kcyn57a77fjxzf-libjpeg-turbo-2.1.5.1-dev/include, /nix/store/s8wvzcywpjkcka09pw8r4lii75w3svvm-libpng-apng-1.6.40-dev/include, /nix/store/c5s0z39n4524fkxlz860za6h5pzbhcz4-pcre2-10.42-dev/include, /nix/store/498485p17m8l0g41ykvq0qphcgiy81cm-dbus-1.14.10-dev/include, /nix/store/0134xyb4y7kqcbrvsd8jyws032kjflwv-expat-2.5.0-dev/include, /nix/store/abjw6dr72w702vzirlw2pm8n8cmjd1fv-glib-2.78.4-dev/include, /nix/store/m7nr727h0fy4r3mwqrj1qpqsxlw6grfq-libffi-3.4.4-dev/include, /nix/store/9nz96zcj385xlgyzfkw6szhsc4jskwbv-gettext-0.21.1/include, /nix/store/2jdjiaggd08sxsjaiwcy6w3a5lfl479x-glibc-iconv-2.38/include, /nix/store/rhbjbp9wfy1zw3k948v45nyldfbv1bnv-systemd-minimal-libs-254.6-dev/include, /nix/store/cxp5wpzdiw7z59i6h589w1qc2ka4rdn8-fontconfig-2.14.2-dev/include, /nix/store/l394rx7mfk529f4qzbgryz4zb6hjms3k-freetype-2.13.2-dev/include, /nix/store/37s7ramg2kfwmdbkliwhfxqm6mljc7ip-bzip2-1.0.8-dev/include, /nix/store/ky7y62vv4agcm0b3afp8qmilw8x11naf-brotli-1.1.0-dev/include, /nix/store/shnla8vp4dx7ams238w32pkxpi702r84-libdrm-2.4.118-dev/include, /nix/store/9n6kwqffiqdrk5npzcmsvzc58krpdsxh-libX11-1.8.7-dev/include, /nix/store/lz5fc7z4n5cizzawzfgys71zljy8zldd-xorgproto-2023.2/include, /nix/store/hy2a1vfm5mhmdps61yyj74v39cva4gzd-libxcb-1.16-dev/include, /nix/store/ib0pzrmi6va4j5dfysd7x00syl6932lr-libXcomposite-0.4.6-dev/include, /nix/store/bav1cb76wxyb6h0m3hbbs1p2bnj3rikk-libXfixes-6.0.1-dev/include, /nix/store/wikpa6v3x5kbmb1g347zhsnawadgpl11-libXext-1.3.5-dev/include, /nix/store/3jfwqw98nwsv0vm30igwldx03hn9l3l7-libXau-1.0.11-dev/include, /nix/store/2dsq2skb7lbrw75ah7062y4bz2f8dpb9-libXi-1.8.1-dev/include, /nix/store/wl2rcj2yjhsqpjylrbrgadc5f77g1p5q-libXrender-0.9.11-dev/include, /nix/store/q5rnxak19qcqxgf69h75rzqfm6qjxxp1-libxkbcommon-1.5.0-dev/include, /nix/store/f1b3dvip1vyh6fwkk469q04jrsc3qlb4-xcb-util-0.4.1-dev/include, /nix/store/mvdh9d5m5ihgjjlvijnhr7r0dip7f1l7-xcb-util-image-0.4.1-dev/include, /nix/store/ign0chpzc291ay0rlw1kwhf22fb68y0h-xcb-util-keysyms-0.4.1-dev/include, /nix/store/0kna6q6s7pv2w782d96z9gii0shmc8cn-xcb-util-renderutil-0.3.10-dev/include, /nix/store/h6zkqjqjnq1k2150i8wx5ms38k8djlkk-xcb-util-wm-0.4.2-dev/include, /nix/store/alg3cjz4x2cl65ywwsvyq2hvwkmsmp19-libGL-1.7.0-dev/include, /nix/store/gn1hpyrh9j8snkf5h0as4acdw50bal8s-qtsvg-5.15.12-dev/include, /nix/store/yp441ann6ch705yk708h61ywxn7ayhj3-glibc-2.39-52-dev/include, /nix/store/qg9s4a1473skkrsrh1nykfvxm6w5p23d-clang-wrapper-18.1.8/resource-root/include, /nix/store/9z0l7wpqx3fqybmyp9gjvihw756dg5fi-gcc-arm-embedded-13.2.rel1/bin/../lib/gcc/arm-none-eabi/13.2.1/include-fixed, /nix/store/9z0l7wpqx3fqybmyp9gjvihw756dg5fi-gcc-arm-embedded-13.2.rel1/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/include"
        got target: "arm-none-eabi"
I[19:13:48.716] Compile command from CDB is: [/home/lu/dev/refloat/src] /nix/store/9z0l7wpqx3fqybmyp9gjvihw756dg5fi-gcc-arm-embedded-13.2.rel1/bin/arm-none-eabi-gcc -fpic -Os -Wall -Wextra -Wundef -std=gnu99 -I../vesc_pkg_lib/ -I../vesc_pkg_lib//stdperiph_stm32f4//CMSIS/include -I../vesc_pkg_lib//stdperiph_stm32f4//CMSIS/ST -I../vesc_pkg_lib//utils// -fomit-frame-pointer -falign-functions=16 -mthumb -fsingle-precision-constant -Wdouble-promotion -mfloat-abi=hard -mfpu=fpv4-sp-d16 -mcpu=cortex-m4 -fdata-sections -ffunction-sections -DIS_VESC_LIB -DUSE_STLIB -I../vesc_pkg_lib//stdperiph_stm32f4//inc -flto -c -o main.so -isystem /nix/store/wy8rawky6ml5l02lmkvxrag43m949g63-python3-3.11.8-env/include -isystem /nix/store/1dm1zr8bcbsjcqn53c4701lipyq86fpg-qtdeclarative-5.15.12-dev/include -isystem /nix/store/57bzw90q7i44cspbwdn9xd7wbf49d64x-qtbase-5.15.12-dev/include -isystem /nix/store/bfxa3ky52sx8l9w5cv0z14g09xhlxf9w-libxml2-2.11.7-dev/include -isystem /nix/store/5ij4ccv9cfwx8xmhx0qd38yg4z672xyn-zlib-1.3-dev/include -isystem /nix/store/g51dz84f7d7qinps2p5yy8igf49i77bb-libxslt-1.1.38-dev/include -isystem /nix/store/n9xwya2di22n34s99lj81j3p92cgnahn-openssl-3.0.13-dev/include -isystem /nix/store/g4snrralxm0hdf22a66gvi28i6d7f4hc-sqlite-3.43.2-dev/include -isystem /nix/store/inqb7bvz9m5ic5p77n6ia5zp5baqma8q-harfbuzz-7.3.0-dev/include -isystem /nix/store/42mjgl8r3dvfl19174rpacjzc2qpvr1j-graphite2-1.3.14-dev/include -isystem /nix/store/jf9ry6390py00x739j8zpz0iilfxbg0c-icu4c-73.2-dev/include -isystem /nix/store/xgf6z569v0liabc7i4kcyn57a77fjxzf-libjpeg-turbo-2.1.5.1-dev/include -isystem /nix/store/s8wvzcywpjkcka09pw8r4lii75w3svvm-libpng-apng-1.6.40-dev/include -isystem /nix/store/c5s0z39n4524fkxlz860za6h5pzbhcz4-pcre2-10.42-dev/include -isystem /nix/store/498485p17m8l0g41ykvq0qphcgiy81cm-dbus-1.14.10-dev/include -isystem /nix/store/0134xyb4y7kqcbrvsd8jyws032kjflwv-expat-2.5.0-dev/include -isystem /nix/store/abjw6dr72w702vzirlw2pm8n8cmjd1fv-glib-2.78.4-dev/include -isystem /nix/store/m7nr727h0fy4r3mwqrj1qpqsxlw6grfq-libffi-3.4.4-dev/include -isystem /nix/store/9nz96zcj385xlgyzfkw6szhsc4jskwbv-gettext-0.21.1/include -isystem /nix/store/2jdjiaggd08sxsjaiwcy6w3a5lfl479x-glibc-iconv-2.38/include -isystem /nix/store/rhbjbp9wfy1zw3k948v45nyldfbv1bnv-systemd-minimal-libs-254.6-dev/include -isystem /nix/store/cxp5wpzdiw7z59i6h589w1qc2ka4rdn8-fontconfig-2.14.2-dev/include -isystem /nix/store/l394rx7mfk529f4qzbgryz4zb6hjms3k-freetype-2.13.2-dev/include -isystem /nix/store/37s7ramg2kfwmdbkliwhfxqm6mljc7ip-bzip2-1.0.8-dev/include -isystem /nix/store/ky7y62vv4agcm0b3afp8qmilw8x11naf-brotli-1.1.0-dev/include -isystem /nix/store/shnla8vp4dx7ams238w32pkxpi702r84-libdrm-2.4.118-dev/include -isystem /nix/store/9n6kwqffiqdrk5npzcmsvzc58krpdsxh-libX11-1.8.7-dev/include -isystem /nix/store/lz5fc7z4n5cizzawzfgys71zljy8zldd-xorgproto-2023.2/include -isystem /nix/store/hy2a1vfm5mhmdps61yyj74v39cva4gzd-libxcb-1.16-dev/include -isystem /nix/store/ib0pzrmi6va4j5dfysd7x00syl6932lr-libXcomposite-0.4.6-dev/include -isystem /nix/store/bav1cb76wxyb6h0m3hbbs1p2bnj3rikk-libXfixes-6.0.1-dev/include -isystem /nix/store/wikpa6v3x5kbmb1g347zhsnawadgpl11-libXext-1.3.5-dev/include -isystem /nix/store/3jfwqw98nwsv0vm30igwldx03hn9l3l7-libXau-1.0.11-dev/include -isystem /nix/store/2dsq2skb7lbrw75ah7062y4bz2f8dpb9-libXi-1.8.1-dev/include -isystem /nix/store/wl2rcj2yjhsqpjylrbrgadc5f77g1p5q-libXrender-0.9.11-dev/include -isystem /nix/store/q5rnxak19qcqxgf69h75rzqfm6qjxxp1-libxkbcommon-1.5.0-dev/include -isystem /nix/store/f1b3dvip1vyh6fwkk469q04jrsc3qlb4-xcb-util-0.4.1-dev/include -isystem /nix/store/mvdh9d5m5ihgjjlvijnhr7r0dip7f1l7-xcb-util-image-0.4.1-dev/include -isystem /nix/store/ign0chpzc291ay0rlw1kwhf22fb68y0h-xcb-util-keysyms-0.4.1-dev/include -isystem /nix/store/0kna6q6s7pv2w782d96z9gii0shmc8cn-xcb-util-renderutil-0.3.10-dev/include -isystem /nix/store/h6zkqjqjnq1k2150i8wx5ms38k8djlkk-xcb-util-wm-0.4.2-dev/include -isystem /nix/store/alg3cjz4x2cl65ywwsvyq2hvwkmsmp19-libGL-1.7.0-dev/include -isystem /nix/store/gn1hpyrh9j8snkf5h0as4acdw50bal8s-qtsvg-5.15.12-dev/include -isystem /nix/store/yp441ann6ch705yk708h61ywxn7ayhj3-glibc-2.39-52-dev/include -isystem /nix/store/qg9s4a1473skkrsrh1nykfvxm6w5p23d-clang-wrapper-18.1.8/resource-root/include -isystem /nix/store/9z0l7wpqx3fqybmyp9gjvihw756dg5fi-gcc-arm-embedded-13.2.rel1/bin/../lib/gcc/arm-none-eabi/13.2.1/include-fixed -isystem /nix/store/9z0l7wpqx3fqybmyp9gjvihw756dg5fi-gcc-arm-embedded-13.2.rel1/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/include --target=arm-none-eabi -resource-dir=/nix/store/maa8li4ybxv6hb2k23n4akqdk609fh1r-clang-18.1.8/lib/clang/18 -- /home/lu/dev/refloat/src/main.c
I[19:13:48.716] Parsing command...
I[19:13:48.718] internal (cc1) args are: -cc1 -triple thumbv7em-none-unknown-eabihf -fsyntax-only -flto=full -flto-unit -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name main.c -function-alignment 4 -mrelocation-model pic -pic-level 1 -fhalf-no-semantic-interposition -mframe-pointer=none -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -nostdsysteminc -target-cpu cortex-m4 -target-feature -crc -target-feature -dotprod -target-feature +dsp -target-feature -mve -target-feature -mve.fp -target-feature -ras -target-feature -bf16 -target-feature -sb -target-feature -i8mm -target-feature -lob -target-feature -cdecp0 -target-feature -cdecp1 -target-feature -cdecp2 -target-feature -cdecp3 -target-feature -cdecp4 -target-feature -cdecp5 -target-feature -cdecp6 -target-feature -cdecp7 -target-feature -pacbti -target-feature -hwdiv-arm -target-feature +hwdiv -target-feature -vfp2 -target-feature +vfp2sp -target-feature -vfp3 -target-feature -vfp3d16 -target-feature +vfp3d16sp -target-feature -vfp3sp -target-feature +fp16 -target-feature -vfp4 -target-feature -vfp4d16 -target-feature +vfp4d16sp -target-feature -vfp4sp -target-feature -fp-armv8 -target-feature -fp-armv8d16 -target-feature -fp-armv8d16sp -target-feature -fp-armv8sp -target-feature -fullfp16 -target-feature -fp64 -target-feature -d32 -target-feature -neon -target-feature -fp16fml -target-feature -crypto -target-feature -sha2 -target-feature -aes -target-feature +strict-align -target-abi aapcs -mfloat-abi hard -Wunaligned-access -debugger-tuning=gdb -fdebug-compilation-dir=/home/lu/dev/refloat/src -ffunction-sections -fdata-sections -fcoverage-compilation-dir=/home/lu/dev/refloat/src -nostdsysteminc -resource-dir /nix/store/maa8li4ybxv6hb2k23n4akqdk609fh1r-clang-18.1.8/lib/clang/18 -isystem /nix/store/wy8rawky6ml5l02lmkvxrag43m949g63-python3-3.11.8-env/include -isystem /nix/store/1dm1zr8bcbsjcqn53c4701lipyq86fpg-qtdeclarative-5.15.12-dev/include -isystem /nix/store/57bzw90q7i44cspbwdn9xd7wbf49d64x-qtbase-5.15.12-dev/include -isystem /nix/store/bfxa3ky52sx8l9w5cv0z14g09xhlxf9w-libxml2-2.11.7-dev/include -isystem /nix/store/5ij4ccv9cfwx8xmhx0qd38yg4z672xyn-zlib-1.3-dev/include -isystem /nix/store/g51dz84f7d7qinps2p5yy8igf49i77bb-libxslt-1.1.38-dev/include -isystem /nix/store/n9xwya2di22n34s99lj81j3p92cgnahn-openssl-3.0.13-dev/include -isystem /nix/store/g4snrralxm0hdf22a66gvi28i6d7f4hc-sqlite-3.43.2-dev/include -isystem /nix/store/inqb7bvz9m5ic5p77n6ia5zp5baqma8q-harfbuzz-7.3.0-dev/include -isystem /nix/store/42mjgl8r3dvfl19174rpacjzc2qpvr1j-graphite2-1.3.14-dev/include -isystem /nix/store/jf9ry6390py00x739j8zpz0iilfxbg0c-icu4c-73.2-dev/include -isystem /nix/store/xgf6z569v0liabc7i4kcyn57a77fjxzf-libjpeg-turbo-2.1.5.1-dev/include -isystem /nix/store/s8wvzcywpjkcka09pw8r4lii75w3svvm-libpng-apng-1.6.40-dev/include -isystem /nix/store/c5s0z39n4524fkxlz860za6h5pzbhcz4-pcre2-10.42-dev/include -isystem /nix/store/498485p17m8l0g41ykvq0qphcgiy81cm-dbus-1.14.10-dev/include -isystem /nix/store/0134xyb4y7kqcbrvsd8jyws032kjflwv-expat-2.5.0-dev/include -isystem /nix/store/abjw6dr72w702vzirlw2pm8n8cmjd1fv-glib-2.78.4-dev/include -isystem /nix/store/m7nr727h0fy4r3mwqrj1qpqsxlw6grfq-libffi-3.4.4-dev/include -isystem /nix/store/9nz96zcj385xlgyzfkw6szhsc4jskwbv-gettext-0.21.1/include -isystem /nix/store/2jdjiaggd08sxsjaiwcy6w3a5lfl479x-glibc-iconv-2.38/include -isystem /nix/store/rhbjbp9wfy1zw3k948v45nyldfbv1bnv-systemd-minimal-libs-254.6-dev/include -isystem /nix/store/cxp5wpzdiw7z59i6h589w1qc2ka4rdn8-fontconfig-2.14.2-dev/include -isystem /nix/store/l394rx7mfk529f4qzbgryz4zb6hjms3k-freetype-2.13.2-dev/include -isystem /nix/store/37s7ramg2kfwmdbkliwhfxqm6mljc7ip-bzip2-1.0.8-dev/include -isystem /nix/store/ky7y62vv4agcm0b3afp8qmilw8x11naf-brotli-1.1.0-dev/include -isystem /nix/store/shnla8vp4dx7ams238w32pkxpi702r84-libdrm-2.4.118-dev/include -isystem /nix/store/9n6kwqffiqdrk5npzcmsvzc58krpdsxh-libX11-1.8.7-dev/include -isystem /nix/store/lz5fc7z4n5cizzawzfgys71zljy8zldd-xorgproto-2023.2/include -isystem /nix/store/hy2a1vfm5mhmdps61yyj74v39cva4gzd-libxcb-1.16-dev/include -isystem /nix/store/ib0pzrmi6va4j5dfysd7x00syl6932lr-libXcomposite-0.4.6-dev/include -isystem /nix/store/bav1cb76wxyb6h0m3hbbs1p2bnj3rikk-libXfixes-6.0.1-dev/include -isystem /nix/store/wikpa6v3x5kbmb1g347zhsnawadgpl11-libXext-1.3.5-dev/include -isystem /nix/store/3jfwqw98nwsv0vm30igwldx03hn9l3l7-libXau-1.0.11-dev/include -isystem /nix/store/2dsq2skb7lbrw75ah7062y4bz2f8dpb9-libXi-1.8.1-dev/include -isystem /nix/store/wl2rcj2yjhsqpjylrbrgadc5f77g1p5q-libXrender-0.9.11-dev/include -isystem /nix/store/q5rnxak19qcqxgf69h75rzqfm6qjxxp1-libxkbcommon-1.5.0-dev/include -isystem /nix/store/f1b3dvip1vyh6fwkk469q04jrsc3qlb4-xcb-util-0.4.1-dev/include -isystem /nix/store/mvdh9d5m5ihgjjlvijnhr7r0dip7f1l7-xcb-util-image-0.4.1-dev/include -isystem /nix/store/ign0chpzc291ay0rlw1kwhf22fb68y0h-xcb-util-keysyms-0.4.1-dev/include -isystem /nix/store/0kna6q6s7pv2w782d96z9gii0shmc8cn-xcb-util-renderutil-0.3.10-dev/include -isystem /nix/store/h6zkqjqjnq1k2150i8wx5ms38k8djlkk-xcb-util-wm-0.4.2-dev/include -isystem /nix/store/alg3cjz4x2cl65ywwsvyq2hvwkmsmp19-libGL-1.7.0-dev/include -isystem /nix/store/gn1hpyrh9j8snkf5h0as4acdw50bal8s-qtsvg-5.15.12-dev/include -isystem /nix/store/yp441ann6ch705yk708h61ywxn7ayhj3-glibc-2.39-52-dev/include -isystem /nix/store/qg9s4a1473skkrsrh1nykfvxm6w5p23d-clang-wrapper-18.1.8/resource-root/include -isystem /nix/store/9z0l7wpqx3fqybmyp9gjvihw756dg5fi-gcc-arm-embedded-13.2.rel1/bin/../lib/gcc/arm-none-eabi/13.2.1/include-fixed -isystem /nix/store/9z0l7wpqx3fqybmyp9gjvihw756dg5fi-gcc-arm-embedded-13.2.rel1/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/include -I ../vesc_pkg_lib/ -I ../vesc_pkg_lib//stdperiph_stm32f4//CMSIS/include -I ../vesc_pkg_lib//stdperiph_stm32f4//CMSIS/ST -I ../vesc_pkg_lib//utils// -D IS_VESC_LIB -D USE_STLIB -I ../vesc_pkg_lib//stdperiph_stm32f4//inc -I/nix/store/wy8rawky6ml5l02lmkvxrag43m949g63-python3-3.11.8-env/include -I/nix/store/1dm1zr8bcbsjcqn53c4701lipyq86fpg-qtdeclarative-5.15.12-dev/include -I/nix/store/57bzw90q7i44cspbwdn9xd7wbf49d64x-qtbase-5.15.12-dev/include -I/nix/store/bfxa3ky52sx8l9w5cv0z14g09xhlxf9w-libxml2-2.11.7-dev/include -I/nix/store/5ij4ccv9cfwx8xmhx0qd38yg4z672xyn-zlib-1.3-dev/include -I/nix/store/g51dz84f7d7qinps2p5yy8igf49i77bb-libxslt-1.1.38-dev/include -I/nix/store/n9xwya2di22n34s99lj81j3p92cgnahn-openssl-3.0.13-dev/include -I/nix/store/g4snrralxm0hdf22a66gvi28i6d7f4hc-sqlite-3.43.2-dev/include -I/nix/store/inqb7bvz9m5ic5p77n6ia5zp5baqma8q-harfbuzz-7.3.0-dev/include -I/nix/store/42mjgl8r3dvfl19174rpacjzc2qpvr1j-graphite2-1.3.14-dev/include -I/nix/store/jf9ry6390py00x739j8zpz0iilfxbg0c-icu4c-73.2-dev/include -I/nix/store/xgf6z569v0liabc7i4kcyn57a77fjxzf-libjpeg-turbo-2.1.5.1-dev/include -I/nix/store/s8wvzcywpjkcka09pw8r4lii75w3svvm-libpng-apng-1.6.40-dev/include -I/nix/store/c5s0z39n4524fkxlz860za6h5pzbhcz4-pcre2-10.42-dev/include -I/nix/store/498485p17m8l0g41ykvq0qphcgiy81cm-dbus-1.14.10-dev/include -I/nix/store/0134xyb4y7kqcbrvsd8jyws032kjflwv-expat-2.5.0-dev/include -I/nix/store/abjw6dr72w702vzirlw2pm8n8cmjd1fv-glib-2.78.4-dev/include -I/nix/store/m7nr727h0fy4r3mwqrj1qpqsxlw6grfq-libffi-3.4.4-dev/include -I/nix/store/9nz96zcj385xlgyzfkw6szhsc4jskwbv-gettext-0.21.1/include -I/nix/store/2jdjiaggd08sxsjaiwcy6w3a5lfl479x-glibc-iconv-2.38/include -I/nix/store/rhbjbp9wfy1zw3k948v45nyldfbv1bnv-systemd-minimal-libs-254.6-dev/include -I/nix/store/cxp5wpzdiw7z59i6h589w1qc2ka4rdn8-fontconfig-2.14.2-dev/include -I/nix/store/l394rx7mfk529f4qzbgryz4zb6hjms3k-freetype-2.13.2-dev/include -I/nix/store/37s7ramg2kfwmdbkliwhfxqm6mljc7ip-bzip2-1.0.8-dev/include -I/nix/store/ky7y62vv4agcm0b3afp8qmilw8x11naf-brotli-1.1.0-dev/include -I/nix/store/shnla8vp4dx7ams238w32pkxpi702r84-libdrm-2.4.118-dev/include -I/nix/store/9n6kwqffiqdrk5npzcmsvzc58krpdsxh-libX11-1.8.7-dev/include -I/nix/store/lz5fc7z4n5cizzawzfgys71zljy8zldd-xorgproto-2023.2/include -I/nix/store/hy2a1vfm5mhmdps61yyj74v39cva4gzd-libxcb-1.16-dev/include -I/nix/store/ib0pzrmi6va4j5dfysd7x00syl6932lr-libXcomposite-0.4.6-dev/include -I/nix/store/bav1cb76wxyb6h0m3hbbs1p2bnj3rikk-libXfixes-6.0.1-dev/include -I/nix/store/wikpa6v3x5kbmb1g347zhsnawadgpl11-libXext-1.3.5-dev/include -I/nix/store/3jfwqw98nwsv0vm30igwldx03hn9l3l7-libXau-1.0.11-dev/include -I/nix/store/2dsq2skb7lbrw75ah7062y4bz2f8dpb9-libXi-1.8.1-dev/include -I/nix/store/wl2rcj2yjhsqpjylrbrgadc5f77g1p5q-libXrender-0.9.11-dev/include -I/nix/store/q5rnxak19qcqxgf69h75rzqfm6qjxxp1-libxkbcommon-1.5.0-dev/include -I/nix/store/f1b3dvip1vyh6fwkk469q04jrsc3qlb4-xcb-util-0.4.1-dev/include -I/nix/store/mvdh9d5m5ihgjjlvijnhr7r0dip7f1l7-xcb-util-image-0.4.1-dev/include -I/nix/store/ign0chpzc291ay0rlw1kwhf22fb68y0h-xcb-util-keysyms-0.4.1-dev/include -I/nix/store/0kna6q6s7pv2w782d96z9gii0shmc8cn-xcb-util-renderutil-0.3.10-dev/include -I/nix/store/h6zkqjqjnq1k2150i8wx5ms38k8djlkk-xcb-util-wm-0.4.2-dev/include -I/nix/store/alg3cjz4x2cl65ywwsvyq2hvwkmsmp19-libGL-1.7.0-dev/include -I/nix/store/0y2msmmcwvn2vazq72fjva1al7j0jr0b-libglvnd-1.7.0-dev/include -I/nix/store/gn1hpyrh9j8snkf5h0as4acdw50bal8s-qtsvg-5.15.12-dev/include -I/nix/store/wy8rawky6ml5l02lmkvxrag43m949g63-python3-3.11.8-env/include -I/nix/store/1dm1zr8bcbsjcqn53c4701lipyq86fpg-qtdeclarative-5.15.12-dev/include -I/nix/store/57bzw90q7i44cspbwdn9xd7wbf49d64x-qtbase-5.15.12-dev/include -I/nix/store/bfxa3ky52sx8l9w5cv0z14g09xhlxf9w-libxml2-2.11.7-dev/include -I/nix/store/5ij4ccv9cfwx8xmhx0qd38yg4z672xyn-zlib-1.3-dev/include -I/nix/store/g51dz84f7d7qinps2p5yy8igf49i77bb-libxslt-1.1.38-dev/include -I/nix/store/n9xwya2di22n34s99lj81j3p92cgnahn-openssl-3.0.13-dev/include -I/nix/store/g4snrralxm0hdf22a66gvi28i6d7f4hc-sqlite-3.43.2-dev/include -I/nix/store/inqb7bvz9m5ic5p77n6ia5zp5baqma8q-harfbuzz-7.3.0-dev/include -I/nix/store/42mjgl8r3dvfl19174rpacjzc2qpvr1j-graphite2-1.3.14-dev/include -I/nix/store/jf9ry6390py00x739j8zpz0iilfxbg0c-icu4c-73.2-dev/include -I/nix/store/xgf6z569v0liabc7i4kcyn57a77fjxzf-libjpeg-turbo-2.1.5.1-dev/include -I/nix/store/s8wvzcywpjkcka09pw8r4lii75w3svvm-libpng-apng-1.6.40-dev/include -I/nix/store/c5s0z39n4524fkxlz860za6h5pzbhcz4-pcre2-10.42-dev/include -I/nix/store/498485p17m8l0g41ykvq0qphcgiy81cm-dbus-1.14.10-dev/include -I/nix/store/0134xyb4y7kqcbrvsd8jyws032kjflwv-expat-2.5.0-dev/include -I/nix/store/abjw6dr72w702vzirlw2pm8n8cmjd1fv-glib-2.78.4-dev/include -I/nix/store/m7nr727h0fy4r3mwqrj1qpqsxlw6grfq-libffi-3.4.4-dev/include -I/nix/store/9nz96zcj385xlgyzfkw6szhsc4jskwbv-gettext-0.21.1/include -I/nix/store/2jdjiaggd08sxsjaiwcy6w3a5lfl479x-glibc-iconv-2.38/include -I/nix/store/rhbjbp9wfy1zw3k948v45nyldfbv1bnv-systemd-minimal-libs-254.6-dev/include -I/nix/store/cxp5wpzdiw7z59i6h589w1qc2ka4rdn8-fontconfig-2.14.2-dev/include -I/nix/store/l394rx7mfk529f4qzbgryz4zb6hjms3k-freetype-2.13.2-dev/include -I/nix/store/37s7ramg2kfwmdbkliwhfxqm6mljc7ip-bzip2-1.0.8-dev/include -I/nix/store/ky7y62vv4agcm0b3afp8qmilw8x11naf-brotli-1.1.0-dev/include -I/nix/store/shnla8vp4dx7ams238w32pkxpi702r84-libdrm-2.4.118-dev/include -I/nix/store/9n6kwqffiqdrk5npzcmsvzc58krpdsxh-libX11-1.8.7-dev/include -I/nix/store/lz5fc7z4n5cizzawzfgys71zljy8zldd-xorgproto-2023.2/include -I/nix/store/hy2a1vfm5mhmdps61yyj74v39cva4gzd-libxcb-1.16-dev/include -I/nix/store/ib0pzrmi6va4j5dfysd7x00syl6932lr-libXcomposite-0.4.6-dev/include -I/nix/store/bav1cb76wxyb6h0m3hbbs1p2bnj3rikk-libXfixes-6.0.1-dev/include -I/nix/store/wikpa6v3x5kbmb1g347zhsnawadgpl11-libXext-1.3.5-dev/include -I/nix/store/3jfwqw98nwsv0vm30igwldx03hn9l3l7-libXau-1.0.11-dev/include -I/nix/store/2dsq2skb7lbrw75ah7062y4bz2f8dpb9-libXi-1.8.1-dev/include -I/nix/store/wl2rcj2yjhsqpjylrbrgadc5f77g1p5q-libXrender-0.9.11-dev/include -I/nix/store/q5rnxak19qcqxgf69h75rzqfm6qjxxp1-libxkbcommon-1.5.0-dev/include -I/nix/store/f1b3dvip1vyh6fwkk469q04jrsc3qlb4-xcb-util-0.4.1-dev/include -I/nix/store/mvdh9d5m5ihgjjlvijnhr7r0dip7f1l7-xcb-util-image-0.4.1-dev/include -I/nix/store/ign0chpzc291ay0rlw1kwhf22fb68y0h-xcb-util-keysyms-0.4.1-dev/include -I/nix/store/0kna6q6s7pv2w782d96z9gii0shmc8cn-xcb-util-renderutil-0.3.10-dev/include -I/nix/store/h6zkqjqjnq1k2150i8wx5ms38k8djlkk-xcb-util-wm-0.4.2-dev/include -I/nix/store/alg3cjz4x2cl65ywwsvyq2hvwkmsmp19-libGL-1.7.0-dev/include -I/nix/store/0y2msmmcwvn2vazq72fjva1al7j0jr0b-libglvnd-1.7.0-dev/include -I/nix/store/gn1hpyrh9j8snkf5h0as4acdw50bal8s-qtsvg-5.15.12-dev/include -I/nix/store/yp441ann6ch705yk708h61ywxn7ayhj3-glibc-2.39-52-dev/include -I/nix/store/qg9s4a1473skkrsrh1nykfvxm6w5p23d-clang-wrapper-18.1.8/resource-root/include -cxx-isystem /nix/store/wy8rawky6ml5l02lmkvxrag43m949g63-python3-3.11.8-env/include -cxx-isystem /nix/store/1dm1zr8bcbsjcqn53c4701lipyq86fpg-qtdeclarative-5.15.12-dev/include -cxx-isystem /nix/store/57bzw90q7i44cspbwdn9xd7wbf49d64x-qtbase-5.15.12-dev/include -cxx-isystem /nix/store/bfxa3ky52sx8l9w5cv0z14g09xhlxf9w-libxml2-2.11.7-dev/include -cxx-isystem /nix/store/5ij4ccv9cfwx8xmhx0qd38yg4z672xyn-zlib-1.3-dev/include -cxx-isystem /nix/store/g51dz84f7d7qinps2p5yy8igf49i77bb-libxslt-1.1.38-dev/include -cxx-isystem /nix/store/n9xwya2di22n34s99lj81j3p92cgnahn-openssl-3.0.13-dev/include -cxx-isystem /nix/store/g4snrralxm0hdf22a66gvi28i6d7f4hc-sqlite-3.43.2-dev/include -cxx-isystem /nix/store/inqb7bvz9m5ic5p77n6ia5zp5baqma8q-harfbuzz-7.3.0-dev/include -cxx-isystem /nix/store/42mjgl8r3dvfl19174rpacjzc2qpvr1j-graphite2-1.3.14-dev/include -cxx-isystem /nix/store/jf9ry6390py00x739j8zpz0iilfxbg0c-icu4c-73.2-dev/include -cxx-isystem /nix/store/xgf6z569v0liabc7i4kcyn57a77fjxzf-libjpeg-turbo-2.1.5.1-dev/include -cxx-isystem /nix/store/s8wvzcywpjkcka09pw8r4lii75w3svvm-libpng-apng-1.6.40-dev/include -cxx-isystem /nix/store/c5s0z39n4524fkxlz860za6h5pzbhcz4-pcre2-10.42-dev/include -cxx-isystem /nix/store/498485p17m8l0g41ykvq0qphcgiy81cm-dbus-1.14.10-dev/include -cxx-isystem /nix/store/0134xyb4y7kqcbrvsd8jyws032kjflwv-expat-2.5.0-dev/include -cxx-isystem /nix/store/abjw6dr72w702vzirlw2pm8n8cmjd1fv-glib-2.78.4-dev/include -cxx-isystem /nix/store/m7nr727h0fy4r3mwqrj1qpqsxlw6grfq-libffi-3.4.4-dev/include -cxx-isystem /nix/store/9nz96zcj385xlgyzfkw6szhsc4jskwbv-gettext-0.21.1/include -cxx-isystem /nix/store/2jdjiaggd08sxsjaiwcy6w3a5lfl479x-glibc-iconv-2.38/include -cxx-isystem /nix/store/rhbjbp9wfy1zw3k948v45nyldfbv1bnv-systemd-minimal-libs-254.6-dev/include -cxx-isystem /nix/store/cxp5wpzdiw7z59i6h589w1qc2ka4rdn8-fontconfig-2.14.2-dev/include -cxx-isystem /nix/store/l394rx7mfk529f4qzbgryz4zb6hjms3k-freetype-2.13.2-dev/include -cxx-isystem /nix/store/37s7ramg2kfwmdbkliwhfxqm6mljc7ip-bzip2-1.0.8-dev/include -cxx-isystem /nix/store/ky7y62vv4agcm0b3afp8qmilw8x11naf-brotli-1.1.0-dev/include -cxx-isystem /nix/store/shnla8vp4dx7ams238w32pkxpi702r84-libdrm-2.4.118-dev/include -cxx-isystem /nix/store/9n6kwqffiqdrk5npzcmsvzc58krpdsxh-libX11-1.8.7-dev/include -cxx-isystem /nix/store/lz5fc7z4n5cizzawzfgys71zljy8zldd-xorgproto-2023.2/include -cxx-isystem /nix/store/hy2a1vfm5mhmdps61yyj74v39cva4gzd-libxcb-1.16-dev/include -cxx-isystem /nix/store/ib0pzrmi6va4j5dfysd7x00syl6932lr-libXcomposite-0.4.6-dev/include -cxx-isystem /nix/store/bav1cb76wxyb6h0m3hbbs1p2bnj3rikk-libXfixes-6.0.1-dev/include -cxx-isystem /nix/store/wikpa6v3x5kbmb1g347zhsnawadgpl11-libXext-1.3.5-dev/include -cxx-isystem /nix/store/3jfwqw98nwsv0vm30igwldx03hn9l3l7-libXau-1.0.11-dev/include -cxx-isystem /nix/store/2dsq2skb7lbrw75ah7062y4bz2f8dpb9-libXi-1.8.1-dev/include -cxx-isystem /nix/store/wl2rcj2yjhsqpjylrbrgadc5f77g1p5q-libXrender-0.9.11-dev/include -cxx-isystem /nix/store/q5rnxak19qcqxgf69h75rzqfm6qjxxp1-libxkbcommon-1.5.0-dev/include -cxx-isystem /nix/store/f1b3dvip1vyh6fwkk469q04jrsc3qlb4-xcb-util-0.4.1-dev/include -cxx-isystem /nix/store/mvdh9d5m5ihgjjlvijnhr7r0dip7f1l7-xcb-util-image-0.4.1-dev/include -cxx-isystem /nix/store/ign0chpzc291ay0rlw1kwhf22fb68y0h-xcb-util-keysyms-0.4.1-dev/include -cxx-isystem /nix/store/0kna6q6s7pv2w782d96z9gii0shmc8cn-xcb-util-renderutil-0.3.10-dev/include -cxx-isystem /nix/store/h6zkqjqjnq1k2150i8wx5ms38k8djlkk-xcb-util-wm-0.4.2-dev/include -cxx-isystem /nix/store/alg3cjz4x2cl65ywwsvyq2hvwkmsmp19-libGL-1.7.0-dev/include -cxx-isystem /nix/store/0y2msmmcwvn2vazq72fjva1al7j0jr0b-libglvnd-1.7.0-dev/include -cxx-isystem /nix/store/gn1hpyrh9j8snkf5h0as4acdw50bal8s-qtsvg-5.15.12-dev/include -cxx-isystem /nix/store/wy8rawky6ml5l02lmkvxrag43m949g63-python3-3.11.8-env/include -cxx-isystem /nix/store/1dm1zr8bcbsjcqn53c4701lipyq86fpg-qtdeclarative-5.15.12-dev/include -cxx-isystem /nix/store/57bzw90q7i44cspbwdn9xd7wbf49d64x-qtbase-5.15.12-dev/include -cxx-isystem /nix/store/bfxa3ky52sx8l9w5cv0z14g09xhlxf9w-libxml2-2.11.7-dev/include -cxx-isystem /nix/store/5ij4ccv9cfwx8xmhx0qd38yg4z672xyn-zlib-1.3-dev/include -cxx-isystem /nix/store/g51dz84f7d7qinps2p5yy8igf49i77bb-libxslt-1.1.38-dev/include -cxx-isystem /nix/store/n9xwya2di22n34s99lj81j3p92cgnahn-openssl-3.0.13-dev/include -cxx-isystem /nix/store/g4snrralxm0hdf22a66gvi28i6d7f4hc-sqlite-3.43.2-dev/include -cxx-isystem /nix/store/inqb7bvz9m5ic5p77n6ia5zp5baqma8q-harfbuzz-7.3.0-dev/include -cxx-isystem /nix/store/42mjgl8r3dvfl19174rpacjzc2qpvr1j-graphite2-1.3.14-dev/include -cxx-isystem /nix/store/jf9ry6390py00x739j8zpz0iilfxbg0c-icu4c-73.2-dev/include -cxx-isystem /nix/store/xgf6z569v0liabc7i4kcyn57a77fjxzf-libjpeg-turbo-2.1.5.1-dev/include -cxx-isystem /nix/store/s8wvzcywpjkcka09pw8r4lii75w3svvm-libpng-apng-1.6.40-dev/include -cxx-isystem /nix/store/c5s0z39n4524fkxlz860za6h5pzbhcz4-pcre2-10.42-dev/include -cxx-isystem /nix/store/498485p17m8l0g41ykvq0qphcgiy81cm-dbus-1.14.10-dev/include -cxx-isystem /nix/store/0134xyb4y7kqcbrvsd8jyws032kjflwv-expat-2.5.0-dev/include -cxx-isystem /nix/store/abjw6dr72w702vzirlw2pm8n8cmjd1fv-glib-2.78.4-dev/include -cxx-isystem /nix/store/m7nr727h0fy4r3mwqrj1qpqsxlw6grfq-libffi-3.4.4-dev/include -cxx-isystem /nix/store/9nz96zcj385xlgyzfkw6szhsc4jskwbv-gettext-0.21.1/include -cxx-isystem /nix/store/2jdjiaggd08sxsjaiwcy6w3a5lfl479x-glibc-iconv-2.38/include -cxx-isystem /nix/store/rhbjbp9wfy1zw3k948v45nyldfbv1bnv-systemd-minimal-libs-254.6-dev/include -cxx-isystem /nix/store/cxp5wpzdiw7z59i6h589w1qc2ka4rdn8-fontconfig-2.14.2-dev/include -cxx-isystem /nix/store/l394rx7mfk529f4qzbgryz4zb6hjms3k-freetype-2.13.2-dev/include -cxx-isystem /nix/store/37s7ramg2kfwmdbkliwhfxqm6mljc7ip-bzip2-1.0.8-dev/include -cxx-isystem /nix/store/ky7y62vv4agcm0b3afp8qmilw8x11naf-brotli-1.1.0-dev/include -cxx-isystem /nix/store/shnla8vp4dx7ams238w32pkxpi702r84-libdrm-2.4.118-dev/include -cxx-isystem /nix/store/9n6kwqffiqdrk5npzcmsvzc58krpdsxh-libX11-1.8.7-dev/include -cxx-isystem /nix/store/lz5fc7z4n5cizzawzfgys71zljy8zldd-xorgproto-2023.2/include -cxx-isystem /nix/store/hy2a1vfm5mhmdps61yyj74v39cva4gzd-libxcb-1.16-dev/include -cxx-isystem /nix/store/ib0pzrmi6va4j5dfysd7x00syl6932lr-libXcomposite-0.4.6-dev/include -cxx-isystem /nix/store/bav1cb76wxyb6h0m3hbbs1p2bnj3rikk-libXfixes-6.0.1-dev/include -cxx-isystem /nix/store/wikpa6v3x5kbmb1g347zhsnawadgpl11-libXext-1.3.5-dev/include -cxx-isystem /nix/store/3jfwqw98nwsv0vm30igwldx03hn9l3l7-libXau-1.0.11-dev/include -cxx-isystem /nix/store/2dsq2skb7lbrw75ah7062y4bz2f8dpb9-libXi-1.8.1-dev/include -cxx-isystem /nix/store/wl2rcj2yjhsqpjylrbrgadc5f77g1p5q-libXrender-0.9.11-dev/include -cxx-isystem /nix/store/q5rnxak19qcqxgf69h75rzqfm6qjxxp1-libxkbcommon-1.5.0-dev/include -cxx-isystem /nix/store/f1b3dvip1vyh6fwkk469q04jrsc3qlb4-xcb-util-0.4.1-dev/include -cxx-isystem /nix/store/mvdh9d5m5ihgjjlvijnhr7r0dip7f1l7-xcb-util-image-0.4.1-dev/include -cxx-isystem /nix/store/ign0chpzc291ay0rlw1kwhf22fb68y0h-xcb-util-keysyms-0.4.1-dev/include -cxx-isystem /nix/store/0kna6q6s7pv2w782d96z9gii0shmc8cn-xcb-util-renderutil-0.3.10-dev/include -cxx-isystem /nix/store/h6zkqjqjnq1k2150i8wx5ms38k8djlkk-xcb-util-wm-0.4.2-dev/include -cxx-isystem /nix/store/alg3cjz4x2cl65ywwsvyq2hvwkmsmp19-libGL-1.7.0-dev/include -cxx-isystem /nix/store/0y2msmmcwvn2vazq72fjva1al7j0jr0b-libglvnd-1.7.0-dev/include -cxx-isystem /nix/store/gn1hpyrh9j8snkf5h0as4acdw50bal8s-qtsvg-5.15.12-dev/include -cxx-isystem /nix/store/skkw2fidr9h2ikq8gzgfm6rysj1mal0r-gcc-13.2.0/include/c++/13.2.0 -cxx-isystem /nix/store/skkw2fidr9h2ikq8gzgfm6rysj1mal0r-gcc-13.2.0/include/c++/13.2.0/x86_64-unknown-linux-gnu -cxx-isystem /nix/store/yp441ann6ch705yk708h61ywxn7ayhj3-glibc-2.39-52-dev/include -cxx-isystem /nix/store/qg9s4a1473skkrsrh1nykfvxm6w5p23d-clang-wrapper-18.1.8/resource-root/include -internal-isystem /nix/store/maa8li4ybxv6hb2k23n4akqdk609fh1r-clang-18.1.8/lib/clang/18/include -source-date-epoch 315532800 -Os -Wall -Wextra -Wundef -Wdouble-promotion -std=gnu99 -ferror-limit 19 -fno-signed-char -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -vectorize-loops -vectorize-slp -no-round-trip-args -faddrsig -x c /home/lu/dev/refloat/src/main.c
I[19:13:48.718] Building preamble...
I[19:13:48.756] Built preamble of size 988384 for file /home/lu/dev/refloat/src/main.c version null in 0.04 seconds
I[19:13:48.756] Indexing headers...
E[19:13:48.773] [pp_file_not_found] Line 20: in included file: 'gnu/stubs-32.h' file not found
I[19:13:48.773] Building AST...
I[19:13:48.815] Indexing AST...
I[19:13:48.821] Building inlay hints
I[19:13:48.821] Building semantic highlighting
I[19:13:48.825] Testing features at each token (may be slow in large files)
I[19:13:49.349] Found definition heuristically in index for io_write
I[19:13:49.349] Found definition heuristically in index for io_write
I[19:13:49.349] Found definition heuristically using nearby identifier beeper_pin
I[19:13:49.349] Found definition heuristically using nearby identifier beeper_pin
I[19:13:49.351] Found definition heuristically in index for io_write
I[19:13:49.351] Found definition heuristically in index for io_write
I[19:13:49.351] Found definition heuristically using nearby identifier beeper_pin
I[19:13:49.351] Found definition heuristically using nearby identifier beeper_pin
I[19:14:00.275] All checks completed, 1 errors

This is what the arm-none-eabi-gcc prints:

$ arm-none-eabi-gcc  -x c++ -E -v -
Using built-in specs.
COLLECT_GCC=arm-none-eabi-gcc
Target: arm-none-eabi
Configured with: /data/jenkins/workspace/GNU-toolchain/arm-13/src/gcc/configure --target=arm-none-eabi --prefix=/data/jenkins/workspace/GNU-toolchain/arm-13/build-arm-none-eabi/install --with-gmp=/data/jenkins/workspace/GNU-toolchain/arm-13/build-arm-none-eabi/host-tools --with-mpfr=/data/jenkins/workspace/GNU-toolchain/arm-13/build-arm-none-eabi/host-tools --with-mpc=/data/jenkins/workspace/GNU-toolchain/arm-13/build-arm-none-eabi/host-tools --with-isl=/data/jenkins/workspace/GNU-toolchain/arm-13/build-arm-none-eabi/host-tools --disable-shared --disable-nls --disable-threads --disable-tls --enable-checking=release --enable-languages=c,c++,fortran --with-newlib --with-gnu-as --with-headers=yes --with-gnu-ld --with-native-system-header-dir=/include --with-sysroot=/data/jenkins/workspace/GNU-toolchain/arm-13/build-arm-none-eabi/install/arm-none-eabi --with-multilib-list=aprofile,rmprofile --with-pkgversion='Arm GNU Toolchain 13.2.rel1 (Build arm-13.7)' --with-bugurl=https://bugs.linaro.org/
Thread model: single
Supported LTO compression algorithms: zlib
gcc version 13.2.1 20231009 (Arm GNU Toolchain 13.2.rel1 (Build arm-13.7))
COLLECT_GCC_OPTIONS='-E' '-v' '-mcpu=arm7tdmi' '-mfloat-abi=soft' '-marm' '-mlibarch=armv4t' '-march=armv4t'
 /nix/store/9z0l7wpqx3fqybmyp9gjvihw756dg5fi-gcc-arm-embedded-13.2.rel1/bin/../libexec/gcc/arm-none-eabi/13.2.1/cc1plus -E -quiet -v -iprefix /nix/store/9z0l7wpqx3fqybmyp9gjvihw756dg5fi-gcc-arm-embedded-13.2.rel1/bin/../lib/gcc/arm-none-eabi/13.2.1/ -isysroot /nix/store/9z0l7wpqx3fqybmyp9gjvihw756dg5fi-gcc-arm-embedded-13.2.rel1/bin/../arm-none-eabi -D__USES_INITFINI__ - -mcpu=arm7tdmi -mfloat-abi=soft -marm -mlibarch=armv4t -march=armv4t -dumpbase -
ignoring duplicate directory "/nix/store/9z0l7wpqx3fqybmyp9gjvihw756dg5fi-gcc-arm-embedded-13.2.rel1/bin/../lib/gcc/../../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/include/c++/13.2.1"
ignoring duplicate directory "/nix/store/9z0l7wpqx3fqybmyp9gjvihw756dg5fi-gcc-arm-embedded-13.2.rel1/bin/../lib/gcc/../../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/include/c++/13.2.1/arm-none-eabi"
ignoring duplicate directory "/nix/store/9z0l7wpqx3fqybmyp9gjvihw756dg5fi-gcc-arm-embedded-13.2.rel1/bin/../lib/gcc/../../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/include/c++/13.2.1/backward"
ignoring duplicate directory "/nix/store/9z0l7wpqx3fqybmyp9gjvihw756dg5fi-gcc-arm-embedded-13.2.rel1/bin/../lib/gcc/../../lib/gcc/arm-none-eabi/13.2.1/include"
ignoring nonexistent directory "/nix/store/9z0l7wpqx3fqybmyp9gjvihw756dg5fi-gcc-arm-embedded-13.2.rel1/bin/../arm-none-eabi/usr/local/include"
ignoring duplicate directory "/nix/store/9z0l7wpqx3fqybmyp9gjvihw756dg5fi-gcc-arm-embedded-13.2.rel1/bin/../lib/gcc/../../lib/gcc/arm-none-eabi/13.2.1/include-fixed"
ignoring duplicate directory "/nix/store/9z0l7wpqx3fqybmyp9gjvihw756dg5fi-gcc-arm-embedded-13.2.rel1/bin/../lib/gcc/../../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/include"
ignoring duplicate directory "/nix/store/9z0l7wpqx3fqybmyp9gjvihw756dg5fi-gcc-arm-embedded-13.2.rel1/bin/../arm-none-eabi/include"
#include "..." search starts here:
#include <...> search starts here:
 /nix/store/9z0l7wpqx3fqybmyp9gjvihw756dg5fi-gcc-arm-embedded-13.2.rel1/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/include/c++/13.2.1
 /nix/store/9z0l7wpqx3fqybmyp9gjvihw756dg5fi-gcc-arm-embedded-13.2.rel1/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/include/c++/13.2.1/arm-none-eabi
 /nix/store/9z0l7wpqx3fqybmyp9gjvihw756dg5fi-gcc-arm-embedded-13.2.rel1/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/include/c++/13.2.1/backward
 /nix/store/9z0l7wpqx3fqybmyp9gjvihw756dg5fi-gcc-arm-embedded-13.2.rel1/bin/../lib/gcc/arm-none-eabi/13.2.1/include
 /nix/store/9z0l7wpqx3fqybmyp9gjvihw756dg5fi-gcc-arm-embedded-13.2.rel1/bin/../lib/gcc/arm-none-eabi/13.2.1/include-fixed
 /nix/store/9z0l7wpqx3fqybmyp9gjvihw756dg5fi-gcc-arm-embedded-13.2.rel1/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/include
End of search list.

Expected behavior

On ARM embedded include flags are extracted by clangd.

Notify maintainers

@Patryk27

Metadata

$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.6.51, NixOS, 24.05 (Uakari), 24.05.20241009.d51c286`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.8`
 - nixpkgs: `/nix/store/m1szqwijms610n6325mwjswslha4nd92-source`

Add a :+1: reaction to issues you find important.

lukash commented 1 week ago

Turns out the clangd wrapper script:

$ cat /nix/store/0vwmhvjdkli5jz8aygdb6psn9nar660h-clang-tools-18.1.8/bin/clangd
#!/nix/store/1xhds5s320nfp2022yjah1h7dpv8qqns-bash-5.2p32/bin/sh

buildcpath() {
  local path after
  while (( $# )); do
    case $1 in
        -isystem)
            shift
            path=$path${path:+':'}$1
            ;;
        -idirafter)
            shift
            after=$after${after:+':'}$1
            ;;
    esac
    shift
  done
  echo $path${after:+':'}$after
}

export CPATH=${CPATH}${CPATH:+':'}$(buildcpath ${NIX_CFLAGS_COMPILE} \
                                               $(</nix/store/qg9s4a1473skkrsrh1nykfvxm6w5p23d-clang-wrapper-18.1.8/nix-support/libc-cflags)):/nix/store/qg9s4a1473skkrsrh1nykfvxm6w5p23d-clang-wrapper-18.1.8/resource-root/include
export CPLUS_INCLUDE_PATH=${CPLUS_INCLUDE_PATH}${CPLUS_INCLUDE_PATH:+':'}$(buildcpath ${NIX_CFLAGS_COMPILE} \
                                                                                      $(</nix/store/qg9s4a1473skkrsrh1nykfvxm6w5p23d-clang-wrapper-18.1.8/nix-support/libcxx-cxxflags) \
                                                                                      $(</nix/store/qg9s4a1473skkrsrh1nykfvxm6w5p23d-clang-wrapper-18.1.8/nix-support/libc-cflags)):/nix/store/qg9s4a1473skkrsrh1nykfvxm6w5p23d-clang-wrapper-18.1.8/resource-root/include

exec -a "$0" /nix/store/maa8li4ybxv6hb2k23n4akqdk609fh1r-clang-18.1.8/bin/$(basename $0) "$@"

Adds include paths to clangd via environmental variables (CPATH and CPLUS_INCLUDE_PATH). These include paths are unwanted for ARM compilation and break clangd, with wrong include paths the language server doesn't work properly.

NickCao commented 1 week ago

Have you tried pkgsCross.arm-embedded.buildPackages.clang-tools

lukash commented 6 days ago

Fails to compile:

error: builder for '/nix/store/b90h9vb6hlhfx1sgpwzshq1l8sb4dxvj-compiler-rt-libc-arm-none-eabi-17.0.6.drv' failed with exit code 1;
       last 10 log lines:
       > In file included from /build/compiler-rt-src-17.0.6/compiler-rt/lib/builtins/arm/sync_fetch_and_max_4.S:14:
       > /build/compiler-rt-src-17.0.6/compiler-rt/lib/builtins/arm/sync-ops.h:22:2: error: #error DMB is only supported on ARMv6+
       >    22 | #error DMB is only supported on ARMv6+
       >       |  ^~~~~
       > [121/163] Building C object lib/builtins/CMakeFiles/clang_rt.builtins-arm.dir/truncdfhf2.c.obj
       > [122/163] Building C object lib/builtins/CMakeFiles/clang_rt.builtins-arm.dir/clear_cache.c.obj
       > [123/163] Building C object lib/builtins/CMakeFiles/clang_rt.builtins-arm.dir/udivdi3.c.obj
       > [124/163] Building C object lib/builtins/CMakeFiles/clang_rt.builtins-arm.dir/umoddi3.c.obj
       > [125/163] Building C object lib/builtins/CMakeFiles/clang_rt.builtins-arm.dir/udivmoddi4.c.obj
       > ninja: build stopped: subcommand failed.
       For full logs, run 'nix log /nix/store/b90h9vb6hlhfx1sgpwzshq1l8sb4dxvj-compiler-rt-libc-arm-none-eabi-17.0.6.drv'.
error: 1 dependencies of derivation '/nix/store/84m5zmi8mbky1w820br75qiar08ni6b1-arm-none-eabi-clang-wrapper-17.0.6.drv' failed to build
error: 1 dependencies of derivation '/nix/store/mnpp04ng9sh54hlkgyzabyv4hfd78i9b-clang-tools-17.0.6.drv' failed to build
error: 1 dependencies of derivation '/nix/store/3614i6ylbwdp6pzcrpj23wppxbrj9ak2-nix-shell-env.drv' failed to build
direnv: nix-direnv: Evaluating current devShell failed. Falling back to previous environment!
direnv: using flake /home/lu/dev/nixcfg/dev/
warning: Git tree '/home/lu/dev/nixcfg' is dirty
warning: Git tree '/home/lu/dev/nixcfg' is dirty
direnv: nix-direnv: Renewed cache
direnv: export +AR +AS +CC +CONFIG_SHELL +CXX +GETTEXTDATADIRS_FOR_BUILD +HOST_PATH +IN_NIX_SHELL +LD +NIX_BINTOOLS +NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu +NIX_BUILD_CORES +NIX_CC +NIX_CC_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu +NIX_CFLAGS_COMPILE +NIX_DIRENV_DID_FALLBACK +NIX_ENFORCE_NO_NATIVE +NIX_HARDENING_ENABLE +NIX_LDFLAGS +NIX_SHELL_ID +NIX_STORE +NM +OBJCOPY +OBJDUMP +QMAKE +QMAKEMODULES +QMAKEPATH +RANLIB +READELF +SIZE +SOURCE_DATE_EPOCH +STRINGS +STRIP +XML_CATALOG_FILES +__structuredAttrs +buildInputs +buildPhase +builder +cmakeFlags +configureFlags +depsBuildBuild +depsBuildBuildPropagated +depsBuildTarget +depsBuildTargetPropagated +depsHostHost +depsHostHostPropagated +depsTargetTarget +depsTargetTargetPropagated +doCheck +doInstallCheck +dontAddDisableDepTrack +mesonFlags +name +nativeBuildInputs +out +outputs +patches +phases +preferLocalBuild +propagatedBuildInputs +propagatedNativeBuildInputs +shell +shellHook +stdenv +strictDeps +system ~PATH ~XDG_DATA_DIRS

I also tried version 18 and that one took several hours to compile llvm to then fail on the same error (the above failed immediately).

I don't think it even makes sense to use cross-compiled clang-tools.