Any better idea to replace arm-none-eabi-gcc lib functions to lib-agbcc?

It is problems encountered when I’m trying to build (via EventAssembler) FE6-SkillLite after introducing a div operation:

int RandNextExts(int max, int time)
{
    return NextRNExts(time) / (UINT16_MAX / max);
}

Then arm-none-eabi-gcc told me:

Apparently it is a problem related to eabi lib functions.

I am currently using this alternative as follows:

/* arm-none-eabi-gcc lib function */
int __aeabi_idiv(int a, int b)
{
    /* agbcc lib */
    return __divsi3(a, b);
}

That may not be a better idea and I tried to refer to decomp project which may firstly comppile %.c ==> %.s via non-eabi-cpp and then make %.s ==> %.o but failed.
Is there any better idea for this problem?

this might be a dumb question, but is including common-chax.h from within a folder that is quite separate from the folder that common-chax.h is in without other path identifiers an issue?

in eabi-2-agbcc.c, there is a line #include common-chax.h but this file is found in root/include/

of course you might have set up a toolchain or macro where #include automatically points to that folder idk I might be dumb

including common-chax.h from within a folder that is quite separate from the folder

This is not matter, you can config gcc options “-I” to identify include path.

See more via this.

1 Like

I have gave up. Just replace div operation to Div() function call:

image