Skip to content

Conversation

@cyhcyhgo
Copy link

Summary

This PR fixes a build failure encountered when compiling KhiCAS (specifically the embedded MicroPython 1.12 submodule) on modern build environments (e.g., GitHub Actions ubuntu-latest with recent gcc-arm-none-eabi).

The Issue

Newer versions of GCC are stricter and produce warnings for legacy code that were previously silent. Since the build configuration treats warnings as errors (or defaults to strict mode), these harmless warnings cause the compilation to abort immediately.

Example Error Log:

../py/compile.c:1127:27: note: limit is 2147483647 bytes, but argument is 4294967295
cc1: all warnings being treated as errors
make[2]: *** [../py/mkrules.mk:47: build/py/compile.o] Error 1
make[2]: Leaving directory '/home/runner/work/Upsilon-External/Upsilon-External/apps/KhiCAS/src/micropython-1.12/numworks'
arm-none-eabi-ar: `u' modifier ignored since `D' is the default (see `U')
arm-none-eabi-ar: build/py/compile.o: No such file or directory
arm-none-eabi-ranlib: 'libmicropy.a': No such file
/bin/cp: cannot stat 'libmicropy.a': No such file or directory
make[1]: *** [Makefile:78: src/lib/libmicropy.a] Error 1
make[1]: Leaving directory '/home/runner/work/Upsilon-External/Upsilon-External/apps/KhiCAS'
make: *** [Makefile:11: KhiCAS_rebuild] Error 2
Error: Process completed with exit code 2.

The Fix

I have modified apps/KhiCAS/src/micropython-1.12/py/mkrules.mk to append the -Wno-error flag to CFLAGS. This allows the compiler to report warnings without stopping the build process, ensuring that the .elf binary can be generated successfully.

Verification

  • Verified that KhiCAS compiles successfully with this change in GitHub Actions.
  • Confirmed that the resulting binary functions correctly.

Copy link
Member

@Yaya-Cout Yaya-Cout left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, that will help for updating KhiCAS ! The only problem left I had was a soft/hard floats missmatch, but that's another issue

@cyhcyhgo
Copy link
Author

LGTM, that will help for updating KhiCAS ! The only problem left I had was a soft/hard floats missmatch, but that's another issue

I use GitHub Action for compile. It doesn't have soft/hard floats missmatch error. Please see this.

arm-none-eabi-readelf -A KhiCAS.elf
Attribute Section: aeabi
File Attributes
  Tag_CPU_name: "7E-M"
  Tag_CPU_arch: v7E-M
  Tag_CPU_arch_profile: Microcontroller
  Tag_THUMB_ISA_use: Thumb-2
  Tag_FP_arch: FPv5/FP-D16 for ARMv8
  Tag_ABI_PCS_wchar_t: 4
  Tag_ABI_FP_denormal: Needed
  Tag_ABI_FP_exceptions: Needed
  Tag_ABI_FP_number_model: IEEE 754
  Tag_ABI_align_needed: 8-byte
  Tag_ABI_enum_size: small
  Tag_ABI_HardFP_use: SP only
  Tag_ABI_VFP_args: VFP registers
  Tag_ABI_optimization_goals: Aggressive Size
  Tag_CPU_unaligned_access: v6

@cyhcyhgo
Copy link
Author

I figure out how to solve the error in this pr when compiling KhiCAS (Maybe not in this pr, but extists for a long time). You need to add this function in main.c, in extern C:

int __ssputws_r(void * _reent, const wchar_t * wstr, void * file) {
    return 0; 
} 

This is a dummy function to avoid linking error. But I don't know if this function is truly used

@Yaya-Cout
Copy link
Member

Thanks, I'll try doing that next time

@Yaya-Cout Yaya-Cout merged commit 371f782 into UpsilonNumworks:master Dec 14, 2025
10 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants