So what can we do. We can likely do a LD_PRELOAD and make it wait so that things execute in order. LD_PRELOAD allows custom libarys to be loaded before anyhing else. An example would be "LD_PRELOAD=./libshmemfix.so /philips/apps/philips"
Normal Computer user: OK guys turns out I need to get GCC 4.2. Oh there is no mipsel binary online? I guess Ill have to build it. im sure that will be easy.
2 Weeks later
I never thought compiling a old version of GCC would be this fucking annoying .
So lets go over the problem shall we.
The problem is that I need to build GCC 4.2 in order to compile a LD_PRELOAD I made.
Thats it... sounds easy right...
Ive spent the last day trying this shit. Eventually I learned that compiling even on a container in modern Debian would be impossible. Even after finding old builds of gcc to work with.
So we need to get a container of debian Lenny a ancient debian version.
Keep in mind this is after over 5 HOURS of attempting to compile.
Alright so now that we got Debian Lenny in a container lets build GCC 4.2. Its finally over
Just so you know I have already spent 5 hours previously getting to the this point before making a entirely new container image.
LETS DO THIS...

Remember when I said I just need to compile GCC. That was a LIE. I also need to compile mipsel assembler and linker.
Alright so now that weve done that we can install it.

WHAT!!!!
OK I FINALLY FIXED THAT FINALLY WE CAN COMPILE IT

OK OK OK THIS IS THE LAST TIME I CAN FINALLY SAY WE FIXED IT

MOTHERFUCKER!!!!
Alright alright this is the final time... This time its going to work

Ok we finally fixed that. We can compile now Its finally over oh my gosh its over FINALLY I CAN COMPILE THIS SHIT YESSSSSSSSSSSSSSSSSSSS

OK OK OK OK OK I HAVE FINALLY FIXED THIS ONE OK. WE CAN FINALLY COMPILE IT

No we cant. No we cant.
Alright thats fine. Thats fine. Im fine. I do not want to blow up a orphange. Everything is fine I am happy.
Ok I fixed it I can say with 100000% certainty that we can compile this now
Alright...... I think I can say this is finally it.... FINALLY its over.... after all this pain and suffering.... its over. We won. Its finished.
Lets run the final make command.
Thats ok.... Thats Ok.... Thats ok....
Ok this time its finally done. everything is defined were finally back oh my gosh
You want to know the worst part that just happened.
My container crashed. And because this is not a fully set up podman I have to reinstall ALL MY PACKAGES VIA APT AND MOVE MY MIPSEL BINUTILS ASSEMBLER BACK.

So after ALL OF THAT me reinstalling ALL THE PACKAGES THAT I NEED, reinstalling my mips linker back into the correct folder and also installing gmp back. We can continue.
After a few more of the same errors I figured out what was happening. The wrapper was messing up and failing to figure out when to use the normal x86 as and the mipsel-linux-gnu as command. So for example when it should had been using the mipsel version of as provided by binutils it was using the x86 version.... After manually telling it to use the mipsel version... Well you can already guess what im about to fucking tell you happened
Alright so after that we have a new problem.

I did that. I did EXACTLY THAT. multiple times and it keeps telling me that things changed even though they litterally DID NOT CHANGE AT FUCKING ALL...
I finally managed to fix it and we can FINALLY AFTER ALL OF THIS COMPILE
The worst part is that this was the furthest we had gotten it compiled like a SHIT TON OF FILES.
After this I finally FINALLY GOT IT COMPILED SHIT I GOT IT WORKING I CANT BELIEVE IT.
Just so you know I went through ALOT more problems that I failed to mention here, this is consiserded a CONDENSED version of everything I fucking went through.
And now do you want to know the worst part. What all that pain and suffering to get that version of GCC working. It was so I could compile this

All of this for 26 lines......
What ive learned from all of this is that just because you provide the source code for something does NOT mean its archived or preserved. older versions of GGC are a fucking NIGHTMARE to compile and soon enough they will become lost to time without those dependiences and systems. Its basically a fossil not a living artifact.
Anyways we are finally able to compile my LD_PRELOAD.

Lets put the file into our rootfs folder and then rebuild our newrootfs image(Yes everytime I place a new file I have to rebuild the rootfs)

and lets start our qemu VM and try this now
and now lets run the commands I always have to run after every startup
Code:
busybox-mipsel mount -t sysfs sysfs /sys
busybox-mipsel mdev -s
busybox-mipsel mkdir /mnt/jffs0/
busybox-mipsel mkdir /mnt/jffs1/
busybox-mipsel mount -t ext2 /dev/sdb /mnt/jffs0
busybox-mipsel mount -t ext2 /dev/sdc /mnt/jffs1
busybox-mipsel mount -t proc proc /proc
busybox-mipsel insmod /shmemipc_drv.ko
busybox-mipsel insmod /mmappokes.ko
busybox-mipsel mdev -s
and now its time to see if it worked