From patchwork Fri Sep 4 05:30:06 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amerigo Wang X-Patchwork-Id: 45518 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n845Urr8023343 for ; Fri, 4 Sep 2009 05:30:53 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932520AbZIDFaQ (ORCPT ); Fri, 4 Sep 2009 01:30:16 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932536AbZIDFaQ (ORCPT ); Fri, 4 Sep 2009 01:30:16 -0400 Received: from mx1.redhat.com ([209.132.183.28]:27836 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932520AbZIDFaP (ORCPT ); Fri, 4 Sep 2009 01:30:15 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n845U8Y9031708; Fri, 4 Sep 2009 01:30:08 -0400 Received: from localhost.localdomain (dhcp-65-141.nay.redhat.com [10.66.65.141]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n845U6NY029173; Fri, 4 Sep 2009 01:30:06 -0400 Date: Fri, 4 Sep 2009 01:30:06 -0400 From: Amerigo Wang To: linux-kernel@vger.kernel.org Cc: akpm@linux-foundation.org, Sam Ravnborg , Amerigo Wang , linux-kbuild@vger.kernel.org Message-Id: <20090904053233.4396.85814.sendpatchset@localhost.localdomain> Subject: [RFC Patch] kbuild: implement "make foo.s_c" X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org This patch implements "make path/to/file.s_c", where "file.s_c" is a file contains both asm and C code, this is helpful for people to do debugging at asm level. Currently, we have "make path/to/file.s", but it sucks, the asm code generated by it is not human-friendly. Compare "make kernel/spinlock.s" with "make kernel/spinlock.s_c", as an example. Cc: Sam Ravnborg Signed-off-by: WANG Cong --- -- To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/.gitignore b/.gitignore index b93fb7e..119e00a 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,7 @@ *.o.* *.a *.s +*.s_c *.ko *.so *.so.dbg diff --git a/Makefile b/Makefile index 25c615e..9024b42 100644 --- a/Makefile +++ b/Makefile @@ -1216,7 +1216,7 @@ clean: archclean $(clean-dirs) @find . $(RCS_FIND_IGNORE) \ \( -name '*.[oas]' -o -name '*.ko' -o -name '.*.cmd' \ -o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \ - -o -name '*.symtypes' -o -name 'modules.order' \ + -o -name '*.s_c' -o -name '*.symtypes' -o -name 'modules.order' \ -o -name 'Module.markers' -o -name '.tmp_*.o.*' \ -o -name '*.gcno' \) -type f -print | xargs rm -f @@ -1520,6 +1520,8 @@ endif $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) %.s: %.S prepare scripts FORCE $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) +%.s_c: %.c prepare scripts FORCE + $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) %.o: %.S prepare scripts FORCE $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) %.symtypes: %.c prepare scripts FORCE diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 5c4b7a4..e5763ac 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -148,6 +148,11 @@ cmd_cc_s_c = $(CC) $(c_flags) -fverbose-asm -S -o $@ $< $(obj)/%.s: $(src)/%.c FORCE $(call if_changed_dep,cc_s_c) +cmd_cc_s_c_c = $(OBJDUMP) -d -S $< >$@ + +$(obj)/%.s_c: $(src)/%.o FORCE + $(call if_changed,cc_s_c_c) + quiet_cmd_cc_i_c = CPP $(quiet_modtag) $@ cmd_cc_i_c = $(CPP) $(c_flags) -o $@ $<