Skip to content

Commit 18c167f

Browse files
Shaohua LiIngo Molnar
authored andcommitted
ftrace, ia64: make recordmcount distinct module compile
In IA64, module build and kernel build use different option. Make recordmcount.pl differentiate the two cases. Signed-off-by: Shaohua Li <shaohua.li@intel.com> Acked-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Steven Rostedt <srostedt@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
1 parent 173ed24 commit 18c167f

2 files changed

Lines changed: 10 additions & 9 deletions

File tree

‎scripts/Makefile.build‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,13 @@ endif
112112
# ---------------------------------------------------------------------------
113113

114114
# Default is built-in, unless we know otherwise
115-
modkern_cflags := $(CFLAGS_KERNEL)
115+
modkern_cflags = $(if $(part-of-module), $(CFLAGS_MODULE), $(CFLAGS_KERNEL))
116116
quiet_modtag := $(empty) $(empty)
117117

118-
$(real-objs-m) : modkern_cflags := $(CFLAGS_MODULE)
119-
$(real-objs-m:.o=.i) : modkern_cflags := $(CFLAGS_MODULE)
120-
$(real-objs-m:.o=.s) : modkern_cflags := $(CFLAGS_MODULE)
121-
$(real-objs-m:.o=.lst): modkern_cflags := $(CFLAGS_MODULE)
118+
$(real-objs-m) : part-of-module := y
119+
$(real-objs-m:.o=.i) : part-of-module := y
120+
$(real-objs-m:.o=.s) : part-of-module := y
121+
$(real-objs-m:.o=.lst): part-of-module := y
122122

123123
$(real-objs-m) : quiet_modtag := [M]
124124
$(real-objs-m:.o=.i) : quiet_modtag := [M]
@@ -215,7 +215,8 @@ endif
215215
ifdef CONFIG_FTRACE_MCOUNT_RECORD
216216
cmd_record_mcount = perl $(srctree)/scripts/recordmcount.pl "$(ARCH)" \
217217
"$(if $(CONFIG_64BIT),64,32)" \
218-
"$(OBJDUMP)" "$(OBJCOPY)" "$(CC)" "$(LD)" "$(NM)" "$(RM)" "$(MV)" "$(@)";
218+
"$(OBJDUMP)" "$(OBJCOPY)" "$(CC)" "$(LD)" "$(NM)" "$(RM)" "$(MV)" \
219+
"$(if $(part-of-module),1,0)" "$(@)";
219220
endif
220221

221222
define rule_cc_o_c

‎scripts/recordmcount.pl‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,14 +100,14 @@
100100

101101
my $V = '0.1';
102102

103-
if ($#ARGV < 6) {
104-
print "usage: $P arch objdump objcopy cc ld nm rm mv inputfile\n";
103+
if ($#ARGV < 7) {
104+
print "usage: $P arch objdump objcopy cc ld nm rm mv is_module inputfile\n";
105105
print "version: $V\n";
106106
exit(1);
107107
}
108108

109109
my ($arch, $bits, $objdump, $objcopy, $cc,
110-
$ld, $nm, $rm, $mv, $inputfile) = @ARGV;
110+
$ld, $nm, $rm, $mv, $is_module, $inputfile) = @ARGV;
111111

112112
# Acceptable sections to record.
113113
my %text_sections = (

0 commit comments

Comments
 (0)