/* * ARMv7 build options for gcc */ CPU buildOptions { BUILDOPTIONS defaultBuildOptionsForARMv7 { /* * Common flags for C and C++ compiling */ // Produce debugging information COMMONFLAGS = "-g"; // All warnings on //COMMONFLAGS = "-Wall"; COMMONFLAGS = "-Wno-unused-but-set-variable"; // Except unused variables COMMONFLAGS = "-Wmissing-field-initializers"; // Struct initialized with incorrect number of fiels COMMONFLAGS = "-mcpu=cortex-m4"; // Compile for cortex-m4 COMMONFLAGS = "-mthumb"; // Thumb instruction set COMMONFLAGS = "-mfloat-abi=soft"; // Floating point numbers are computed in software COMMONFLAGS = "-mfpu=fpv4-sp-d16"; // Truly obscure option to set. Check http://stackoverflow.com/questions/19464556/how-to-link-gcc-options-to-the-arm-mcu-fpu-datasheet COMMONFLAGS = "-nostartfiles"; // Default startfiles (crt0.c) are not used COMMONFLAGS = "-fno-builtin"; // Do not used built in gcc functions CFLAGS = "--specs=nosys.specs"; // COMMONFLAGS = "-fno-exceptions"; // No exceptions managed COMMONFLAGS = "-nostdlib"; // Do not used implicitely the standard libraries to link COMMONFLAGS = "-ffunction-sections"; // Each function is put in its own section. Required to deleted unused code COMMONFLAGS = "-fdata-sections"; // Each data is put in its own section. Required to deleted unused data //CFLAGS = "-fpermissive"; // pour les sources d'it /* * C++ compiler flags */ CPPFLAGS = "-fno-rtti"; // No information for runtime (run time type information) - reduce exe size CPPFLAGS = "-felide-constructors"; // Optimization to omit creating temporary object when used to initialize another object CPPFLAGS = "-fno-threadsafe-statics"; // No thread safe init of local static variables - reduce code size CPPFLAGS = "-fno-use-cxa-get-exception-ptr"; // Don't use the __cxa_get_exception_ptr runtime routine (no exception anyway) CPPFLAGS = "-fno-enforce-eh-specs"; // Don't generate code to check for violation of exception specifications at runtime (no exception anyway) /* * Assembler flags */ ASFLAGS = "-g"; // Produce debugging information ASFLAGS = "-Wall"; // All warnings on ASFLAGS = "-mcpu=cortex-m4"; // Assemble for cortex-m4 ASFLAGS = "-mthumb"; // Thumb instruction set ASFLAGS = "--fatal-warnings"; // A warning is an error ASFLAGS = "-mfloat-abi=soft"; // Floating point numbers are computed in software ASFLAGS = "-mfpu=fpv4-sp-d16"; // Truly obscure option to set. // Check http://stackoverflow.com/questions/19464556/how-to-link-gcc-options-to-the-arm-mcu-fpu-datasheet LDFLAGS = "--fatal-warnings"; // A warning is an error LDFLAGS = "--warn-common"; // Warn when a common symbol is combined with another common symbol LDFLAGS = "--no-undefined"; // Report unresolved symbol references LDFLAGS = "--gc-sections"; // Remove unused sections. Works with -ffunction-sections and -fdata-sections, see above }; };