Patched the LUFA build system to work around a GCC code generation bug in newer toolc...
authorDean Camera <dean@fourwalledcubicle.com>
Tue, 26 Aug 2014 11:18:59 +0000 (21:18 +1000)
committerDean Camera <dean@fourwalledcubicle.com>
Tue, 26 Aug 2014 11:18:59 +0000 (21:18 +1000)
LUFA/Build/lufa_build.mk
LUFA/DoxygenPages/ChangeLog.txt
LUFA/StudioIntegration/lufa_toolchain.xml

index 1bdfa1d..b9b144a 100644 (file)
@@ -199,6 +199,12 @@ ifeq ($(LINKER_RELAXATIONS), Y)
 BASE_CC_FLAGS += -mrelax
 endif
 
 BASE_CC_FLAGS += -mrelax
 endif
 
+# This flag is required for bootloaders as GCC will emit invalid jump table
+# assembly code for devices with large amounts of flash; the jump table target
+# is extracted from FLASH without using the correct ELPM instruction, resulting
+# in a pseudo-random jump target.
+BASE_CC_FLAGS += -fno-jump-tables
+
 # Additional language specific compiler flags
 BASE_C_FLAGS   := -x c -O$(OPTIMIZATION) -std=$(C_STANDARD) -Wstrict-prototypes
 BASE_CPP_FLAGS := -x c++ -O$(OPTIMIZATION) -std=$(CPP_STANDARD)
 # Additional language specific compiler flags
 BASE_C_FLAGS   := -x c -O$(OPTIMIZATION) -std=$(C_STANDARD) -Wstrict-prototypes
 BASE_CPP_FLAGS := -x c++ -O$(OPTIMIZATION) -std=$(CPP_STANDARD)
index 78d3abd..3eab8b0 100644 (file)
@@ -21,6 +21,8 @@
   *   - Fixed possible infinite loop in the control endpoint stream write function (thanks to Clayton Knight)
   *   - Fixed missing HID report ID prefix on HID class driver GetReport request responses (thanks to Bert van Hall)
   *   - Fixed incorrect XMEGA USB controller clock division factory for non-Full Speed operation (thanks to Bert van Hall)
   *   - Fixed possible infinite loop in the control endpoint stream write function (thanks to Clayton Knight)
   *   - Fixed missing HID report ID prefix on HID class driver GetReport request responses (thanks to Bert van Hall)
   *   - Fixed incorrect XMEGA USB controller clock division factory for non-Full Speed operation (thanks to Bert van Hall)
+  *   - Patched the LUFA build system to work around a GCC code generation bug in newer toolchains when building for larger
+  *     FLASH memory devices (thanks to demultiplexer)
   *  - Library Applications:
   *   - Fixed spurious 0xFE USART byte sent in the USBtoSerial project when the baud rate is changed (thanks to Carl Kjeldsen)
   *   - Fixed blocking USART reads causing low throughput on slow baud rates in the USBtoSerial project (thanks to Nevada Smith)
   *  - Library Applications:
   *   - Fixed spurious 0xFE USART byte sent in the USBtoSerial project when the baud rate is changed (thanks to Carl Kjeldsen)
   *   - Fixed blocking USART reads causing low throughput on slow baud rates in the USBtoSerial project (thanks to Nevada Smith)
index 04863cf..031c8a2 100644 (file)
@@ -20,7 +20,7 @@
                                <toolchain-config name="avrgcc.compiler.optimization.OtherFlags" value="-fdata-sections" toolchain="avrgcc"/>\r
                                <toolchain-config name="avrgcc.compiler.optimization.PrepareFunctionsForGarbageCollection" value="True" toolchain="avrgcc"/>\r
                                <toolchain-config name="avrgcc.compiler.warnings.AllWarnings" value="True" toolchain="avrgcc"/>\r
                                <toolchain-config name="avrgcc.compiler.optimization.OtherFlags" value="-fdata-sections" toolchain="avrgcc"/>\r
                                <toolchain-config name="avrgcc.compiler.optimization.PrepareFunctionsForGarbageCollection" value="True" toolchain="avrgcc"/>\r
                                <toolchain-config name="avrgcc.compiler.warnings.AllWarnings" value="True" toolchain="avrgcc"/>\r
-                               <toolchain-config name="avrgcc.compiler.miscellaneous.OtherFlags" value="-mrelax -std=gnu99 -fno-strict-aliasing" toolchain="avrgcc"/>\r
+                               <toolchain-config name="avrgcc.compiler.miscellaneous.OtherFlags" value="-mrelax -std=gnu99 -fno-strict-aliasing -fno-jump-tables" toolchain="avrgcc"/>\r
                                <toolchain-config name="avrgcc.linker.optimization.GarbageCollectUnusedSections" value="True" toolchain="avrgcc"/>\r
                                <toolchain-config name="avrgcc.linker.optimization.RelaxBranches" value="True" toolchain="avrgcc"/>\r
                        </module>\r
                                <toolchain-config name="avrgcc.linker.optimization.GarbageCollectUnusedSections" value="True" toolchain="avrgcc"/>\r
                                <toolchain-config name="avrgcc.linker.optimization.RelaxBranches" value="True" toolchain="avrgcc"/>\r
                        </module>\r