diff --git a/builder/frameworks/realtek-ambz-sdk.py b/builder/frameworks/realtek-ambz-sdk.py index 7a4c347..d91f08d 100644 --- a/builder/frameworks/realtek-ambz-sdk.py +++ b/builder/frameworks/realtek-ambz-sdk.py @@ -238,7 +238,8 @@ env.Append( "_wps", "_p2p", "_dct", - "_rtlstd", + # use lib_rtlstd.a without some __aeabi functions + "_rtlstd_patch", "m", "c", "nosys", diff --git a/builder/utils.py b/builder/utils.py index b7cd086..8140fff 100644 --- a/builder/utils.py +++ b/builder/utils.py @@ -49,6 +49,7 @@ def env_add_defaults(env, family_name: str, sdk_name: str): ], LIBPATH=[ "$LD_DIR", + "$FIXUPS_DIR", ], CPPDEFINES=[ ("LIBRETUYA", "1"), diff --git a/platform/realtek-ambz/fixups/lib_rtlstd_patch.a b/platform/realtek-ambz/fixups/lib_rtlstd_patch.a new file mode 100644 index 0000000..59a85f2 Binary files /dev/null and b/platform/realtek-ambz/fixups/lib_rtlstd_patch.a differ diff --git a/platform/realtek-ambz/fixups/lib_rtlstd_patch.md b/platform/realtek-ambz/fixups/lib_rtlstd_patch.md new file mode 100644 index 0000000..fb20c12 --- /dev/null +++ b/platform/realtek-ambz/fixups/lib_rtlstd_patch.md @@ -0,0 +1,14 @@ +# lib_rtlstd_patch.a + +``` +arm-none-eabi-gcc-ar xo lib_rtlstd.a +arm-none-eabi-objcopy -N __aeabi_fsub rtl_eabi_cast_ram.o +arm-none-eabi-objcopy -N __aeabi_fadd rtl_eabi_cast_ram.o +arm-none-eabi-objcopy -N __aeabi_ui2f rtl_eabi_cast_ram.o +arm-none-eabi-objcopy -N __aeabi_i2f rtl_eabi_cast_ram.o +arm-none-eabi-objcopy --strip-debug --strip-unneeded ram_libc.o +arm-none-eabi-objcopy --strip-debug --strip-unneeded ram_libgloss_retarget.o +arm-none-eabi-objcopy --strip-debug --strip-unneeded rtl_eabi_cast_ram.o +arm-none-eabi-objcopy --strip-debug --strip-unneeded rtl_math_ram.o +arm-none-eabi-gcc-ar qs lib_rtlstd_patch.a *.o +```