Making my own container for cross development

This chat forum will appear to guests and bots. IE will appear on search engines etc. If you do not want your appearing publicly then please use the original chat forum.
User avatar
sporniket
Site sponsor
Site sponsor
Posts: 1164
Joined: 26 Sep 2020 21:12
Location: France

Making my own container for cross development

Post by sporniket »

A little bit of warning :
  • My intent is to share the recipe of what I do, I do not intend to publish a ready made container to a container registry.
  • It should run on any unix/linux-ish system on intel/amd-ish CPU, especially running graphical and audio application from the container requires an X11 socket and /dev/snd device. No promise on any other family of CPU (ARM,...) or other OSes (Apple, or even worse, Windows...). That's also a supplemental reason why I share the recipe instead of a ready made container.
I was inspired by containers made by others, like this one by the maker of the side-cartridge : https://github.com/sidecartridge/atarist-toolkit-docker

My goal was to use the binaries made by @thorsten.otto and available on his site there : https://tho-otto.de/crossmint.php

Then, I also wanted to provide hatari for allowing testing without a separate installation.

Finally, I wanted
  • to use cmake, meaning finding how to setup cross building
  • provide a LSP for supporting text editors/IDE (my choice is Pulsar editor, and I consider to include neovim later because textual interface only), with the potential to navigate through C/C++ code, able to jump to standard headers (that last part has to be tested and refined)
, and provide a LSP for text editors/IDE that implement that system .

My results so far with a little video (no sound), demonstrating the sample hello world program build using cmake, then testing it on hatari :


User avatar
sporniket
Site sponsor
Site sponsor
Posts: 1164
Joined: 26 Sep 2020 21:12
Location: France

Re: Making my own container for cross development

Post by sporniket »

Today, I wanted to refine the navigation inside the code, more specifically, check that it is possible to Control+Click on a standard header and then the IDE opens it.

TL/DR : I got it working, at least for header directly included by a source file in the project. Here a snapshot showing that "<osbind.h>" is clickable, and then the IDE opened the file. However, in that file, <mint/osbind.h> is not clickable. Most likely because the "hello.cpp" from the project has an entry inside the compile_commands.json generated by cmake, but not system header files. By the way, directly including "<mint/osbind.h>" allows to navigate to that file.

Capture d’écran du 2025-11-18 16-46-19.png
Capture d’écran du 2025-11-18 16-48-57.png

So the next step is trying to have navigability of system header files, if it is possible at all.

How I got the result : I had to add a ".clangd" configuration file for clangd, in order to add the system include pathes. This forces those pathes BEFORE other system pathes that are automatically included (e.g. without that, clicking on "<iostream>" shows the header file of the host linux, instead of the header files for atari cross compiler)

Code: Select all

CompileFlags:
  Add: [
    -I,
    /usr/m68k-atari-mintelf/sys-root/usr/include/c++/15,
    -I,
    /usr/m68k-atari-mintelf/sys-root/usr/include
  ]

In addition, I extracted the cross-compiling parameters of cmake into a toolchain file, and referenced it in my "cmrefresh" script.

The github is up to date.
You do not have the required permissions to view the files attached to this post.
User avatar
sporniket
Site sponsor
Site sponsor
Posts: 1164
Joined: 26 Sep 2020 21:12
Location: France

Re: Making my own container for cross development

Post by sporniket »

For now, I leave the problem that I cannot navigate inside the system headers, it is not blocking. The most important features are the ability to jump to the symbol used, and of course the auto completion.

Capture d’écran du 2025-11-19 12-15-54.png

Now about writing GEM/VDI application, I found the complete "C-Manship" tutorial, and I ported the program that illustrate chapter 11. The port consisted in using modern c++ syntax instead of K&R, replacing "int" by "short int" (was to lazy to do it, but "short" should suffice), and the VDI call "v_show_c" needs a second argument nowadays. And also add the gem library to be able to build the program.


You do not have the required permissions to view the files attached to this post.

Return to “CHAT FORUM PUBLIC”

Who is online

Users browsing this forum: ClaudeBot, jmorden and 10 guests