kernel: extract __weak main() into independent file

To support arm-ds / armlink it is required that the weak main is located
in an object externally to the object using the weak symbol.

If the weak symbol is inside the object referring to it, then the weak
symbol will be used and this will result in
```
Error: L6200E: Symbol __ARM_use_no_argv multiply defined
    (by init.o and main.o).
```
as both the weak and strong symbols are used.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
This commit is contained in:
Torsten Rasmussen 2021-05-31 14:59:23 +02:00 committed by Anas Nashif
commit 25e1b12ec0
3 changed files with 29 additions and 6 deletions

View file

@ -18,6 +18,7 @@ target_link_libraries(kernel INTERFACE ${libkernel})
else()
list(APPEND kernel_files
main_weak.c
banner.c
device.c
errno.c