Conditional Linker script
as far as I know gcc linker cannot read defines made in header, but you can add symbol definition to you linker using defsym
example :
in you project properties > C/C++ Build > Settings > Tools Sttings (tab) > MCU GCC Linker > Miscellaneous > Linker flags add
-Wl,--defsym,stack_size=0x2000
and in my linker I add this
stack_size = DEFINED(stack_size) ? stack_size : 0x400 ;