Arm Gcc Toolchain

0 views
Skip to first unread message

Berk Boyraz

unread,
Aug 4, 2024, 5:32:15 PM8/4/24
to deryningge
Insoftware, a toolchain is a set of programming tools that are used to perform a complex software development task or to create a software product, which is typically another computer program or a set of related programs. In general, the tools forming a toolchain are executed consecutively so the output or resulting environment state of each tool becomes the input or starting environment for the next one, but the term is also used when referring to a set of related tools that are not necessarily executed consecutively.[1][2][3]

A simple software development toolchain often refers to the necessary tools to develop for a given operating system running a certain CPU architecture, consisting of a compiler and linker (which transform the source code into an executable program), libraries (which provide interfaces to the operating system), and a debugger (which is used to test and debug created programs). Cross-compilation toolchains are also available. A complex software product such as a video game needs tools for preparing sound effects, music, textures, 3-dimensional models and animations, together with additional tools for combining these resources into the finished product.[1][2]


When Maven Toolchains are used to specify the JDK, a project can be built by a specific version of the JDK independent of the one Maven is running with. This is similar to how JDK versions can be set in IDEs like IDEA, NetBeans and Eclipse.


For example, you want to use a different JDK version to build your project than the version used to run Maven, you can configure the version you want to use via this plugin as shown in the pom.xml below:


The toolchains.xml file (see below) is the configuration file where you set the installation paths of your toolchains. This file should be put in the $user.home/.m2 directory. When the maven-toolchains-plugin executes, it looks for the toolchains.xml file, reads it and looks for a toolchain matching the toolchains requirements configured in the plugin. In this example, that is a JDK toolchain with "1.8" and "openjdk". Once a match is found, the plugin then stores the toolchain to be used in the MavenSession. As you can see in the toolchains.xml below, there is indeed a JDK toolchain with "1.8" and "openjdk" configured. So when the maven-compiler-plugin configured in the pom.xml above executes, it sees that a JDK toolchain is set in the MavenSession and will use that toolchain (that would be the JDK installed at /path/to/jdk/1.8 in this example) to compile the sources.


Hi all - trying to get the Rust plugin working on IntelliJ (CLion in this case) and am failing. No matter what, I'm getting the error Invalid toolchain location: can't find Cargo in \home\wbiggs\.cargo\bin.


How are you configuring the toolchain? You should be doing it via the "Languages & Frameworks > Rust > Toolchain location" window. It seems as if you could also do it via run configuration target "Run on" option, but I recall it not working for me.


currently I am thinking about how to ensure that different developers working on the same project are able to keep exact results. Building, linking, debugging and flashing process should be reproducible and identical for my purposes. Any recommendations on this?


When using STM32CubeIDE I had the problem that the project files, which contain information about the toolchain etc., are very difficult to manage. (XML files containing absolute paths, .cproject, .project files etc. are changing on every startup of IDE).


The firmware is in a separate GIT repository and relies on a Makefile build process. There are only relative paths to the toolchain repository in the Makefiles. This means that as soon as all developers consider the hierarchy of the firmware and the toolchain folder, it should always be possible to reproduce identical results. The Makefile contains further commands for building, flashing firmware, erasing etc.


Now I wanted to ask if there are better approaches to make the full lifecycle of firmware development and testing more traceable than my approach. (According to my researches there are also approaches to outsource and manage the toolchain in Docker Images. I don't see the additional benefit to my approach).


Toolchains: The CubeIDE allows to choose a toolchain and install more ST or ARM toolchains. These are versioned. You can also make your own archive. The important thing is to make notes which toolchain and libraries are in use.


Two schools of thought appear to clash here... We can call one unix-spirited, although I personally am not in friendly terms with the *nixen either; and the other gave us facebook among other things... My experiences with Docker felt exactly like that.


Thanks for the input. I will try the way with the separate repositories to manage the toolchain and remaining development tools. In the CubeIDE settings I have seen that it can also be referred to a separate toolchain, but tools such as STM32CubeProgrammer or even the debugger still remain in the plugins installation subfolder of the IDE. A full CubeIDE installation folder versioning via git was my way to ensure that an CubeIDE update does not change of the programmer or debugger versions, which could maybe results in different outcome on controller side. Practically, ST-Link hardware and its firmware versions should also be tracked, these components could have an influence on the reproducibility too.


I recently installed the Swift 5.8 toolchain on my machine via winget following the official installation instructions, and ran into two issues related to DLL loading that were surprisingly frustrating to debug. (I didn't post this in Swift Required DLLs on Windows 10 as that thread seems more related to Swift program distribution, and I'm just trying to run Swift locally here; though, if this is a good fit for that thread, happy to copy this over.)


The first roadblock: attempting to run swift.exe immediately presented dialogs indicating that swiftCore.dll, swiftWinSDK.dll, swiftCRT.dll, and swiftDispatch.dll could not be found, despite the fact that these DLLs had been successfully installed in C:\Program Files\swift\runtime-development\usr\bin, and were in the %PATH%. The solution was to copy the contents of this directory into C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin so that the DLLs were present alongside the executables in question.


The second roadblock: attempting to run swift.exe repl resulted in error: failed to retrieve frontend target info. Vaguely remembering having run into this in the past with LLDB, I tried running lldb.exe from the same directory, and got the same error dialog about python310.dll not being found (also despite being in my %PATH%). The solution was the same: copy python310.dll into the toolchain directory, and run again.


/CC @compnerd as the person most likely to be able to comment on some of these issues, though I don't mean to just dump this wall of text directly on you! Thanks for any help, and please let me know how I might be able to contribute back!


This is definitely the wrong thing to do. The files should not need to be copied. Ensure that you reboot after installation - overkill but ensures the right behaviour. You need to terminate ALL Windows Terminal instances, and then re-launch it. The path adjustment will not take effect otherwise. Once you do that you can verify that your Path environment variable contains the desired path by checking it via the path command in CMD or echo $env:Path in PowerShell.


Again, copying the DLLs around is not the preferred solution. Installation of python properly should place that into your path. If not, you will need to adjust your user path to add Python to the path.


Sadly this works only partially. This is one of the things that needs to be resolved but there are roadblocks within LLDB that prevent this from being resolved imminently. The library search path handling is not sufficiently flexible to allow us to ensure that Path is honoured as a library search path.


Indeed this is the issue; again, this is something that is the result of the LLDB implementation being rigid. We would like to honour the SDKROOT environment variable as it does on Darwin, however, that path is not shared. This is worked around by doing lldb --repl="-sdk %SDKROOT%" from CMD, but then you hit the issue of Path not being honoured for library lookups. That is worked around by manually mapping in the transitive closure of the shared libraries (aka, Not Fun ). I recommend that you subscribe to the fairly old issue tracking this work.


Yes, please continue reporting these issues, even if they are duplicates. The ideal place is on the issues tab on GitHub, but starting threads on the forums for discussions is reasonable as well. The Python dependency issue is something that I'm really frustrated about. I don't know what the best solution here is. Is it better to subsume the responsibility for Python and use the embeddable distribution and distribute it ourselves, increasing the size of the toolchain, vulnerability surface, etc or rely on the user having python installed. I'm not a fan of either option, but I don't see a better solution yet.

3a8082e126
Reply all
Reply to author
Forward
0 new messages