This patch makes sure that we are using correct target specific ar and objcopy executables.
I have added logic to extract ar and objcopy from CC compiler name in case of arm and aarch64 targets.
In case of android this is overidden by android specific logic implemented in makefile.rules.
This looks like it duplicates the replace_cc_with logic in the Android specific-code. Please move the macro to a common location and then use it here. I'd like to avoid adding more cryptic make code.
In fact, the android specific definitions can probably be removed after this goes in (we can do that as a followup if you don't have the ability to test it).