Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934681AbXHIFH3 (ORCPT ); Thu, 9 Aug 2007 01:07:29 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753316AbXHIFHV (ORCPT ); Thu, 9 Aug 2007 01:07:21 -0400 Received: from lemon.ertos.nicta.com.au ([203.143.174.143]:56901 "EHLO lemon.gelato.unsw.edu.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752049AbXHIFHU (ORCPT ); Thu, 9 Aug 2007 01:07:20 -0400 X-Greylist: delayed 3089 seconds by postgrey-1.27 at vger.kernel.org; Thu, 09 Aug 2007 01:07:19 EDT Date: Thu, 09 Aug 2007 14:15:38 +1000 Message-ID: <87fy2twdg5.wl%peterc@gelato.unsw.edu.au> From: Peter Chubb To: akpm@google.com, linux-kernel@vger.kernel.org Subject: Fix compilation with gcc 4.2 User-Agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (=?ISO-8859-1?Q?Shij=F2?=) APEL/10.7 XEmacs/21.4 (patch 20) (Double Solitaire) (ia64-linux-gnu) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-SA-Do-Not-Run: Yes X-SA-Exim-Connect-IP: 203.143.160.117 X-SA-Exim-Mail-From: peter.chubb@nicta.com.au X-SA-Exim-Scanned: No (on lemon.gelato.unsw.edu.au); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3230 Lines: 81 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. Signed-off-by: Peter Chubb Index: linux-2.6-git/kernel/profile.c =================================================================== --- linux-2.6-git.orig/kernel/profile.c 2007-08-09 12:10:19.921216500 +1000 +++ linux-2.6-git/kernel/profile.c 2007-08-09 12:10:26.061162039 +1000 @@ -199,11 +199,11 @@ EXPORT_SYMBOL_GPL(register_timer_hook); EXPORT_SYMBOL_GPL(unregister_timer_hook); EXPORT_SYMBOL_GPL(task_handoff_register); EXPORT_SYMBOL_GPL(task_handoff_unregister); +EXPORT_SYMBOL_GPL(profile_event_register); +EXPORT_SYMBOL_GPL(profile_event_unregister); #endif /* CONFIG_PROFILING */ -EXPORT_SYMBOL_GPL(profile_event_register); -EXPORT_SYMBOL_GPL(profile_event_unregister); #ifdef CONFIG_SMP /* Index: linux-2.6-gie/kernel/kprobes.c =================================================================== --- linux-2.6-git.orig/kernel/kprobes.c 2007-08-09 12:14:48.898830198 +1000 +++ linux-2.6-git/kernel/kprobes.c 2007-08-09 14:09:50.180322576 +1000 @@ -1063,6 +1063,8 @@ EXPORT_SYMBOL_GPL(register_kprobe); EXPORT_SYMBOL_GPL(unregister_kprobe); EXPORT_SYMBOL_GPL(register_jprobe); EXPORT_SYMBOL_GPL(unregister_jprobe); -EXPORT_SYMBOL_GPL(jprobe_return); + +#ifdef CONFIG_KPROBES EXPORT_SYMBOL_GPL(register_kretprobe); EXPORT_SYMBOL_GPL(unregister_kretprobe); +#endif Index: linux-2.6-git/drivers/acpi/resources/rsxface.c =================================================================== --- linux-2.6-git.orig/drivers/acpi/resources/rsxface.c 2007-08-09 13:06:59.040346772 +1000 +++ linux-2.6-git/drivers/acpi/resources/rsxface.c 2007-08-09 13:12:03.125801491 +1000 @@ -474,8 +474,6 @@ acpi_rs_match_vendor_resource(struct acp return (AE_CTRL_TERMINATE); } -ACPI_EXPORT_SYMBOL(acpi_rs_match_vendor_resource) - /******************************************************************************* * * FUNCTION: acpi_walk_resources -- Dr Peter Chubb http://www.gelato.unsw.edu.au peterc@gelato.unsw.edu.au http://www.ertos.nicta.com.au ERTOS within National ICT Australia - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/