cmake: Fix the -Wl,--print-memory-usage compatibility test
cmake: Fix the -Wl,--print-memory-usage compatibility test

-Wl,--print-memory-usage is a relatively new LD feature (2015) and is
not supported by the espressif toolchain. Unfortunately the toolchain
compatibility test was broken as it was not using the flag when
linking.

The root cause lies in how we test LD compatibility and this same fix
must be applied again in e.g. target_ld_options().

This patch fixes
https://github.com/zephyrproject-rtos/zephyr/issues/5458

Signed-off-by: Sebastian Bøe <edee888afd63e94916688495334700803eba20a0@nordicsemi.no>

zephyrproject-rtos/zephyr,ldts/zephyr,ldts/zephyr,mbolivar/zephyr,kraj/zephyr,GiulianoFranchetto/zephyr,zephyriot/zephyr,zephyrproject-rtos/zephyr,galak/zephyr,galak/zephyr,nashif/zephyr,mbolivar/zephyr,nashif/zephyr,punitvara/zephyr,galak/zephyr,Vudentz/zephyr,aceofall/zephyr-iotos,mbolivar/zephyr,aceofall/zephyr-iotos,kraj/zephyr,zephyriot/zephyr,GiulianoFranchetto/zephyr,mbolivar/zephyr,kraj/zephyr,GiulianoFranchetto/zephyr,ldts/zephyr,ldts/zephyr,Vudentz/zephyr,punitvara/zephyr,aceofall/zephyr-iotos,GiulianoFranchetto/zephyr,zephyriot/zephyr,zephyriot/zephyr,nashif/zephyr,zephyriot/zephyr,explora26/zephyr,finikorg/zephyr,explora26/zephyr,punitvara/zephyr,galak/zephyr,kraj/zephyr,explora26/zephyr,ldts/zephyr,zephyrproject-rtos/zephyr,nashif/zephyr,punitvara/zephyr,explora26/zephyr,zephyrproject-rtos/zephyr,kraj/zephyr,Vudentz/zephyr,nashif/zephyr,finikorg/zephyr,aceofall/zephyr-iotos,mbolivar/zephyr,galak/zephyr,aceofall/zephyr-iotos,finikorg/zephyr,Vudentz/zephyr,zephyrproject-rtos/zephyr,Vudentz/zephyr,finikorg/zephyr,Vudentz/zephyr,explora26/zephyr,punitvara/zephyr,GiulianoFranchetto/zephyr,finikorg/zephyr