GCC: Add the -u flag to keep the main() symbol

This fixes the undefined reference to 'main' that arose after adding
the "-flto" flag to compilation.

This was the case for combined "-Wl,--wrap,main" and "-flto" flags.
pull/11856/head
Filip Jagodzinski 2019-11-27 15:02:06 +01:00
parent 516153e033
commit 3e3bee4a21
2 changed files with 2 additions and 2 deletions

View File

@ -12,7 +12,7 @@
"ld": ["-Wl,--gc-sections", "-Wl,--wrap,main", "-Wl,--wrap,_malloc_r",
"-Wl,--wrap,_free_r", "-Wl,--wrap,_realloc_r", "-Wl,--wrap,_memalign_r",
"-Wl,--wrap,_calloc_r", "-Wl,--wrap,exit", "-Wl,--wrap,atexit",
"-Wl,-n"]
"-Wl,-n", "-u main"]
},
"ARMC6": {
"common": ["-c", "--target=arm-arm-none-eabi", "-mthumb", "-Os",

View File

@ -12,7 +12,7 @@
"ld": ["-Wl,--gc-sections", "-Wl,--wrap,main", "-Wl,--wrap,_malloc_r",
"-Wl,--wrap,_free_r", "-Wl,--wrap,_realloc_r", "-Wl,--wrap,_memalign_r",
"-Wl,--wrap,_calloc_r", "-Wl,--wrap,exit", "-Wl,--wrap,atexit",
"-Wl,-n"]
"-Wl,-n", "-u main"]
},
"ARMC6": {
"common": ["-c", "--target=arm-arm-none-eabi", "-mthumb", "-Oz",