From: "Jun'ichi Nomura" <j-nomura@ce.jp.nec.com>
To: Greg KH <gregkh@suse.de>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] kobject_uevent CONFIG_SYSFS=n build fix
Date: Tue, 14 Mar 2006 11:11:00 -0500 [thread overview]
Message-ID: <4416EB14.50306@ce.jp.nec.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1224 bytes --]
Hello,
In 2.6.16-rc6 (probably in earlier rc as well),
following build error occurs with CONFIG_SYSFS=n.
kernel/built-in.o(.data+0x1d40): undefined reference to `uevent_helper'
lib/lib.a(kobject_uevent.o)(.text+0x5c1): In function `kobject_uevent':
/build/rc6/source/lib/kobject_uevent.c:152: undefined reference to `uevent_seqnum'
lib/lib.a(kobject_uevent.o)(.text+0x5d0):/build/rc6/source/lib/kobject_uevent.c:152: undefined reference to `uevent_seqnum'
lib/lib.a(kobject_uevent.o)(.text+0x901):/build/rc6/source/lib/kobject_uevent.c:182: undefined reference to `uevent_helper'
lib/lib.a(kobject_uevent.o)(.text+0x910):/build/rc6/source/lib/kobject_uevent.c:182: undefined reference to `uevent_helper'
This seems to be caused by mismatch of build condition.
uevent_seqnum and uevent_helper are conditional to CONFIG_SYSFS.
While they are referenced if CONFIG_HOTPLUG (and CONFIG_NET) is enabled.
Attached patch consolidates them to CONFIG_HOTPLUG && CONFIG_NET.
I tried with (!CONFIG_NET && CONFIG_SYSFS) and
(CONFIG_NET && !CONFIG_SYSFS).
Both built ok.
So I think it doesn't conflict with "[PATCH] kobject_uevent CONFIG_NET=n
fix" which is in 2.6.16-rc6.
Thanks,
--
Jun'ichi Nomura, NEC Solutions (America), Inc.
[-- Attachment #2: nosysfs-build.patch --]
[-- Type: text/x-patch, Size: 3279 bytes --]
CONFIG_SYSFS=n fails to build due to mismatch of conditions
for uevent_seqnum and uevent_helper.
kernel/built-in.o(.data+0x1d40): undefined reference to `uevent_helper'
lib/lib.a(kobject_uevent.o)(.text+0x5c1): In function `kobject_uevent':
/build/rc6/source/lib/kobject_uevent.c:152: undefined reference to `uevent_seqnum'
lib/lib.a(kobject_uevent.o)(.text+0x5d0):/build/rc6/source/lib/kobject_uevent.c:152: undefined reference to `uevent_seqnum'
lib/lib.a(kobject_uevent.o)(.text+0x901):/build/rc6/source/lib/kobject_uevent.c:182: undefined reference to `uevent_helper'
lib/lib.a(kobject_uevent.o)(.text+0x910):/build/rc6/source/lib/kobject_uevent.c:182: undefined reference to `uevent_helper'
Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
--- linux-2.6.16-rc6.orig/lib/kobject_uevent.c 2006-03-14 08:57:23.000000000 -0500
+++ linux-2.6.16-rc6/lib/kobject_uevent.c 2006-03-14 08:52:57.000000000 -0500
@@ -26,6 +26,9 @@
#define NUM_ENVP 32 /* number of env pointers */
#if defined(CONFIG_HOTPLUG) && defined(CONFIG_NET)
+u64 uevent_seqnum;
+char uevent_helper[UEVENT_HELPER_PATH_LEN] = "/sbin/hotplug";
+
static DEFINE_SPINLOCK(sequence_lock);
static struct sock *uevent_sock;
--- linux-2.6.16-rc6.orig/kernel/sysctl.c 2006-03-14 09:17:09.000000000 -0500
+++ linux-2.6.16-rc6/kernel/sysctl.c 2006-03-14 09:24:32.000000000 -0500
@@ -399,7 +399,7 @@ static ctl_table kern_table[] = {
.strategy = &sysctl_string,
},
#endif
-#ifdef CONFIG_HOTPLUG
+#if defined(CONFIG_HOTPLUG) && defined(CONFIG_NET)
{
.ctl_name = KERN_HOTPLUG,
.procname = "hotplug",
--- linux-2.6.16-rc6.orig/kernel/ksysfs.c 2006-03-14 08:57:31.000000000 -0500
+++ linux-2.6.16-rc6/kernel/ksysfs.c 2006-03-14 09:38:44.000000000 -0500
@@ -15,9 +15,6 @@
#include <linux/module.h>
#include <linux/init.h>
-u64 uevent_seqnum;
-char uevent_helper[UEVENT_HELPER_PATH_LEN] = "/sbin/hotplug";
-
#define KERNEL_ATTR_RO(_name) \
static struct subsys_attribute _name##_attr = __ATTR_RO(_name)
@@ -25,7 +22,7 @@ static struct subsys_attribute _name##_a
static struct subsys_attribute _name##_attr = \
__ATTR(_name, 0644, _name##_show, _name##_store)
-#ifdef CONFIG_HOTPLUG
+#if defined(CONFIG_HOTPLUG) && defined(CONFIG_NET)
/* current uevent sequence number */
static ssize_t uevent_seqnum_show(struct subsystem *subsys, char *page)
{
@@ -55,7 +52,7 @@ decl_subsys(kernel, NULL, NULL);
EXPORT_SYMBOL_GPL(kernel_subsys);
static struct attribute * kernel_attrs[] = {
-#ifdef CONFIG_HOTPLUG
+#if defined(CONFIG_HOTPLUG) && defined(CONFIG_NET)
&uevent_seqnum_attr.attr,
&uevent_helper_attr.attr,
#endif
--- linux-2.6.16-rc6.orig/include/linux/kobject.h 2006-03-14 10:00:20.000000000 -0500
+++ linux-2.6.16-rc6/include/linux/kobject.h 2006-03-14 09:59:52.000000000 -0500
@@ -27,6 +27,8 @@
#include <asm/atomic.h>
#define KOBJ_NAME_LEN 20
+
+#if defined(CONFIG_HOTPLUG) && defined(CONFIG_NET)
#define UEVENT_HELPER_PATH_LEN 256
/* path to the userspace helper executed on an event */
@@ -34,6 +36,7 @@ extern char uevent_helper[];
/* counter to tag the uevent, read only except for the kobject core */
extern u64 uevent_seqnum;
+#endif
/* the actions here must match the proper string in lib/kobject_uevent.c */
typedef int __bitwise kobject_action_t;
next reply other threads:[~2006-03-14 16:09 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-14 16:11 Jun'ichi Nomura [this message]
2006-03-14 22:01 ` Greg KH
2006-03-15 0:00 ` Jun'ichi Nomura
2006-03-15 0:09 ` Greg KH
2006-03-15 1:03 ` Jun'ichi Nomura
2006-03-15 2:49 ` Greg KH
2006-03-15 13:28 ` Jun'ichi Nomura
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4416EB14.50306@ce.jp.nec.com \
--to=j-nomura@ce.jp.nec.com \
--cc=gregkh@suse.de \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome