Skip to content

Commit cd5bfea

Browse files
Peter ChubbLinus Torvalds
authored andcommitted
fix compilation with gcc 4.2
gcc-4.2 is a lot more picky about its symbol handling. EXPORT_SYMBOL no longer works on symbols that are undefined or defined with static scope. For example, with CONFIG_PROFILE off, I see: kernel/profile.c:206: error: __ksymtab_profile_event_unregister causes a section type conflict kernel/profile.c:205: error: __ksymtab_profile_event_register causes a section type conflict This patch moves the EXPORTs inside the #ifdef CONFIG_PROFILE, so we only try to export symbols that are defined. Also, in kernel/kprobes.c there's an EXPORT_SYMBOL_GPL() for jprobes_return, which if CONFIG_JPROBES is undefined is a static inline and gives the same error. And in drivers/acpi/resources/rsxface.c, there's an ACPI_EXPORT_SYMBOPL() for a static symbol. If it's static, it's not accessible from outside the compilation unit, so should bot be exported. These three changes allow building a zx1_defconfig kernel with gcc 4.2 on IA64. [akpm@linux-foundation.org: export jpobe_return properly] Signed-off-by: Peter Chubb <peterc@gelato.unsw.edu.au> Cc: Prasanna S Panchamukhi <prasanna@in.ibm.com> Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com> Cc: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com> Cc: "Luck, Tony" <tony.luck@intel.com> Cc: Len Brown <lenb@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 6ddfca9 commit cd5bfea

3 files changed

Lines changed: 7 additions & 4 deletions

File tree

‎drivers/acpi/resources/rsxface.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -474,8 +474,6 @@ acpi_rs_match_vendor_resource(struct acpi_resource *resource, void *context)
474474
return (AE_CTRL_TERMINATE);
475475
}
476476

477-
ACPI_EXPORT_SYMBOL(acpi_rs_match_vendor_resource)
478-
479477
/*******************************************************************************
480478
*
481479
* FUNCTION: acpi_walk_resources

‎kernel/kprobes.c‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1063,6 +1063,11 @@ EXPORT_SYMBOL_GPL(register_kprobe);
10631063
EXPORT_SYMBOL_GPL(unregister_kprobe);
10641064
EXPORT_SYMBOL_GPL(register_jprobe);
10651065
EXPORT_SYMBOL_GPL(unregister_jprobe);
1066+
#ifdef CONFIG_KPROBES
10661067
EXPORT_SYMBOL_GPL(jprobe_return);
1068+
#endif
1069+
1070+
#ifdef CONFIG_KPROBES
10671071
EXPORT_SYMBOL_GPL(register_kretprobe);
10681072
EXPORT_SYMBOL_GPL(unregister_kretprobe);
1073+
#endif

‎kernel/profile.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,11 +199,11 @@ EXPORT_SYMBOL_GPL(register_timer_hook);
199199
EXPORT_SYMBOL_GPL(unregister_timer_hook);
200200
EXPORT_SYMBOL_GPL(task_handoff_register);
201201
EXPORT_SYMBOL_GPL(task_handoff_unregister);
202+
EXPORT_SYMBOL_GPL(profile_event_register);
203+
EXPORT_SYMBOL_GPL(profile_event_unregister);
202204

203205
#endif /* CONFIG_PROFILING */
204206

205-
EXPORT_SYMBOL_GPL(profile_event_register);
206-
EXPORT_SYMBOL_GPL(profile_event_unregister);
207207

208208
#ifdef CONFIG_SMP
209209
/*

0 commit comments

Comments
 (0)