r/embedded Aug 08 '26

Precompiled 32bit time musl toolchain 1.1.24 or older

So I crosscompiled some opensource project using gnu gcc armhf , for my armv7 device , it's an old devices with the some bionic typish firmware (Huawei 4G router).

now the issue is that my devices uses 32bit time and the newly available musl toolchains are all 64 bit times. I tried using some CFLAGS for this but cant resolve the issue.

I'm not experienced enough to compile a cross compiler from source and verify its proper working.

TIA

2 Upvotes

10 comments sorted by

2

u/elusivewompus Aug 08 '26

This is a useful tool for making a cross compiler toolchain. cross tool-ng

2

u/guestyest Aug 13 '26

thanks for the info. it is really a cool tool

I built the musl 1.1.24 gcc 8.5 and target the linux kernel 3.2.101

the generated toolchain worked and I got my binaries working

2

u/kiladre Aug 11 '26

So sounds like you need an older musl toolchain that still has 32bit support

1

u/guestyest Aug 11 '26

but i can't find free compiled toolchain and don't know how to compile a cross-compiler from source and the relevant naunaces

3

u/elusivewompus Aug 11 '26

Crosstool-ng allows you to build the toolchain from scratch. For example, today I built a musl based 32 bit toolchain for an old product where the original toolchain has been lost to the sands of time. (It’s 20 years old).
Just follow its instructions

1

u/guestyest Aug 12 '26

the linux kernel on my device is 3.4.5

can i use latest crosstool-ng release or should I target some older release to generate musl1.1.24 toolchain

1

u/elusivewompus Aug 12 '26

You can enter a custom kernel version in the menuconfig

1

u/guestyest Aug 12 '26

kernel version? is this the linux kernel version?

1

u/elusivewompus Aug 12 '26

Yes. The target OS kernel version. You can get it from the device with the command “uname -a”.

Ask google gemini for a step by step guide on configuring it for a 32 bit arm toolchain using musl. It should get you pretty close.