kbuild: de-duplicate fixdep usage

Backported from the linux kernel
commit e4aca4595005 ("kbuild: de-duplicate fixdep usage")

A lot of the kernels kbuild depend on that patch. Backport it and pull in
the 'rule_as_o_S'a rule as well. This might end up being unused but it
doesn't break anything and makes diffing the files easier.

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index 90aed14..10f31a5 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -241,14 +241,17 @@
 
 define rule_cc_o_c
 	$(call echo-cmd,checksrc) $(cmd_checksrc)			  \
-	$(call echo-cmd,cc_o_c) $(cmd_cc_o_c);				  \
+	$(call cmd_and_fixdep,cc_o_c)					  \
 	$(cmd_modversions)						  \
-	$(call echo-cmd,record_mcount)					  \
-	$(cmd_record_mcount)						  \
-	scripts/basic/fixdep $(depfile) $@ '$(call make-cmd,cc_o_c)' >    \
-	                                              $(dot-target).tmp;  \
-	rm -f $(depfile);						  \
-	mv -f $(dot-target).tmp $(dot-target).cmd
+	$(cmd_objtool)							  \
+	$(call echo-cmd,record_mcount) $(cmd_record_mcount)
+endef
+
+define rule_as_o_S
+	$(call cmd_and_fixdep,as_o_S)
+	$(call cmd,gen_ksymdeps)
+	$(call cmd,objtool)
+	$(call cmd,modversions_S)
 endef
 
 # Built-in and composite module parts