Cannot Configure a C Compiler on AXC F 3152 Controller

Hello everyone, I hope you are doing well
I have an AXC F 3152 PLC and I want to download some C related packages, such as Cmake , and some packages for python , node and so on. The first problem I am facing is that I am not able to setup a C compiler on my device, the most lightweight C linux compiler out there is Tinycc (tcc-0.9.26 or more commonly known as TCC) and I am yet to find any prebuilt binaries matching my controllers system.
I tried using the AXC F 3152 SDK provided on the PLCnext webpage and downloading TCC and compiling it in the SDK so that i can transfer those binaries to the PLC itself, but everytime i do ./configure i get this error: gcc: No such file or directory
I am guessing GCC doesn’t exist on my device (which is why I want to download TCC in the first place), I tried to manually download GCC in the SDK but I cannot compile anything because a C compiler does not exist on my device in the first place.
Having a C compiler would be extremely helpful, does anyone have any insights or solutions to this?
If you are wondering how I got into the SDK, I simply chroot the /bin/bash file in the SDK sysroots/corei7-64-pxc-linux folder and voila!
Full Error Details:
bash-5.1# ./configure
configure: error: ‚gcc‘ failed to compile conftest.c.
Binary directory /usr/local/bin
TinyCC directory /usr/local/lib/tcc
Library directory /usr/local/lib
Include directory /usr/local/include
Manual directory /usr/local/share/man
Info directory /usr/local/share/info
Doc directory /usr/local/share/doc/tcc
Target root prefix
Source path /home/myshit/tcc-0.9.26
C compiler gcc
Target OS Linux
CPU x86-64
Big Endian no
gprof enabled no
cross compilers no
use libgcc no
Creating config.mak and config.h

My Controller Details:
AXC F 3152
Hardware version: 2
Firmware: 2023.3.0 (23.3.0.38)

Your help is much appreciated,
Thank you

There is a compiler in the SDK.
Something like this might work:

$ export SDKROOT=/opt/pxc/sdk/AXCF2152/2024.0  # change this to the path where your SDK is installed.
$ source ${SDKROOT}/environment-setup*
$ ./configure
$ make

Thank you Martin for your reply,
I did what you suggested and I configured and make the TCC compiler, i zipped it and sent it to my controller, now when i try to execute the tcc binary the system replies with:
sh: tcc: command not found

Any ideas on why this is happening?

I suspect that tcc hasn’t been cross-compiled for the target platform. Cross compiling is always tricky (for me at least) - every package seems to have different configure options, and I’m not sure what options are needed to successfully cross-compile tcc in this case.
In saying that, if you can find binaries that have already been compiled for a linux x86 platform they should work on an AXC F 3152, but you will probably need to create a symlink to the interpreter, something like this:
Forum - PLCnext Community PLCnext Technology from Phoenix Contact is a unique, open ecosystem for modern automation that is capable of meeting all the challenges of the IoT world.

mkdir /lib64
ln -sf /lib/ld-linux-x86-64.so.2 /lib64/ld-linux-x86-64.so.2

A similar problem was discuss here:

I did that, now i tried to use tcc and i get this
tcc: error: file ‚crt1.o‘ not found
tcc: error: file ‚crti.o‘ not found
hello.c:1: error: include file ‚stdio.h‘ not found

crt1.o and crti.o are supposed to be already present on the system i believe

crt1.o and crti.o are supposed to be already present on the system i believeYes. Maybe tcc needs to be given the library path?

all those libraries are not on the system in the first place

Dear Martin,
I tried to look for them using find / -name crt1.o and crti.o as well but I got no path, glibc is already on the PLC so I don’t know why they are not already present in the system, and I do not know what to do, if you can suggest me something please do.
Thank you for your help, time, and effort.

all those libraries are not on the system in the first place😅</span></p>

Yes sorry, I had seen these files in the SDK and I thought you had found them on the device, but you’re right, these files are not included on the device.
Due to resource limitations on the target it’s intended that the SDK be used to build binaries for the target, so that all the build dependencies don’t need to be included on the device itself. If you want to install a complete toolchain on the device then you’ll also have to include all the dependencies that your code needs, if they’re not there already.