Skip to content

Commit 076b625

Browse files
tejlmandMaureenHelm
authored andcommitted
cmake: iar: remove linker optimization workaround
Remove linker optimization workaround for IAR linker as the new inheritance scheme allows empty linker values. Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
1 parent f04c9c0 commit 076b625

1 file changed

Lines changed: 6 additions & 18 deletions

File tree

cmake/linker/iar/linker_flags.cmake

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,12 @@
44

55
# Override the default CMake's IAR ILINK linker signature
66

7-
# The default behaviour of these new optimization flags for the linker
8-
# is to use the compiler optimization flags if no flags are set.
9-
# This does not work for IAR tools as there are no optimization flags
10-
# for the linker, and leaving the property empty causes it to be
11-
# filled with the compiler flags.
12-
# This workaround adds extra info to the map file only so should not
13-
# affect the generated code
14-
# To have this working properly, either the automatic use of compiler
15-
# flags must be removed, or we add some kind of dummy do nothing
16-
# command line option to the linker.
17-
# Either way, as this is causing an error right now, we use this
18-
# temporary workaround.
19-
20-
set_property(TARGET linker PROPERTY no_optimization --entry_list_in_address_order)
21-
set_property(TARGET linker PROPERTY optimization_debug --entry_list_in_address_order)
22-
set_property(TARGET linker PROPERTY optimization_speed --entry_list_in_address_order)
23-
set_property(TARGET linker PROPERTY optimization_size --entry_list_in_address_order)
24-
set_property(TARGET linker PROPERTY optimization_size_aggressive --entry_list_in_address_order)
7+
# IAR linker doesn't support dedicated linker optimization flags.
8+
set_property(TARGET linker PROPERTY no_optimization "")
9+
set_property(TARGET linker PROPERTY optimization_debug "")
10+
set_property(TARGET linker PROPERTY optimization_speed "")
11+
set_property(TARGET linker PROPERTY optimization_size "")
12+
set_property(TARGET linker PROPERTY optimization_size_aggressive "")
2513

2614
set_linker_property(TARGET linker PROPERTY undefined "--keep=")
2715

0 commit comments

Comments
 (0)