mirror of https://github.com/ARMmbed/mbed-os.git
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
parent
516153e033
commit
3e3bee4a21
|
@ -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",
|
||||
|
|
|
@ -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",
|
||||
|
|
Loading…
Reference in New Issue