Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake Tools doesn't send --target to C/C++ tools #1896

Closed
thunderstorm010 opened this issue May 21, 2021 · 13 comments · Fixed by #2805
Closed

CMake Tools doesn't send --target to C/C++ tools #1896

thunderstorm010 opened this issue May 21, 2021 · 13 comments · Fixed by #2805

Comments

@thunderstorm010
Copy link

thunderstorm010 commented May 21, 2021

See microsoft/vscode-cpptools#7519 for more info.

TL;DR

@andreeis
Copy link
Contributor

andreeis commented May 21, 2021

@thunderstorm010, this could be the same as #1879. We are almost done with a fix for that and once it's merged in, we will send you a vsix to install and try. If that will not solve your scenario then we will investigate further. I am not closing this report now, nor marking it as a duplicate yet, until we verify this hypothesis with the upcoming vsix.

@Colengms
Copy link
Contributor

Colengms commented Jun 9, 2021

Hi @thunderstorm010 . Would you be able to provide a simplified repro that we might use to validate a potential fix? Perhaps a minimal project configured with the same target, using the same toolset, as a github repo, with setup instructions?

@andreeis
Copy link
Contributor

andreeis commented Jun 9, 2021

@thunderstorm010, can you try the CMake Tools vsix from here and confirm if it solves anything for you?

@Colengms
Copy link
Contributor

@thunderstorm010 When you build with CMake, it should generate 'target' files under a .cmake\api\v1\reply path, under the build directory. CMake Tools collects compiler arguments from these files. If you could provide one of these files from your repro, we may be able to determine why the --target arg was not picked up. Otherwise, we seem to be in need of a repro we can use to investigate further.

@andreeis andreeis added the more info needed More info is needed from the community for us to properly triage and investigate. label Jun 22, 2021
@yuxinyuan
Copy link

@andreeis I'm having pretty much the same issue. I'm not sure if I completely followed all the discussions, but the vsix you mentioned didn't solve the issue.

@Colengms I didn't see a .cmake/api/v1 path under the build directory

@andreeis
Copy link
Contributor

andreeis commented Jul 7, 2021

@yuxinyuan, there is no .cmake/api/v1 path under the build directory not even after you have a successful configure?
Also, maybe you can share with us a standalone project where we can reproduce this problem on our side, for easier debugging and investigating?

@bobbrow
Copy link
Member

bobbrow commented Jul 7, 2021

@andreeis @yuxinyuan that path is created when you have cmake version 3.15 and newer as well as the cmake.cmakeCommunicationMode set to automatic or fileApi

@yuxinyuan
Copy link

yuxinyuan commented Jul 8, 2021

@andreeis @bobbrow I was using cmake version 3.10. After upgrading to version 3.18, I can now see the .cmake/api/v1 path. However, there is still no "target" field in the generated files. It seems to me that the extension has parsed --sysroot option from the compile commands, but fail to parse --target option.

https://github.com/yuxinyuan/test-cmake-target
I created a minimum project with vscode and cmake-tools. But I think you will need to install android ndk by yourself, since I'm using android toolchain files to do cross compiling. Also, you need to change the paths in all the .json files under .vscode.

@andreeis andreeis removed the more info needed More info is needed from the community for us to properly triage and investigate. label Aug 11, 2021
@yuxinyuan
Copy link

@andreeis I've spent some time on this and I'm able to find a work around for this issue.

First, I think the issue happened because of the following. If I inspect my compile_commands.json generated by cmake, I see something like:

clang++.exe --target=... --gcc-toolchain=... --sysroot=... ...rest of the command...

Somehow, c/c++ tools needs the --target option to correctly configure intellisense. However, the cache (or whatever) generated by cmake will not contain the --target option (I guess this has little to do with the cmake tools extension). Hence, the issue happened

What I do as a work around now is to add the following in my CMakeLists.txt:

if(ANDROID)
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --target=${ANDROID_LLVM_TRIPLE}")
endif(ANDROID)

This will not hurt the actual compilation and it can also let the --target option be passed to c/c+ tools. The ${ANDROID_LLVM_TRIPLE}" variable is defined by the toolchain file shipped with android ndk, so it should be safe to use that.

Hope this would help.

@andreeis andreeis added this to the On Deck milestone Oct 25, 2021
@andreasWallner
Copy link

andreasWallner commented Oct 29, 2021

I typed up a new issue for the same problem before I came upon this bug. I thought the details might help, so here the info that I typed up:

Brief Issue Summary

If have issues getting intellisense working when building for an RiscV embedded system.
The issue seems to be that the CMAKE_C(XX)_COMPILER_TARGET variables are not passed
along to the compiler, rendering cpptools unable to retrieve the correct list of include directories,
defines etc. (as recommended here for Visual Studio: https://devblogs.microsoft.com/cppblog/configure-intellisense-with-cmake-toolchain-files-in-visual-studio-2019-16-9-preview-2/)

This happens as soon as CMAKE_C_COMPILER_TARGET is used in a toolchain file, snippet from mine:

set(CMAKE_SYSTEM_NAME Generic)
set(CMAKE_SYSTEM_PROCESSOR rv32imc)

set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)

set(CMAKE_C_COMPILER "/usr/bin/clang-12" CACHE INTERNAL "C Compiler")
set(CMAKE_CXX_COMPILER "/usr/bin/clang++-12" CACHE INTERNAL "C++ Compiler")
...
set(CMAKE_SYSROOT "/opt/riscv32/riscv32-unknown-elf" CACHE INTERNAL "root of our toolchain")
set(CMAKE_C_COMPILER_TARGET "riscv32" CACHE INTERNAL "C cross-compile target")
set(CMAKE_CXX_COMPILER_TARGET "riscv32" CACHE INTERNAL "C++ cross-compile target")

add_compile_options(
  -O3
  # CPU flags
  -march=rv32imc
  # Compiler flags
  -fno-builtin # prevent optimizer from lifting function calls like abs() to builtins: https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html#Other-Builtins
  -ffreestanding # assert that we are building for embedded and there may not be a standard library
  -static
  -mno-relax
  -fomit-frame-pointer
  -fno-exceptions
  -fno-asynchronous-unwind-tables
  -fno-unwind-tables
  -mcmodel=medlow # use small memory model since we only have a 32bit address space
)

cmake will correctly use --target during compilation as can be seen in the debug log below, but the target does not show up in the information passed along to cpptools. This leads to cpptools trying to get include directories and defines via a call like

Compiler query command line: "/usr/bin/clang++-12" -g -O3 -march=rv32imc -fno-builtin -ffreestanding -static -mno-relax -fomit-frame-pointer -fno-exceptions -fno-asynchronous-unwind-tables -fno-unwind-tables -mcmodel=medlow --sysroot=/opt/riscv32/riscv32-unknown-elf -std=c++14 -Wp,-v -E -dD -x c++  -fno-blocks /dev/null

Which fail because --target=riscv32 is missing in that command line. CMAKE_SYSROOT seems to be actually passed along correctly as can be seen in the diagnostics below, which seems to be done by cmake-tools as the --sysroot parameter does not show up in the originally listed switches in the cmake toolchain reply. I would have expected the CMAKE_C(XX)_COMPILER_TARGET to be passed along as well.

I found the kind of similar issue #637, but that looks like cpptools/cmake-tools were using a different model of interaction back then.

CMake Tools Diagnostics

{
  "os": "linux",
  "vscodeVersion": "1.62.0-insider",
  "cmtVersion": "1.9.1",
  "configurations": [
    {
      "folder": "/workspaces/riscv-tries",
      "cmakeVersion": "3.21.4",
      "configured": true,
      "generator": "Ninja",
      "usesPresets": false,
      "compilers": {
        "C": "/usr/bin/clang-12",
        "CXX": "/usr/bin/clang++-12"
      }
    }
  ],
  "cpptoolsIntegration": {
    "isReady": true,
    "hasCodeModel": true,
    "activeBuildType": "Debug",
    "buildTypesSeen": [
      "Debug"
    ],
    "requests": [
      "file:///workspaces/riscv-tries/external/startup/src/startup.cpp"
    ],
    "responses": [
      {
        "uri": "file:///workspaces/riscv-tries/external/startup/src/startup.cpp",
        "configuration": {
          "defines": [],
          "includePath": [
            "/opt/riscv32/riscv32-unknown-elf/include/c++/11.1.0",
            "/opt/riscv32/riscv32-unknown-elf/include/c++/11.1.0/riscv32-unknown-elf",
            "/opt/riscv32/riscv32-unknown-elf/include/c++/11.1.0/backward",
            "/opt/riscv32/lib/gcc/riscv32-unknown-elf/11.1.0/include",
            "/opt/riscv32/lib/gcc/riscv32-unknown-elf/11.1.0/include-fixed",
            "/opt/riscv32/lib/gcc/riscv32-unknown-elf/include"
          ],
          "intelliSenseMode": "clang-arm",
          "compilerPath": "/usr/bin/clang++-12",
          "compilerArgs": [
            "-g",
            "-O3",
            "-march=rv32imc",
            "-fno-builtin",
            "-ffreestanding",
            "-static",
            "-mno-relax",
            "-fomit-frame-pointer",
            "-fno-exceptions",
            "-fno-asynchronous-unwind-tables",
            "-fno-unwind-tables",
            "-mcmodel=medlow",
            "--sysroot=/opt/riscv32/riscv32-unknown-elf"
          ]
        }
      }
    ],
    "partialMatches": [],
    "targetCount": 5,
    "executablesCount": 2,
    "librariesCount": 3,
    "targets": [
      {
        "name": "example",
        "type": "EXECUTABLE"
      },
      {
        "name": "htif",
        "type": "STATIC_LIBRARY"
      },
      {
        "name": "kvasir_example",
        "type": "STATIC_LIBRARY"
      },
      {
        "name": "rom",
        "type": "EXECUTABLE"
      },
      {
        "name": "startup",
        "type": "OBJECT_LIBRARY"
      }
    ]
  },
  "settings": [
    {
      "communicationMode": "automatic",
      "useCMakePresets": "auto",
      "configureOnOpen": true
    }
  ]
}

Debug Log

[main] Building folder: riscv-tries 
[main] Saving open files before configure/build
[build] Starting build
[driver] Start build all
[proc] Executing command: /usr/local/bin/cmake --build /workspaces/riscv-tries/build --config Debug --target all -j 6 -- -v
[build] [1/1   0% :: 0.000] /usr/local/bin/cmake --regenerate-during-build -S/workspaces/riscv-tries -B/workspaces/riscv-tries/build
[build] -- Configuring done
[build] -- Generating done
[build] -- Build files have been written to: /workspaces/riscv-tries/build
[build] [6/10  10% :: 0.124] /usr/bin/clang-12 --target=riscv32 --sysroot=/opt/riscv32/riscv32-unknown-elf  -I/opt/riscv32/lib/gcc/riscv32-unknown-elf/11.1.0/include -I/opt/riscv32/lib/gcc/riscv32-unknown-elf/11.1.0/include-fixed -I/opt/riscv32/lib/gcc/riscv32-unknown-elf/include -I/workspaces/riscv-tries/external/htif/include/htif -g -O3 -march=rv32imc -fno-builtin -ffreestanding -static -mno-relax -fomit-frame-pointer -fno-exceptions -fno-asynchronous-unwind-tables -fno-unwind-tables -mcmodel=medlow -MD -MT external/htif/CMakeFiles/htif.dir/src/htif.c.obj -MF external/htif/CMakeFiles/htif.dir/src/htif.c.obj.d -o external/htif/CMakeFiles/htif.dir/src/htif.c.obj -c /workspaces/riscv-tries/external/htif/src/htif.c
[build] [7/10  20% :: 0.199] /usr/bin/clang++-12 --target=riscv32 --sysroot=/opt/riscv32/riscv32-unknown-elf  -I/opt/riscv32/lib/gcc/riscv32-unknown-elf/11.1.0/../../../../riscv32-unknown-elf/include/c++/11.1.0 -I/opt/riscv32/lib/gcc/riscv32-unknown-elf/11.1.0/../../../../riscv32-unknown-elf/include/c++/11.1.0/riscv32-unknown-elf -I/opt/riscv32/lib/gcc/riscv32-unknown-elf/11.1.0/../../../../riscv32-unknown-elf/include/c++/11.1.0/backward -I/opt/riscv32/lib/gcc/riscv32-unknown-elf/11.1.0/include -I/opt/riscv32/lib/gcc/riscv32-unknown-elf/11.1.0/include-fixed -I/opt/riscv32/lib/gcc/riscv32-unknown-elf/include -I/workspaces/riscv-tries/external/htif/include/htif -I/workspaces/riscv-tries/external/ric-register/include -I/workspaces/riscv-tries/external/kvasir-register/include -I/workspaces/riscv-tries/build/_deps/kvasir_mpl-src/src -g -O3 -march=rv32imc -fno-builtin -ffreestanding -static -mno-relax -fomit-frame-pointer -fno-exceptions -fno-asynchronous-unwind-tables -fno-unwind-tables -mcmodel=medlow -std=gnu++17 -MD -MT CMakeFiles/example.dir/src/output.cpp.obj -MF CMakeFiles/example.dir/src/output.cpp.obj.d -o CMakeFiles/example.dir/src/output.cpp.obj -c /workspaces/riscv-tries/src/output.cpp
[build] [7/10  30% :: 0.240] /usr/bin/clang++-12 --target=riscv32 --sysroot=/opt/riscv32/riscv32-unknown-elf  -I/opt/riscv32/lib/gcc/riscv32-unknown-elf/11.1.0/../../../../riscv32-unknown-elf/include/c++/11.1.0 -I/opt/riscv32/lib/gcc/riscv32-unknown-elf/11.1.0/../../../../riscv32-unknown-elf/include/c++/11.1.0/riscv32-unknown-elf -I/opt/riscv32/lib/gcc/riscv32-unknown-elf/11.1.0/../../../../riscv32-unknown-elf/include/c++/11.1.0/backward -I/opt/riscv32/lib/gcc/riscv32-unknown-elf/11.1.0/include -I/opt/riscv32/lib/gcc/riscv32-unknown-elf/11.1.0/include-fixed -I/opt/riscv32/lib/gcc/riscv32-unknown-elf/include -g -O3 -march=rv32imc -fno-builtin -ffreestanding -static -mno-relax -fomit-frame-pointer -fno-exceptions -fno-asynchronous-unwind-tables -fno-unwind-tables -mcmodel=medlow -MD -MT CMakeFiles/rom.dir/src/rom.notmain.cpp.obj -MF CMakeFiles/rom.dir/src/rom.notmain.cpp.obj.d -o CMakeFiles/rom.dir/src/rom.notmain.cpp.obj -c /workspaces/riscv-tries/src/rom.notmain.cpp
[build] [7/10  40% :: 0.265] : && /usr/local/bin/cmake -E rm -f external/htif/libhtif.a && /opt/riscv32/riscv32-unknown-elf/bin/ar qc external/htif/libhtif.a  external/htif/CMakeFiles/htif.dir/src/htif.c.obj && /opt/riscv32/riscv32-unknown-elf/bin/ranlib external/htif/libhtif.a && :
[build] [7/10  50% :: 0.616] /usr/bin/clang++-12 --target=riscv32 --sysroot=/opt/riscv32/riscv32-unknown-elf  -I/opt/riscv32/lib/gcc/riscv32-unknown-elf/11.1.0/../../../../riscv32-unknown-elf/include/c++/11.1.0 -I/opt/riscv32/lib/gcc/riscv32-unknown-elf/11.1.0/../../../../riscv32-unknown-elf/include/c++/11.1.0/riscv32-unknown-elf -I/opt/riscv32/lib/gcc/riscv32-unknown-elf/11.1.0/../../../../riscv32-unknown-elf/include/c++/11.1.0/backward -I/opt/riscv32/lib/gcc/riscv32-unknown-elf/11.1.0/include -I/opt/riscv32/lib/gcc/riscv32-unknown-elf/11.1.0/include-fixed -I/opt/riscv32/lib/gcc/riscv32-unknown-elf/include -g -O3 -march=rv32imc -fno-builtin -ffreestanding -static -mno-relax -fomit-frame-pointer -fno-exceptions -fno-asynchronous-unwind-tables -fno-unwind-tables -mcmodel=medlow -MD -MT external/startup/CMakeFiles/startup.dir/src/startup.cpp.obj -MF external/startup/CMakeFiles/startup.dir/src/startup.cpp.obj.d -o external/startup/CMakeFiles/startup.dir/src/startup.cpp.obj -c /workspaces/riscv-tries/external/startup/src/startup.cpp
[build] [8/10  60% :: 0.791] : && /usr/bin/clang++-12 --target=riscv32 --sysroot=/opt/riscv32/riscv32-unknown-elf -g -march=rv32imc -fno-builtin -nodefaultlibs -nostdlib -static -mno-relax -fuse-ld=lld -Wl,-Map=rom.map -T/workspaces/riscv-tries/src/rom.ld -lc external/startup/CMakeFiles/startup.dir/src/startup.cpp.obj CMakeFiles/rom.dir/src/rom.notmain.cpp.obj -o rom   && cd /workspaces/riscv-tries/build && /opt/riscv32/bin/riscv32-unknown-elf-objdump --disassemble /workspaces/riscv-tries/build/rom > /workspaces/riscv-tries/build/rom.dis.S && cd /workspaces/riscv-tries/build && /opt/riscv32/bin/riscv32-unknown-elf-objcopy -O ihex /workspaces/riscv-tries/build/rom /workspaces/riscv-tries/build/rom.hex
[build] [8/10  70% :: 0.878] /usr/bin/clang++-12 --target=riscv32 --sysroot=/opt/riscv32/riscv32-unknown-elf  -I/opt/riscv32/lib/gcc/riscv32-unknown-elf/11.1.0/../../../../riscv32-unknown-elf/include/c++/11.1.0 -I/opt/riscv32/lib/gcc/riscv32-unknown-elf/11.1.0/../../../../riscv32-unknown-elf/include/c++/11.1.0/riscv32-unknown-elf -I/opt/riscv32/lib/gcc/riscv32-unknown-elf/11.1.0/../../../../riscv32-unknown-elf/include/c++/11.1.0/backward -I/opt/riscv32/lib/gcc/riscv32-unknown-elf/11.1.0/include -I/opt/riscv32/lib/gcc/riscv32-unknown-elf/11.1.0/include-fixed -I/opt/riscv32/lib/gcc/riscv32-unknown-elf/include -I/workspaces/riscv-tries/external/kvasir-register/include -I/workspaces/riscv-tries/build/_deps/kvasir_mpl-src/src -g -O3 -march=rv32imc -fno-builtin -ffreestanding -static -mno-relax -fomit-frame-pointer -fno-exceptions -fno-asynchronous-unwind-tables -fno-unwind-tables -mcmodel=medlow -MD -MT external/kvasir-register/CMakeFiles/kvasir_example.dir/example/example.cpp.obj -MF external/kvasir-register/CMakeFiles/kvasir_example.dir/example/example.cpp.obj.d -o external/kvasir-register/CMakeFiles/kvasir_example.dir/example/example.cpp.obj -c /workspaces/riscv-tries/external/kvasir-register/example/example.cpp
[build] [9/10  80% :: 0.915] : && /usr/local/bin/cmake -E rm -f external/kvasir-register/libkvasir_example.a && /opt/riscv32/riscv32-unknown-elf/bin/ar qc external/kvasir-register/libkvasir_example.a  external/kvasir-register/CMakeFiles/kvasir_example.dir/example/example.cpp.obj && /opt/riscv32/riscv32-unknown-elf/bin/ranlib external/kvasir-register/libkvasir_example.a && :
[build] [9/10  90% :: 1.171] /usr/bin/clang++-12 --target=riscv32 --sysroot=/opt/riscv32/riscv32-unknown-elf  -I/opt/riscv32/lib/gcc/riscv32-unknown-elf/11.1.0/../../../../riscv32-unknown-elf/include/c++/11.1.0 -I/opt/riscv32/lib/gcc/riscv32-unknown-elf/11.1.0/../../../../riscv32-unknown-elf/include/c++/11.1.0/riscv32-unknown-elf -I/opt/riscv32/lib/gcc/riscv32-unknown-elf/11.1.0/../../../../riscv32-unknown-elf/include/c++/11.1.0/backward -I/opt/riscv32/lib/gcc/riscv32-unknown-elf/11.1.0/include -I/opt/riscv32/lib/gcc/riscv32-unknown-elf/11.1.0/include-fixed -I/opt/riscv32/lib/gcc/riscv32-unknown-elf/include -I/workspaces/riscv-tries/external/htif/include/htif -I/workspaces/riscv-tries/external/ric-register/include -I/workspaces/riscv-tries/external/kvasir-register/include -I/workspaces/riscv-tries/build/_deps/kvasir_mpl-src/src -g -O3 -march=rv32imc -fno-builtin -ffreestanding -static -mno-relax -fomit-frame-pointer -fno-exceptions -fno-asynchronous-unwind-tables -fno-unwind-tables -mcmodel=medlow -std=gnu++17 -MD -MT CMakeFiles/example.dir/src/example.notmain.cpp.obj -MF CMakeFiles/example.dir/src/example.notmain.cpp.obj.d -o CMakeFiles/example.dir/src/example.notmain.cpp.obj -c /workspaces/riscv-tries/src/example.notmain.cpp
[build] [10/10 100% :: 1.262] : && /usr/bin/clang++-12 --target=riscv32 --sysroot=/opt/riscv32/riscv32-unknown-elf -g -march=rv32imc -fno-builtin -nodefaultlibs -nostdlib -static -mno-relax -fuse-ld=lld -Wl,-Map=example.map -lc -T/workspaces/riscv-tries/external/startup/src/default.ld external/startup/CMakeFiles/startup.dir/src/startup.cpp.obj CMakeFiles/example.dir/src/example.notmain.cpp.obj CMakeFiles/example.dir/src/output.cpp.obj -o example  external/htif/libhtif.a && cd /workspaces/riscv-tries/build && /opt/riscv32/bin/riscv32-unknown-elf-objdump --disassemble /workspaces/riscv-tries/build/example > /workspaces/riscv-tries/build/example.dis.S && cd /workspaces/riscv-tries/build && /opt/riscv32/bin/riscv32-unknown-elf-objcopy -O ihex /workspaces/riscv-tries/build/example /workspaces/riscv-tries/build/example.hex
[cmakefileapi-parser] Read reply folder: /workspaces/riscv-tries/build/.cmake/api/v1/reply
[cmakefileapi-parser] Found index files: ["cache-v2-91fad458372079ebab28.json","codemodel-v2-34da30b53d8fe440acfe.json","directory-.-Debug-f5ebdc15457944623624.json","directory-_deps.kvasir_mpl-build-Debug-3f670290656a2fb430c6.json","directory-external-Debug-8482bb5b6989bf536f1d.json","directory-external.htif-Debug-112b1381f3a9a4f5d4c6.json","directory-external.kvasir-register-Debug-b5a06fad53f4c54a23ad.json","directory-external.ric-register-Debug-e41ea43c177129c10245.json","directory-external.startup-Debug-e72d9d8ebd9e52d3253e.json","index-2021-10-29T15-14-39-0704.json","target-example-Debug-b9d0ddd89970b4bb8d42.json","target-htif-Debug-e113df8dbe4993e41599.json","target-kvasir_example-Debug-9ce6fed556e71fe3aec9.json","target-rom-Debug-51e5b1f6ba94da76ef63.json","target-startup-Debug-6fead220e1a587e3153f.json","toolchains-v1-a143876c851f72d774b4.json"]
[driver] Run _refreshExpansions
[driver] Run _refreshExpansions cb
[cache] Reading CMake cache file /workspaces/riscv-tries/build/CMakeCache.txt
[cache] Parsing CMake cache string
[build] Build finished with exit code 0
[extension] [8405] cmake.build finished (returned 0)

CMake toolchain reply

Content of `.build/.cmake/reply/toolchains-v1....json`
{
	"kind" : "toolchains",
	"toolchains" : 
	[
		{
			"compiler" : 
			{
				"id" : "Clang",
				"implicit" : {},
				"path" : "/usr/bin/clang-12",
				"version" : ""
			},
			"language" : "ASM",
			"sourceFileExtensions" : 
			[
				"s",
				"S",
				"asm"
			]
		},
		{
			"compiler" : 
			{
				"id" : "Clang",
				"implicit" : 
				{
					"includeDirectories" : 
					[
						"/usr/lib/llvm-12/lib/clang/12.0.0/include",
						"/opt/riscv32/riscv32-unknown-elf/include"
					],
					"linkDirectories" : [],
					"linkFrameworkDirectories" : [],
					"linkLibraries" : []
				},
				"path" : "/usr/bin/clang-12",
				"target" : "riscv32",
				"version" : "12.0.0"
			},
			"language" : "C",
			"sourceFileExtensions" : 
			[
				"c",
				"m"
			]
		},
		{
			"compiler" : 
			{
				"id" : "Clang",
				"implicit" : 
				{
					"includeDirectories" : 
					[
						"/usr/lib/llvm-12/lib/clang/12.0.0/include",
						"/opt/riscv32/riscv32-unknown-elf/include"
					],
					"linkDirectories" : [],
					"linkFrameworkDirectories" : [],
					"linkLibraries" : []
				},
				"path" : "/usr/bin/clang++-12",
				"target" : "riscv32",
				"version" : "12.0.0"
			},
			"language" : "CXX",
			"sourceFileExtensions" : 
			[
				"C",
				"M",
				"c++",
				"cc",
				"cpp",
				"cxx",
				"mm",
				"mpp",
				"CPP",
				"ixx",
				"cppm"
			]
		}
	],
	"version" : 
	{
		"major" : 1,
		"minor" : 0
	}
}
Reply for ROM target
{
	"artifacts" : 
	[
		{
			"path" : "rom"
		}
	],
	"backtrace" : 2,
	"backtraceGraph" : 
	{
		"commands" : 
		[
			"_add_executable",
			"add_executable",
			"add_link_options",
			"include",
			"project",
			"target_link_libraries",
			"add_compile_options",
			"include_directories"
		],
		"files" : 
		[
			"external/clang12-riscv/add_executable_override.cmake",
			"CMakeLists.txt",
			"external/clang12-riscv/toolchain.cmake",
			"build/CMakeFiles/3.21.4/CMakeSystem.cmake"
		],
		"nodes" : 
		[
			{
				"file" : 1
			},
			{
				"command" : 1,
				"file" : 1,
				"line" : 6,
				"parent" : 0
			},
			{
				"command" : 0,
				"file" : 0,
				"line" : 4,
				"parent" : 1
			},
			{
				"command" : 4,
				"file" : 1,
				"line" : 3,
				"parent" : 0
			},
			{
				"file" : 3,
				"parent" : 3
			},
			{
				"command" : 3,
				"file" : 3,
				"line" : 6,
				"parent" : 4
			},
			{
				"file" : 2,
				"parent" : 5
			},
			{
				"command" : 2,
				"file" : 2,
				"line" : 37,
				"parent" : 6
			},
			{
				"command" : 5,
				"file" : 1,
				"line" : 7,
				"parent" : 0
			},
			{
				"command" : 6,
				"file" : 2,
				"line" : 19,
				"parent" : 6
			},
			{
				"command" : 7,
				"file" : 2,
				"line" : 54,
				"parent" : 6
			}
		]
	},
	"compileGroups" : 
	[
		{
			"compileCommandFragments" : 
			[
				{
					"fragment" : "-g"
				},
				{
					"backtrace" : 9,
					"fragment" : "-O3"
				},
				{
					"backtrace" : 9,
					"fragment" : "-march=rv32imc"
				},
				{
					"backtrace" : 9,
					"fragment" : "-fno-builtin"
				},
				{
					"backtrace" : 9,
					"fragment" : "-ffreestanding"
				},
				{
					"backtrace" : 9,
					"fragment" : "-static"
				},
				{
					"backtrace" : 9,
					"fragment" : "-mno-relax"
				},
				{
					"backtrace" : 9,
					"fragment" : "-fomit-frame-pointer"
				},
				{
					"backtrace" : 9,
					"fragment" : "-fno-exceptions"
				},
				{
					"backtrace" : 9,
					"fragment" : "-fno-asynchronous-unwind-tables"
				},
				{
					"backtrace" : 9,
					"fragment" : "-fno-unwind-tables"
				},
				{
					"backtrace" : 9,
					"fragment" : "-mcmodel=medlow"
				}
			],
			"includes" : 
			[
				{
					"backtrace" : 10,
					"path" : "/opt/riscv32/lib/gcc/riscv32-unknown-elf/11.1.0/../../../../riscv32-unknown-elf/include/c++/11.1.0"
				},
				{
					"backtrace" : 10,
					"path" : "/opt/riscv32/lib/gcc/riscv32-unknown-elf/11.1.0/../../../../riscv32-unknown-elf/include/c++/11.1.0/riscv32-unknown-elf"
				},
				{
					"backtrace" : 10,
					"path" : "/opt/riscv32/lib/gcc/riscv32-unknown-elf/11.1.0/../../../../riscv32-unknown-elf/include/c++/11.1.0/backward"
				},
				{
					"backtrace" : 10,
					"path" : "/opt/riscv32/lib/gcc/riscv32-unknown-elf/11.1.0/include"
				},
				{
					"backtrace" : 10,
					"path" : "/opt/riscv32/lib/gcc/riscv32-unknown-elf/11.1.0/include-fixed"
				},
				{
					"backtrace" : 10,
					"path" : "/opt/riscv32/lib/gcc/riscv32-unknown-elf/include"
				}
			],
			"language" : "CXX",
			"sourceIndexes" : 
			[
				0
			],
			"sysroot" : 
			{
				"path" : "/opt/riscv32/riscv32-unknown-elf"
			}
		}
	],
	"dependencies" : 
	[
		{
			"backtrace" : 8,
			"id" : "startup::@f9c1fd4ee40e809a76c5"
		}
	],
	"id" : "rom::@6890427a1f51a3e7e1df",
	"link" : 
	{
		"commandFragments" : 
		[
			{
				"fragment" : "-g",
				"role" : "flags"
			},
			{
				"fragment" : "",
				"role" : "flags"
			},
			{
				"backtrace" : 7,
				"fragment" : "-march=rv32imc",
				"role" : "flags"
			},
			{
				"backtrace" : 7,
				"fragment" : "-fno-builtin",
				"role" : "flags"
			},
			{
				"backtrace" : 7,
				"fragment" : "-nodefaultlibs",
				"role" : "flags"
			},
			{
				"backtrace" : 7,
				"fragment" : "-nostdlib",
				"role" : "flags"
			},
			{
				"backtrace" : 7,
				"fragment" : "-static",
				"role" : "flags"
			},
			{
				"backtrace" : 7,
				"fragment" : "-mno-relax",
				"role" : "flags"
			},
			{
				"backtrace" : 7,
				"fragment" : "-fuse-ld=lld",
				"role" : "flags"
			},
			{
				"backtrace" : 7,
				"fragment" : "-Wl,-Map=rom.map",
				"role" : "flags"
			},
			{
				"backtrace" : 7,
				"fragment" : "-T/workspaces/riscv-tries/src/rom.ld",
				"role" : "flags"
			},
			{
				"backtrace" : 7,
				"fragment" : "-lc",
				"role" : "flags"
			}
		],
		"language" : "CXX",
		"sysroot" : 
		{
			"path" : "/opt/riscv32/riscv32-unknown-elf"
		}
	},
	"name" : "rom",
	"nameOnDisk" : "rom",
	"paths" : 
	{
		"build" : ".",
		"source" : "."
	},
	"sourceGroups" : 
	[
		{
			"name" : "Source Files",
			"sourceIndexes" : 
			[
				0
			]
		},
		{
			"name" : "Object Libraries",
			"sourceIndexes" : 
			[
				1
			]
		}
	],
	"sources" : 
	[
		{
			"backtrace" : 2,
			"compileGroupIndex" : 0,
			"path" : "src/rom.notmain.cpp",
			"sourceGroupIndex" : 0
		},
		{
			"backtrace" : 8,
			"isGenerated" : true,
			"path" : "build/external/startup/CMakeFiles/startup.dir/src/startup.cpp.obj",
			"sourceGroupIndex" : 1
		}
	],
	"type" : "EXECUTABLE"
}
Reply for cache
{
	"entries" : 
	[
		{
			"name" : "CMAKE_ADDR2LINE",
			"properties" : 
			[
				{
					"name" : "ADVANCED",
					"value" : "1"
				},
				{
					"name" : "HELPSTRING",
					"value" : "Path to a program."
				}
			],
			"type" : "FILEPATH",
			"value" : "/usr/bin/addr2line"
		},
		{
			"name" : "CMAKE_AR",
			"properties" : 
			[
				{
					"name" : "ADVANCED",
					"value" : "1"
				},
				{
					"name" : "HELPSTRING",
					"value" : "Path to a program."
				}
			],
			"type" : "FILEPATH",
			"value" : "/opt/riscv32/riscv32-unknown-elf/bin/ar"
		},
		{
			"name" : "CMAKE_ASM_COMPILER",
			"properties" : 
			[
				{
					"name" : "HELPSTRING",
					"value" : "Assembler"
				}
			],
			"type" : "INTERNAL",
			"value" : "/usr/bin/clang-12"
		},
		{
			"name" : "CMAKE_ASM_COMPILER_AR",
			"properties" : 
			[
				{
					"name" : "ADVANCED",
					"value" : "1"
				},
				{
					"name" : "HELPSTRING",
					"value" : "LLVM archiver"
				}
			],
			"type" : "FILEPATH",
			"value" : "/usr/lib/llvm-12/bin/llvm-ar"
		},
		{
			"name" : "CMAKE_ASM_COMPILER_RANLIB",
			"properties" : 
			[
				{
					"name" : "ADVANCED",
					"value" : "1"
				},
				{
					"name" : "HELPSTRING",
					"value" : "Generate index for LLVM archive"
				}
			],
			"type" : "FILEPATH",
			"value" : "/usr/lib/llvm-12/bin/llvm-ranlib"
		},
		{
			"name" : "CMAKE_ASM_COMPILER_WORKS",
			"properties" : 
			[
				{
					"name" : "HELPSTRING",
					"value" : ""
				}
			],
			"type" : "INTERNAL",
			"value" : "1"
		},
		{
			"name" : "CMAKE_ASM_FLAGS",
			"properties" : 
			[
				{
					"name" : "ADVANCED",
					"value" : "1"
				},
				{
					"name" : "HELPSTRING",
					"value" : "Flags used by the ASM compiler during all build types."
				}
			],
			"type" : "STRING",
			"value" : ""
		},
		{
			"name" : "CMAKE_ASM_FLAGS_DEBUG",
			"properties" : 
			[
				{
					"name" : "ADVANCED",
					"value" : "1"
				},
				{
					"name" : "HELPSTRING",
					"value" : "Flags used by the ASM compiler during DEBUG builds."
				}
			],
			"type" : "STRING",
			"value" : "-g"
		},
		{
			"name" : "CMAKE_ASM_FLAGS_MINSIZEREL",
			"properties" : 
			[
				{
					"name" : "ADVANCED",
					"value" : "1"
				},
				{
					"name" : "HELPSTRING",
					"value" : "Flags used by the ASM compiler during MINSIZEREL builds."
				}
			],
			"type" : "STRING",
			"value" : "-Os -DNDEBUG"
		},
		{
			"name" : "CMAKE_ASM_FLAGS_RELEASE",
			"properties" : 
			[
				{
					"name" : "ADVANCED",
					"value" : "1"
				},
				{
					"name" : "HELPSTRING",
					"value" : "Flags used by the ASM compiler during RELEASE builds."
				}
			],
			"type" : "STRING",
			"value" : "-O3 -DNDEBUG"
		},
		{
			"name" : "CMAKE_ASM_FLAGS_RELWITHDEBINFO",
			"properties" : 
			[
				{
					"name" : "ADVANCED",
					"value" : "1"
				},
				{
					"name" : "HELPSTRING",
					"value" : "Flags used by the ASM compiler during RELWITHDEBINFO builds."
				}
			],
			"type" : "STRING",
			"value" : "-O2 -g -DNDEBUG"
		},
		{
			"name" : "CMAKE_BUILD_TYPE",
			"properties" : 
			[
				{
					"name" : "HELPSTRING",
					"value" : "No help, variable specified on the command line."
				}
			],
			"type" : "STRING",
			"value" : "Debug"
		},
		{
			"name" : "CMAKE_CACHEFILE_DIR",
			"properties" : 
			[
				{
					"name" : "HELPSTRING",
					"value" : "This is the directory where this CMakeCache.txt was created"
				}
			],
			"type" : "INTERNAL",
			"value" : "/workspaces/riscv-tries/build"
		},
		{
			"name" : "CMAKE_CACHE_MAJOR_VERSION",
			"properties" : 
			[
				{
					"name" : "HELPSTRING",
					"value" : "Major version of cmake used to create the current loaded cache"
				}
			],
			"type" : "INTERNAL",
			"value" : "3"
		},
		{
			"name" : "CMAKE_CACHE_MINOR_VERSION",
			"properties" : 
			[
				{
					"name" : "HELPSTRING",
					"value" : "Minor version of cmake used to create the current loaded cache"
				}
			],
			"type" : "INTERNAL",
			"value" : "21"
		},
		{
			"name" : "CMAKE_CACHE_PATCH_VERSION",
			"properties" : 
			[
				{
					"name" : "HELPSTRING",
					"value" : "Patch version of cmake used to create the current loaded cache"
				}
			],
			"type" : "INTERNAL",
			"value" : "4"
		},
		{
			"name" : "CMAKE_COMMAND",
			"properties" : 
			[
				{
					"name" : "HELPSTRING",
					"value" : "Path to CMake executable."
				}
			],
			"type" : "INTERNAL",
			"value" : "/usr/local/bin/cmake"
		},
		{
			"name" : "CMAKE_CPACK_COMMAND",
			"properties" : 
			[
				{
					"name" : "HELPSTRING",
					"value" : "Path to cpack program executable."
				}
			],
			"type" : "INTERNAL",
			"value" : "/usr/local/bin/cpack"
		},
		{
			"name" : "CMAKE_CTEST_COMMAND",
			"properties" : 
			[
				{
					"name" : "HELPSTRING",
					"value" : "Path to ctest program executable."
				}
			],
			"type" : "INTERNAL",
			"value" : "/usr/local/bin/ctest"
		},
		{
			"name" : "CMAKE_CXX_COMPILER",
			"properties" : 
			[
				{
					"name" : "HELPSTRING",
					"value" : "C++ Compiler"
				}
			],
			"type" : "INTERNAL",
			"value" : "/usr/bin/clang++-12"
		},
		{
			"name" : "CMAKE_CXX_COMPILER_AR",
			"properties" : 
			[
				{
					"name" : "ADVANCED",
					"value" : "1"
				},
				{
					"name" : "HELPSTRING",
					"value" : "LLVM archiver"
				}
			],
			"type" : "FILEPATH",
			"value" : "/usr/bin/llvm-ar-12"
		},
		{
			"name" : "CMAKE_CXX_COMPILER_RANLIB",
			"properties" : 
			[
				{
					"name" : "ADVANCED",
					"value" : "1"
				},
				{
					"name" : "HELPSTRING",
					"value" : "Generate index for LLVM archive"
				}
			],
			"type" : "FILEPATH",
			"value" : "/usr/bin/llvm-ranlib-12"
		},
		{
			"name" : "CMAKE_CXX_COMPILER_TARGET",
			"properties" : 
			[
				{
					"name" : "HELPSTRING",
					"value" : "C++ cross-compile target"
				}
			],
			"type" : "INTERNAL",
			"value" : "riscv32"
		},
		{
			"name" : "CMAKE_CXX_FLAGS",
			"properties" : 
			[
				{
					"name" : "ADVANCED",
					"value" : "1"
				},
				{
					"name" : "HELPSTRING",
					"value" : "Flags used by the CXX compiler during all build types."
				}
			],
			"type" : "STRING",
			"value" : ""
		},
		{
			"name" : "CMAKE_CXX_FLAGS_DEBUG",
			"properties" : 
			[
				{
					"name" : "ADVANCED",
					"value" : "1"
				},
				{
					"name" : "HELPSTRING",
					"value" : "Flags used by the CXX compiler during DEBUG builds."
				}
			],
			"type" : "STRING",
			"value" : "-g"
		},
		{
			"name" : "CMAKE_CXX_FLAGS_MINSIZEREL",
			"properties" : 
			[
				{
					"name" : "ADVANCED",
					"value" : "1"
				},
				{
					"name" : "HELPSTRING",
					"value" : "Flags used by the CXX compiler during MINSIZEREL builds."
				}
			],
			"type" : "STRING",
			"value" : "-Os -DNDEBUG"
		},
		{
			"name" : "CMAKE_CXX_FLAGS_RELEASE",
			"properties" : 
			[
				{
					"name" : "ADVANCED",
					"value" : "1"
				},
				{
					"name" : "HELPSTRING",
					"value" : "Flags used by the CXX compiler during RELEASE builds."
				}
			],
			"type" : "STRING",
			"value" : "-O3 -DNDEBUG"
		},
		{
			"name" : "CMAKE_CXX_FLAGS_RELWITHDEBINFO",
			"properties" : 
			[
				{
					"name" : "ADVANCED",
					"value" : "1"
				},
				{
					"name" : "HELPSTRING",
					"value" : "Flags used by the CXX compiler during RELWITHDEBINFO builds."
				}
			],
			"type" : "STRING",
			"value" : "-O2 -g -DNDEBUG"
		},
		{
			"name" : "CMAKE_C_COMPILER",
			"properties" : 
			[
				{
					"name" : "HELPSTRING",
					"value" : "C Compiler"
				}
			],
			"type" : "INTERNAL",
			"value" : "/usr/bin/clang-12"
		},
		{
			"name" : "CMAKE_C_COMPILER_AR",
			"properties" : 
			[
				{
					"name" : "ADVANCED",
					"value" : "1"
				},
				{
					"name" : "HELPSTRING",
					"value" : "LLVM archiver"
				}
			],
			"type" : "FILEPATH",
			"value" : "/usr/bin/llvm-ar-12"
		},
		{
			"name" : "CMAKE_C_COMPILER_RANLIB",
			"properties" : 
			[
				{
					"name" : "ADVANCED",
					"value" : "1"
				},
				{
					"name" : "HELPSTRING",
					"value" : "Generate index for LLVM archive"
				}
			],
			"type" : "FILEPATH",
			"value" : "/usr/bin/llvm-ranlib-12"
		},
		{
			"name" : "CMAKE_C_COMPILER_TARGET",
			"properties" : 
			[
				{
					"name" : "HELPSTRING",
					"value" : "C cross-compile target"
				}
			],
			"type" : "INTERNAL",
			"value" : "riscv32"
		},
		{
			"name" : "CMAKE_C_FLAGS",
			"properties" : 
			[
				{
					"name" : "ADVANCED",
					"value" : "1"
				},
				{
					"name" : "HELPSTRING",
					"value" : "Flags used by the C compiler during all build types."
				}
			],
			"type" : "STRING",
			"value" : ""
		},
		{
			"name" : "CMAKE_C_FLAGS_DEBUG",
			"properties" : 
			[
				{
					"name" : "ADVANCED",
					"value" : "1"
				},
				{
					"name" : "HELPSTRING",
					"value" : "Flags used by the C compiler during DEBUG builds."
				}
			],
			"type" : "STRING",
			"value" : "-g"
		},
		{
			"name" : "CMAKE_C_FLAGS_MINSIZEREL",
			"properties" : 
			[
				{
					"name" : "ADVANCED",
					"value" : "1"
				},
				{
					"name" : "HELPSTRING",
					"value" : "Flags used by the C compiler during MINSIZEREL builds."
				}
			],
			"type" : "STRING",
			"value" : "-Os -DNDEBUG"
		},
		{
			"name" : "CMAKE_C_FLAGS_RELEASE",
			"properties" : 
			[
				{
					"name" : "ADVANCED",
					"value" : "1"
				},
				{
					"name" : "HELPSTRING",
					"value" : "Flags used by the C compiler during RELEASE builds."
				}
			],
			"type" : "STRING",
			"value" : "-O3 -DNDEBUG"
		},
		{
			"name" : "CMAKE_C_FLAGS_RELWITHDEBINFO",
			"properties" : 
			[
				{
					"name" : "ADVANCED",
					"value" : "1"
				},
				{
					"name" : "HELPSTRING",
					"value" : "Flags used by the C compiler during RELWITHDEBINFO builds."
				}
			],
			"type" : "STRING",
			"value" : "-O2 -g -DNDEBUG"
		},
		{
			"name" : "CMAKE_DLLTOOL",
			"properties" : 
			[
				{
					"name" : "ADVANCED",
					"value" : "1"
				},
				{
					"name" : "HELPSTRING",
					"value" : "Path to a program."
				}
			],
			"type" : "FILEPATH",
			"value" : "/usr/bin/llvm-dlltool-12"
		},
		{
			"name" : "CMAKE_EXECUTABLE_FORMAT",
			"properties" : 
			[
				{
					"name" : "HELPSTRING",
					"value" : "Executable file format"
				}
			],
			"type" : "INTERNAL",
			"value" : "ELF"
		},
		{
			"name" : "CMAKE_EXE_LINKER_FLAGS",
			"properties" : 
			[
				{
					"name" : "ADVANCED",
					"value" : "1"
				},
				{
					"name" : "HELPSTRING",
					"value" : "Flags used by the linker during all build types."
				}
			],
			"type" : "STRING",
			"value" : ""
		},
		{
			"name" : "CMAKE_EXE_LINKER_FLAGS_DEBUG",
			"properties" : 
			[
				{
					"name" : "ADVANCED",
					"value" : "1"
				},
				{
					"name" : "HELPSTRING",
					"value" : "Flags used by the linker during DEBUG builds."
				}
			],
			"type" : "STRING",
			"value" : ""
		},
		{
			"name" : "CMAKE_EXE_LINKER_FLAGS_MINSIZEREL",
			"properties" : 
			[
				{
					"name" : "ADVANCED",
					"value" : "1"
				},
				{
					"name" : "HELPSTRING",
					"value" : "Flags used by the linker during MINSIZEREL builds."
				}
			],
			"type" : "STRING",
			"value" : ""
		},
		{
			"name" : "CMAKE_EXE_LINKER_FLAGS_RELEASE",
			"properties" : 
			[
				{
					"name" : "ADVANCED",
					"value" : "1"
				},
				{
					"name" : "HELPSTRING",
					"value" : "Flags used by the linker during RELEASE builds."
				}
			],
			"type" : "STRING",
			"value" : ""
		},
		{
			"name" : "CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO",
			"properties" : 
			[
				{
					"name" : "ADVANCED",
					"value" : "1"
				},
				{
					"name" : "HELPSTRING",
					"value" : "Flags used by the linker during RELWITHDEBINFO builds."
				}
			],
			"type" : "STRING",
			"value" : ""
		},
		{
			"name" : "CMAKE_EXPORT_COMPILE_COMMANDS",
			"properties" : 
			[
				{
					"name" : "HELPSTRING",
					"value" : "No help, variable specified on the command line."
				}
			],
			"type" : "BOOL",
			"value" : "TRUE"
		},
		{
			"name" : "CMAKE_EXTRA_GENERATOR",
			"properties" : 
			[
				{
					"name" : "HELPSTRING",
					"value" : "Name of external makefile project generator."
				}
			],
			"type" : "INTERNAL",
			"value" : ""
		},
		{
			"name" : "CMAKE_GENERATOR",
			"properties" : 
			[
				{
					"name" : "HELPSTRING",
					"value" : "Name of generator."
				}
			],
			"type" : "INTERNAL",
			"value" : "Ninja"
		},
		{
			"name" : "CMAKE_GENERATOR_INSTANCE",
			"properties" : 
			[
				{
					"name" : "HELPSTRING",
					"value" : "Generator instance identifier."
				}
			],
			"type" : "INTERNAL",
			"value" : ""
		},
		{
			"name" : "CMAKE_GENERATOR_PLATFORM",
			"properties" : 
			[
				{
					"name" : "HELPSTRING",
					"value" : "Name of generator platform."
				}
			],
			"type" : "INTERNAL",
			"value" : ""
		},
		{
			"name" : "CMAKE_GENERATOR_TOOLSET",
			"properties" : 
			[
				{
					"name" : "HELPSTRING",
					"value" : "Name of generator toolset."
				}
			],
			"type" : "INTERNAL",
			"value" : ""
		},
		{
			"name" : "CMAKE_HOME_DIRECTORY",
			"properties" : 
			[
				{
					"name" : "HELPSTRING",
					"value" : "Source directory with the top level CMakeLists.txt file for this project"
				}
			],
			"type" : "INTERNAL",
			"value" : "/workspaces/riscv-tries"
		},
		{
			"name" : "CMAKE_INSTALL_BINDIR",
			"properties" : 
			[
				{
					"name" : "ADVANCED",
					"value" : "1"
				},
				{
					"name" : "HELPSTRING",
					"value" : "User executables (bin)"
				}
			],
			"type" : "PATH",
			"value" : "bin"
		},
		{
			"name" : "CMAKE_INSTALL_DATADIR",
			"properties" : 
			[
				{
					"name" : "ADVANCED",
					"value" : "1"
				},
				{
					"name" : "HELPSTRING",
					"value" : "Read-only architecture-independent data (DATAROOTDIR)"
				}
			],
			"type" : "PATH",
			"value" : ""
		},
		{
			"name" : "CMAKE_INSTALL_DATAROOTDIR",
			"properties" : 
			[
				{
					"name" : "ADVANCED",
					"value" : "1"
				},
				{
					"name" : "HELPSTRING",
					"value" : "Read-only architecture-independent data root (share)"
				}
			],
			"type" : "PATH",
			"value" : "share"
		},
		{
			"name" : "CMAKE_INSTALL_DOCDIR",
			"properties" : 
			[
				{
					"name" : "ADVANCED",
					"value" : "1"
				},
				{
					"name" : "HELPSTRING",
					"value" : "Documentation root (DATAROOTDIR/doc/PROJECT_NAME)"
				}
			],
			"type" : "PATH",
			"value" : ""
		},
		{
			"name" : "CMAKE_INSTALL_INCLUDEDIR",
			"properties" : 
			[
				{
					"name" : "ADVANCED",
					"value" : "1"
				},
				{
					"name" : "HELPSTRING",
					"value" : "C header files (include)"
				}
			],
			"type" : "PATH",
			"value" : "include"
		},
		{
			"name" : "CMAKE_INSTALL_INFODIR",
			"properties" : 
			[
				{
					"name" : "ADVANCED",
					"value" : "1"
				},
				{
					"name" : "HELPSTRING",
					"value" : "Info documentation (DATAROOTDIR/info)"
				}
			],
			"type" : "PATH",
			"value" : ""
		},
		{
			"name" : "CMAKE_INSTALL_LIBDIR",
			"properties" : 
			[
				{
					"name" : "ADVANCED",
					"value" : "1"
				},
				{
					"name" : "HELPSTRING",
					"value" : "Object code libraries (lib)"
				}
			],
			"type" : "PATH",
			"value" : "lib"
		},
		{
			"name" : "CMAKE_INSTALL_LIBEXECDIR",
			"properties" : 
			[
				{
					"name" : "ADVANCED",
					"value" : "1"
				},
				{
					"name" : "HELPSTRING",
					"value" : "Program executables (libexec)"
				}
			],
			"type" : "PATH",
			"value" : "libexec"
		},
		{
			"name" : "CMAKE_INSTALL_LOCALEDIR",
			"properties" : 
			[
				{
					"name" : "ADVANCED",
					"value" : "1"
				},
				{
					"name" : "HELPSTRING",
					"value" : "Locale-dependent data (DATAROOTDIR/locale)"
				}
			],
			"type" : "PATH",
			"value" : ""
		},
		{
			"name" : "CMAKE_INSTALL_LOCALSTATEDIR",
			"properties" : 
			[
				{
					"name" : "ADVANCED",
					"value" : "1"
				},
				{
					"name" : "HELPSTRING",
					"value" : "Modifiable single-machine data (var)"
				}
			],
			"type" : "PATH",
			"value" : "var"
		},
		{
			"name" : "CMAKE_INSTALL_MANDIR",
			"properties" : 
			[
				{
					"name" : "ADVANCED",
					"value" : "1"
				},
				{
					"name" : "HELPSTRING",
					"value" : "Man documentation (DATAROOTDIR/man)"
				}
			],
			"type" : "PATH",
			"value" : ""
		},
		{
			"name" : "CMAKE_INSTALL_OLDINCLUDEDIR",
			"properties" : 
			[
				{
					"name" : "ADVANCED",
					"value" : "1"
				},
				{
					"name" : "HELPSTRING",
					"value" : "C header files for non-gcc (/usr/include)"
				}
			],
			"type" : "PATH",
			"value" : "/usr/include"
		},
		{
			"name" : "CMAKE_INSTALL_PREFIX",
			"properties" : 
			[
				{
					"name" : "HELPSTRING",
					"value" : "Install path prefix, prepended onto install directories."
				}
			],
			"type" : "PATH",
			"value" : "/usr/local"
		},
		{
			"name" : "CMAKE_INSTALL_RUNSTATEDIR",
			"properties" : 
			[
				{
					"name" : "ADVANCED",
					"value" : "1"
				},
				{
					"name" : "HELPSTRING",
					"value" : "Run-time variable data (LOCALSTATEDIR/run)"
				}
			],
			"type" : "PATH",
			"value" : ""
		},
		{
			"name" : "CMAKE_INSTALL_SBINDIR",
			"properties" : 
			[
				{
					"name" : "ADVANCED",
					"value" : "1"
				},
				{
					"name" : "HELPSTRING",
					"value" : "System admin executables (sbin)"
				}
			],
			"type" : "PATH",
			"value" : "sbin"
		},
		{
			"name" : "CMAKE_INSTALL_SHAREDSTATEDIR",
			"properties" : 
			[
				{
					"name" : "ADVANCED",
					"value" : "1"
				},
				{
					"name" : "HELPSTRING",
					"value" : "Modifiable architecture-independent data (com)"
				}
			],
			"type" : "PATH",
			"value" : "com"
		},
		{
			"name" : "CMAKE_INSTALL_SYSCONFDIR",
			"properties" : 
			[
				{
					"name" : "ADVANCED",
					"value" : "1"
				},
				{
					"name" : "HELPSTRING",
					"value" : "Read-only single-machine data (etc)"
				}
			],
			"type" : "PATH",
			"value" : "etc"
		},
		{
			"name" : "CMAKE_LINKER",
			"properties" : 
			[
				{
					"name" : "ADVANCED",
					"value" : "1"
				},
				{
					"name" : "HELPSTRING",
					"value" : "Path to a program."
				}
			],
			"type" : "FILEPATH",
			"value" : "/opt/riscv32/riscv32-unknown-elf/bin/ld"
		},
		{
			"name" : "CMAKE_MAKE_PROGRAM",
			"properties" : 
			[
				{
					"name" : "ADVANCED",
					"value" : "1"
				},
				{
					"name" : "HELPSTRING",
					"value" : "Program used to build from build.ninja files."
				}
			],
			"type" : "FILEPATH",
			"value" : "/usr/bin/ninja"
		},
		{
			"name" : "CMAKE_MODULE_LINKER_FLAGS",
			"properties" : 
			[
				{
					"name" : "ADVANCED",
					"value" : "1"
				},
				{
					"name" : "HELPSTRING",
					"value" : "Flags used by the linker during the creation of modules during all build types."
				}
			],
			"type" : "STRING",
			"value" : ""
		},
		{
			"name" : "CMAKE_MODULE_LINKER_FLAGS_DEBUG",
			"properties" : 
			[
				{
					"name" : "ADVANCED",
					"value" : "1"
				},
				{
					"name" : "HELPSTRING",
					"value" : "Flags used by the linker during the creation of modules during DEBUG builds."
				}
			],
			"type" : "STRING",
			"value" : ""
		},
		{
			"name" : "CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL",
			"properties" : 
			[
				{
					"name" : "ADVANCED",
					"value" : "1"
				},
				{
					"name" : "HELPSTRING",
					"value" : "Flags used by the linker during the creation of modules during MINSIZEREL builds."
				}
			],
			"type" : "STRING",
			"value" : ""
		},
		{
			"name" : "CMAKE_MODULE_LINKER_FLAGS_RELEASE",
			"properties" : 
			[
				{
					"name" : "ADVANCED",
					"value" : "1"
				},
				{
					"name" : "HELPSTRING",
					"value" : "Flags used by the linker during the creation of modules during RELEASE builds."
				}
			],
			"type" : "STRING",
			"value" : ""
		},
		{
			"name" : "CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO",
			"properties" : 
			[
				{
					"name" : "ADVANCED",
					"value" : "1"
				},
				{
					"name" : "HELPSTRING",
					"value" : "Flags used by the linker during the creation of modules during RELWITHDEBINFO builds."
				}
			],
			"type" : "STRING",
			"value" : ""
		},
		{
			"name" : "CMAKE_NM",
			"properties" : 
			[
				{
					"name" : "ADVANCED",
					"value" : "1"
				},
				{
					"name" : "HELPSTRING",
					"value" : "Path to a program."
				}
			],
			"type" : "FILEPATH",
			"value" : "/opt/riscv32/riscv32-unknown-elf/bin/nm"
		},
		{
			"name" : "CMAKE_NUMBER_OF_MAKEFILES",
			"properties" : 
			[
				{
					"name" : "HELPSTRING",
					"value" : "number of local generators"
				}
			],
			"type" : "INTERNAL",
			"value" : "7"
		},
		{
			"name" : "CMAKE_OBJCOPY",
			"properties" : 
			[
				{
					"name" : "HELPSTRING",
					"value" : "objcopy tool"
				}
			],
			"type" : "INTERNAL",
			"value" : "/opt/riscv32/bin/riscv32-unknown-elf-objcopy"
		},
		{
			"name" : "CMAKE_OBJDUMP",
			"properties" : 
			[
				{
					"name" : "HELPSTRING",
					"value" : "objdump tool"
				}
			],
			"type" : "INTERNAL",
			"value" : "/opt/riscv32/bin/riscv32-unknown-elf-objdump"
		},
		{
			"name" : "CMAKE_PLATFORM_INFO_INITIALIZED",
			"properties" : 
			[
				{
					"name" : "HELPSTRING",
					"value" : "Platform information initialized"
				}
			],
			"type" : "INTERNAL",
			"value" : "1"
		},
		{
			"name" : "CMAKE_PROJECT_DESCRIPTION",
			"properties" : 
			[
				{
					"name" : "HELPSTRING",
					"value" : "Value Computed by CMake"
				}
			],
			"type" : "STATIC",
			"value" : ""
		},
		{
			"name" : "CMAKE_PROJECT_HOMEPAGE_URL",
			"properties" : 
			[
				{
					"name" : "HELPSTRING",
					"value" : "Value Computed by CMake"
				}
			],
			"type" : "STATIC",
			"value" : ""
		},
		{
			"name" : "CMAKE_PROJECT_NAME",
			"properties" : 
			[
				{
					"name" : "HELPSTRING",
					"value" : "Value Computed by CMake"
				}
			],
			"type" : "STATIC",
			"value" : "kvasir-showcase"
		},
		{
			"name" : "CMAKE_RANLIB",
			"properties" : 
			[
				{
					"name" : "ADVANCED",
					"value" : "1"
				},
				{
					"name" : "HELPSTRING",
					"value" : "Path to a program."
				}
			],
			"type" : "FILEPATH",
			"value" : "/opt/riscv32/riscv32-unknown-elf/bin/ranlib"
		},
		{
			"name" : "CMAKE_READELF",
			"properties" : 
			[
				{
					"name" : "ADVANCED",
					"value" : "1"
				},
				{
					"name" : "HELPSTRING",
					"value" : "Path to a program."
				}
			],
			"type" : "FILEPATH",
			"value" : "/opt/riscv32/riscv32-unknown-elf/bin/readelf"
		},
		{
			"name" : "CMAKE_ROOT",
			"properties" : 
			[
				{
					"name" : "HELPSTRING",
					"value" : "Path to CMake installation."
				}
			],
			"type" : "INTERNAL",
			"value" : "/usr/local/share/cmake-3.21"
		},
		{
			"name" : "CMAKE_SHARED_LINKER_FLAGS",
			"properties" : 
			[
				{
					"name" : "ADVANCED",
					"value" : "1"
				},
				{
					"name" : "HELPSTRING",
					"value" : "Flags used by the linker during the creation of shared libraries during all build types."
				}
			],
			"type" : "STRING",
			"value" : ""
		},
		{
			"name" : "CMAKE_SHARED_LINKER_FLAGS_DEBUG",
			"properties" : 
			[
				{
					"name" : "ADVANCED",
					"value" : "1"
				},
				{
					"name" : "HELPSTRING",
					"value" : "Flags used by the linker during the creation of shared libraries during DEBUG builds."
				}
			],
			"type" : "STRING",
			"value" : ""
		},
		{
			"name" : "CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL",
			"properties" : 
			[
				{
					"name" : "ADVANCED",
					"value" : "1"
				},
				{
					"name" : "HELPSTRING",
					"value" : "Flags used by the linker during the creation of shared libraries during MINSIZEREL builds."
				}
			],
			"type" : "STRING",
			"value" : ""
		},
		{
			"name" : "CMAKE_SHARED_LINKER_FLAGS_RELEASE",
			"properties" : 
			[
				{
					"name" : "ADVANCED",
					"value" : "1"
				},
				{
					"name" : "HELPSTRING",
					"value" : "Flags used by the linker during the creation of shared libraries during RELEASE builds."
				}
			],
			"type" : "STRING",
			"value" : ""
		},
		{
			"name" : "CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO",
			"properties" : 
			[
				{
					"name" : "ADVANCED",
					"value" : "1"
				},
				{
					"name" : "HELPSTRING",
					"value" : "Flags used by the linker during the creation of shared libraries during RELWITHDEBINFO builds."
				}
			],
			"type" : "STRING",
			"value" : ""
		},
		{
			"name" : "CMAKE_SIZE_UTIL",
			"properties" : 
			[
				{
					"name" : "HELPSTRING",
					"value" : "size tool"
				}
			],
			"type" : "INTERNAL",
			"value" : "llvm-size-12"
		},
		{
			"name" : "CMAKE_SKIP_INSTALL_RPATH",
			"properties" : 
			[
				{
					"name" : "ADVANCED",
					"value" : "1"
				},
				{
					"name" : "HELPSTRING",
					"value" : "If set, runtime paths are not added when installing shared libraries, but are added when building."
				}
			],
			"type" : "BOOL",
			"value" : "NO"
		},
		{
			"name" : "CMAKE_SKIP_RPATH",
			"properties" : 
			[
				{
					"name" : "ADVANCED",
					"value" : "1"
				},
				{
					"name" : "HELPSTRING",
					"value" : "If set, runtime paths are not added when using shared libraries."
				}
			],
			"type" : "BOOL",
			"value" : "NO"
		},
		{
			"name" : "CMAKE_STATIC_LINKER_FLAGS",
			"properties" : 
			[
				{
					"name" : "ADVANCED",
					"value" : "1"
				},
				{
					"name" : "HELPSTRING",
					"value" : "Flags used by the linker during the creation of static libraries during all build types."
				}
			],
			"type" : "STRING",
			"value" : ""
		},
		{
			"name" : "CMAKE_STATIC_LINKER_FLAGS_DEBUG",
			"properties" : 
			[
				{
					"name" : "ADVANCED",
					"value" : "1"
				},
				{
					"name" : "HELPSTRING",
					"value" : "Flags used by the linker during the creation of static libraries during DEBUG builds."
				}
			],
			"type" : "STRING",
			"value" : ""
		},
		{
			"name" : "CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL",
			"properties" : 
			[
				{
					"name" : "ADVANCED",
					"value" : "1"
				},
				{
					"name" : "HELPSTRING",
					"value" : "Flags used by the linker during the creation of static libraries during MINSIZEREL builds."
				}
			],
			"type" : "STRING",
			"value" : ""
		},
		{
			"name" : "CMAKE_STATIC_LINKER_FLAGS_RELEASE",
			"properties" : 
			[
				{
					"name" : "ADVANCED",
					"value" : "1"
				},
				{
					"name" : "HELPSTRING",
					"value" : "Flags used by the linker during the creation of static libraries during RELEASE builds."
				}
			],
			"type" : "STRING",
			"value" : ""
		},
		{
			"name" : "CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO",
			"properties" : 
			[
				{
					"name" : "ADVANCED",
					"value" : "1"
				},
				{
					"name" : "HELPSTRING",
					"value" : "Flags used by the linker during the creation of static libraries during RELWITHDEBINFO builds."
				}
			],
			"type" : "STRING",
			"value" : ""
		},
		{
			"name" : "CMAKE_STRIP",
			"properties" : 
			[
				{
					"name" : "ADVANCED",
					"value" : "1"
				},
				{
					"name" : "HELPSTRING",
					"value" : "Path to a program."
				}
			],
			"type" : "FILEPATH",
			"value" : "/opt/riscv32/riscv32-unknown-elf/bin/strip"
		},
		{
			"name" : "CMAKE_SYSROOT",
			"properties" : 
			[
				{
					"name" : "HELPSTRING",
					"value" : "root of our toolchain"
				}
			],
			"type" : "INTERNAL",
			"value" : "/opt/riscv32/riscv32-unknown-elf"
		},
		{
			"name" : "CMAKE_TOOLCHAIN_FILE",
			"properties" : 
			[
				{
					"name" : "HELPSTRING",
					"value" : "The CMake toolchain file"
				}
			],
			"type" : "FILEPATH",
			"value" : "/workspaces/riscv-tries/external/clang12-riscv/toolchain.cmake"
		},
		{
			"name" : "CMAKE_UNAME",
			"properties" : 
			[
				{
					"name" : "HELPSTRING",
					"value" : "uname command"
				}
			],
			"type" : "INTERNAL",
			"value" : "/usr/bin/uname"
		},
		{
			"name" : "CMAKE_VERBOSE_MAKEFILE",
			"properties" : 
			[
				{
					"name" : "ADVANCED",
					"value" : "1"
				},
				{
					"name" : "HELPSTRING",
					"value" : "If this value is on, makefiles will be generated without the .SILENT directive, and all commands will be echoed to the console during the make.  This is useful for debugging only. With Visual Studio IDE projects all commands are done without /nologo."
				}
			],
			"type" : "BOOL",
			"value" : "FALSE"
		},
		{
			"name" : "FETCHCONTENT_BASE_DIR",
			"properties" : 
			[
				{
					"name" : "HELPSTRING",
					"value" : "Directory under which to collect all populated content"
				}
			],
			"type" : "PATH",
			"value" : "/workspaces/riscv-tries/build/_deps"
		},
		{
			"name" : "FETCHCONTENT_FULLY_DISCONNECTED",
			"properties" : 
			[
				{
					"name" : "HELPSTRING",
					"value" : "Disables all attempts to download or update content and assumes source dirs already exist"
				}
			],
			"type" : "BOOL",
			"value" : "OFF"
		},
		{
			"name" : "FETCHCONTENT_QUIET",
			"properties" : 
			[
				{
					"name" : "HELPSTRING",
					"value" : "Enables QUIET option for all content population"
				}
			],
			"type" : "BOOL",
			"value" : "ON"
		},
		{
			"name" : "FETCHCONTENT_SOURCE_DIR_KVASIR_MPL",
			"properties" : 
			[
				{
					"name" : "HELPSTRING",
					"value" : "When not empty, overrides where to find pre-populated content for kvasir_mpl"
				}
			],
			"type" : "PATH",
			"value" : ""
		},
		{
			"name" : "FETCHCONTENT_UPDATES_DISCONNECTED",
			"properties" : 
			[
				{
					"name" : "HELPSTRING",
					"value" : "Enables UPDATE_DISCONNECTED behavior for all content population"
				}
			],
			"type" : "BOOL",
			"value" : "OFF"
		},
		{
			"name" : "FETCHCONTENT_UPDATES_DISCONNECTED_KVASIR_MPL",
			"properties" : 
			[
				{
					"name" : "HELPSTRING",
					"value" : "Enables UPDATE_DISCONNECTED behavior just for population of kvasir_mpl"
				}
			],
			"type" : "BOOL",
			"value" : "OFF"
		},
		{
			"name" : "GIT_EXECUTABLE",
			"properties" : 
			[
				{
					"name" : "ADVANCED",
					"value" : "1"
				},
				{
					"name" : "HELPSTRING",
					"value" : "Git command line client"
				}
			],
			"type" : "FILEPATH",
			"value" : "/usr/bin/git"
		},
		{
			"name" : "MAKE_INCLUDE_TESTS",
			"properties" : 
			[
				{
					"name" : "HELPSTRING",
					"value" : "OFF"
				}
			],
			"type" : "BOOL",
			"value" : "OFF"
		},
		{
			"name" : "STANDARDESE",
			"properties" : 
			[
				{
					"name" : "HELPSTRING",
					"value" : "Path to a program."
				}
			],
			"type" : "FILEPATH",
			"value" : "STANDARDESE-NOTFOUND"
		},
		{
			"name" : "_GNUInstallDirs_LAST_CMAKE_INSTALL_PREFIX",
			"properties" : 
			[
				{
					"name" : "HELPSTRING",
					"value" : "CMAKE_INSTALL_PREFIX during last run"
				}
			],
			"type" : "INTERNAL",
			"value" : "/usr/local"
		},
		{
			"name" : "kvasir-showcase_BINARY_DIR",
			"properties" : 
			[
				{
					"name" : "HELPSTRING",
					"value" : "Value Computed by CMake"
				}
			],
			"type" : "STATIC",
			"value" : "/workspaces/riscv-tries/build"
		},
		{
			"name" : "kvasir-showcase_IS_TOP_LEVEL",
			"properties" : 
			[
				{
					"name" : "HELPSTRING",
					"value" : "Value Computed by CMake"
				}
			],
			"type" : "STATIC",
			"value" : "ON"
		},
		{
			"name" : "kvasir-showcase_SOURCE_DIR",
			"properties" : 
			[
				{
					"name" : "HELPSTRING",
					"value" : "Value Computed by CMake"
				}
			],
			"type" : "STATIC",
			"value" : "/workspaces/riscv-tries"
		},
		{
			"name" : "kvasir_mpl_BINARY_DIR",
			"properties" : 
			[
				{
					"name" : "HELPSTRING",
					"value" : "Value Computed by CMake"
				}
			],
			"type" : "STATIC",
			"value" : "/workspaces/riscv-tries/build/_deps/kvasir_mpl-build"
		},
		{
			"name" : "kvasir_mpl_IS_TOP_LEVEL",
			"properties" : 
			[
				{
					"name" : "HELPSTRING",
					"value" : "Value Computed by CMake"
				}
			],
			"type" : "STATIC",
			"value" : "OFF"
		},
		{
			"name" : "kvasir_mpl_SOURCE_DIR",
			"properties" : 
			[
				{
					"name" : "HELPSTRING",
					"value" : "Value Computed by CMake"
				}
			],
			"type" : "STATIC",
			"value" : "/workspaces/riscv-tries/build/_deps/kvasir_mpl-src"
		}
	],
	"kind" : "cache",
	"version" : 
	{
		"major" : 2,
		"minor" : 0
	}
}

@bobbrow
Copy link
Member

bobbrow commented Oct 29, 2021

@andreasWallner, thank you for sharing these logs. What appears to be the problem is that the --target flag is not included in the compileCommandFragments for the ROM target. It's listed only in the compiler object from the toolchain JSON. We weren't actively filtering it out of the flags -- it wasn't there.

I would think that this is a CMake bug (everything required on the command line should be in the fragments**), but we could probably poke around the toolchain object model and try to grab it from there.

**EDIT: I guess sysroot is not in there either, but it's on the same object in the object model.

@andreasWallner
Copy link

@bobbrow Not sure it's cmake's "fault", they are at least consistent with their documentation (even though I have to admit it seems a bit inconsistent). I don't really have a stake in either tool though...

@bobbrow
Copy link
Member

bobbrow commented Oct 20, 2022

We have a fix for this. It should be in the 1.13.17 release tomorrow morning (PDT).

@github-actions github-actions bot locked and limited conversation to collaborators Dec 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants