| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
- Added `-Wa,-I$(BASE_STARTUP)` to CPPFLAGS to ensure the assembler can locate `startup_common.s` from the device-specific startup files. - Prevents "can't open startup_common.s for reading" errors during build. - This ensures STM32F1xx startup files compile correctly without modifying the source tree.
| Back | FazBrowse Home | New Git URL |
Title
Fix: Add assembler include path for STM32 startup files
Description
This pull request resolves a build issue related to STM32F1xx and other devices startup files.
Problem
When building the project, the following error occurs:
The startup assembly files (e.g., STM32F103xB.s) include startup_common.s via:
Even though CPPFLAGS already contains -I$(BASE_STARTUP), this only affects the C/C++ compiler. The assembler (g++ -c <file>.s) does not automatically use the -I paths specified in CPPFLAGS for resolving .include directives. As a result, the assembler cannot find startup_common.s.
Solution
Added -Wa,-I$(BASE_STARTUP) to CPPFLAGS in make/common.mk.
No changes to the source tree or startup files are required.
Benefits
Verification
This change ensures both the C/C++ compiler and assembler correctly find include paths, resulting in a reliable and reproducible build.
System
Linux bbuyukyuksel-VirtualBox 6.8.0-51-generic #52-Ubuntu SMP PREEMPT_DYNAMIC Thu Dec 5 13:09:44 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
arm-st-eabi-g++ (crosstool-NG 1.28.0_rc1) 15.2.0
Copyright (C) 2025 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.