lib: Update stm32f4 code to support gcc -fwhole-program

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2019-07-23 23:55:19 -04:00
parent a31a6c1d6a
commit 5a02572001
3 changed files with 16 additions and 2 deletions

View File

@ -61,7 +61,8 @@ stm32f1.patch for the modifications.
The stm32f4 directory contains code from STMicroelectronics: The stm32f4 directory contains code from STMicroelectronics:
http://www.st.com/en/embedded-software/stm32cubef4.html http://www.st.com/en/embedded-software/stm32cubef4.html
version 1.24.0 (extracted 20190723). version 1.24.0 (extracted 20190723). It has been modified to compile
with gcc's LTO feature. See stm32f4.patch for the modifications.
The hub-ctrl directory contains code from: The hub-ctrl directory contains code from:
https://github.com/codazoda/hub-ctrl.c/ https://github.com/codazoda/hub-ctrl.c/

13
lib/stm32f4/stm32f4.patch Normal file
View File

@ -0,0 +1,13 @@
diff --git a/lib/stm32f4/system_stm32f4xx.c b/lib/stm32f4/system_stm32f4xx.c
index 11c18d1a..b94cfb2f 100644
--- a/lib/stm32f4/system_stm32f4xx.c
+++ b/lib/stm32f4/system_stm32f4xx.c
@@ -163,7 +163,7 @@ const uint8_t APBPrescTable[8] = {0, 0, 0, 0, 1, 2, 3, 4};
* @param None
* @retval None
*/
-void SystemInit(void)
+void __attribute__((externally_visible)) SystemInit(void)
{
/* FPU settings ------------------------------------------------------------*/
#if (__FPU_PRESENT == 1) && (__FPU_USED == 1)

View File

@ -163,7 +163,7 @@ const uint8_t APBPrescTable[8] = {0, 0, 0, 0, 1, 2, 3, 4};
* @param None * @param None
* @retval None * @retval None
*/ */
void SystemInit(void) void __attribute__((externally_visible)) SystemInit(void)
{ {
/* FPU settings ------------------------------------------------------------*/ /* FPU settings ------------------------------------------------------------*/
#if (__FPU_PRESENT == 1) && (__FPU_USED == 1) #if (__FPU_PRESENT == 1) && (__FPU_USED == 1)