Skip to contentSkip to conversation

Compile problems with 2.5.7

DISCUSSION Grega Fajdiga 2 participants 3 messages Mar 29, 2002 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Good day,

Quoted 5 lines
Quoted 5 lines

Hi,

Sorry to be so long getting back to you. I've tried everything I can think of to reproduce this but haven't been able to.

I'm sorry I didn't get back to you sooner too. I'm in the boarding school during the week and can use e-mail only at weekends ;-)

Quoted 4 lines
Quoted 4 lines

So could you:

1.) Let me know which version of gcc you're using (cc --version).

[grega@tm-68-65 linux-2.5.7]$ gcc --version
3.0.3

[grega@tm-68-65 linux-2.5.7]$ ld --version
GNU ld 2.10.91
Copyright 2001 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of the GNU General Public License. This program has absolutely no warranty.
Supported emulations:
elf_i386
i386linux
elf_i386_glibc21

Quoted 8 lines

Review

Quoted 8 lines

2.) Verify that kernel/acct.c compile line looks like (the path for
the -I line will match your machine):

gcc -D__KERNEL__ -I/home/rem/views/linux-2.5.7-orig/include -Wall

(quoted diff) +0 -3
-Wstrict-prototypes -Wno-trigraphs -O2 -fomit-frame-pointer
-fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2
-march=i586  -DKBUILD_BASENAME=acct  -c -o kernel/acct.o kernel/acct.c

The path is correct.

Quoted 8 lines

Review

Quoted 8 lines

3.) Use this compile line (substitute your path for ${YOUR_PATH}):

gcc -E -D__KERNEL__ -I${YOUR_PATH}/linux-2.5.7-orig/include -Wall

(quoted diff) +0 -3
-Wstrict-prototypes -Wno-trigraphs -O2 -fomit-frame-pointer
-fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2
-march=i586  -DKBUILD_BASENAME=acct  -c -o kernel/acct.o kernel/acct.c

Not neccessary. See above.

Quoted 2 lines
Quoted 2 lines

4.) E-mail me the kernel/acct.c and kernel/acct.o (BTW the kernel/acct.o
is not really an object file but the output of cpp).

As I have already said, the only patch I use is 0-aliases-c-C7-pre2 by Al Viro. It makes the kernel compile without NFS support, which I don't need. The patch follows:

fs/Makefile +2 -6
diff -urN C7-pre2/fs/Makefile C7-pre2-current/fs/Makefile
@@ -16,12 +16,6 @@
 		dcache.o inode.o attr.o bad_inode.o file.o iobuf.o dnotify.o \
 		filesystems.o namespace.o seq_file.o xattr.o libfs.o
 
-ifeq ($(CONFIG_QUOTA),y)
-obj-y += dquot.o
-else
-obj-y += noquot.o
-endif
-
 ifneq ($(CONFIG_NFSD),n)
 ifneq ($(CONFIG_NFSD),)
 obj-y += nfsctl.o
@@ -84,6 +78,8 @@
 obj-y				+= binfmt_script.o
 
 obj-$(CONFIG_BINFMT_ELF)	+= binfmt_elf.o
+
+obj-$(CONFIG_QUOTA) += dquot.o
 
 # persistent filesystems
 obj-y += $(join $(subdir-y),$(subdir-y:%=/%.o))
fs/dquot.c +14 -0
diff -urN C7-pre2/fs/dquot.c C7-pre2-current/fs/dquot.c
@@ -59,6 +59,7 @@
 #include <linux/tty.h>
 #include <linux/file.h>
 #include <linux/slab.h>
+#include <linux/sysctl.h>
 #include <linux/smp_lock.h>
 #include <linux/init.h>
 
@@ -1240,9 +1241,22 @@
 	return ret;
 }
 
+static ctl_table fs_table[] = {
+	{FS_NRDQUOT, "dquot-nr", &nr_dquots, 2*sizeof(int),
+	 0444, NULL, &proc_dointvec},
+	{},
+};
+
+static ctl_table dquot_table[] = {
+	{CTL_FS, "fs", NULL, 0, 0555, fs_table},
+	{},
+};
+
 static int __init dquot_init(void)
 {
 	int i;
+
+	register_sysctl_table(dquot_table, 0);
 
 	for (i = 0; i < NR_DQHASH; i++)
 		INIT_LIST_HEAD(dquot_hash + i);
fs/noquot.c +0 -15
diff -urN C7-pre2/fs/noquot.c C7-pre2-current/fs/noquot.c
@@ -1,15 +0,0 @@
-/* noquot.c: Quota stubs necessary for when quotas are not
- *           compiled into the kernel.
- */
-
-#include <linux/kernel.h>
-#include <linux/types.h>
-#include <linux/errno.h>
-
-int nr_dquots, nr_free_dquots;
-int max_dquots;
-
-asmlinkage long sys_quotactl(int cmd, const char *special, int id, caddr_t addr)
-{
-	return(-ENOSYS);
-}
include/linux/quota.h +0 -1
diff -urN C7-pre2/include/linux/quota.h C7-pre2-current/include/linux/quota.h
@@ -144,7 +144,6 @@
 
 #ifdef __KERNEL__
 
-extern int nr_dquots, nr_free_dquots;
 extern int dquot_root_squash;
 
 #define NR_DQHASH 43            /* Just an arbitrary number */
kernel/Makefile +1 -0
diff -urN C7-pre2/kernel/Makefile C7-pre2-current/kernel/Makefile
@@ -20,6 +20,7 @@
 obj-$(CONFIG_UID16) += uid16.o
 obj-$(CONFIG_MODULES) += ksyms.o
 obj-$(CONFIG_PM) += pm.o
+obj-$(CONFIG_CONFIG_BSD_PROCESS_ACCT) += acct.o
 
 ifneq ($(CONFIG_IA64),y)
 # According to Alan Modra <[email protected]>, the -fno-omit-frame-pointer is
kernel/acct.c +0 -18
diff -urN C7-pre2/kernel/acct.c C7-pre2-current/kernel/acct.c
@@ -44,17 +44,11 @@
  */
 
 #include <linux/config.h>
-#include <linux/errno.h>
-#include <linux/kernel.h>
-
-#ifdef CONFIG_BSD_PROCESS_ACCT
 #include <linux/mm.h>
 #include <linux/slab.h>
 #include <linux/acct.h>
-#include <linux/smp_lock.h>
 #include <linux/file.h>
 #include <linux/tty.h>
-
 #include <asm/uaccess.h>
 
 /*
@@ -397,15 +391,3 @@
 		spin_unlock(&acct_globals.lock);
 	return 0;
 }
-
-#else
-/*
- * Dummy system call when BSD process accounting is not configured
- * into the kernel.
- */
-
-asmlinkage long sys_acct(const char * filename)
-{
-	return -ENOSYS;
-}
-#endif
kernel/sys.c +6 -0
diff -urN C7-pre2/kernel/sys.c C7-pre2-current/kernel/sys.c
@@ -173,6 +173,12 @@
 	return -ENOSYS;
 }
 
+/* "Conditional" syscalls */
+
+asmlinkage long sys_nfsservctl(void) __attribute__ ((weak, alias ("sys_ni_syscall")));
+asmlinkage long sys_quotactl(void) __attribute__ ((weak, alias ("sys_ni_syscall")));
+asmlinkage long sys_acct(void) __attribute__ ((weak, alias ("sys_ni_syscall")));
+
 static int proc_sel(struct task_struct *p, int which, int who)
 {
 	if(p->pid)
kernel/sysctl.c +0 -2
diff -urN C7-pre2/kernel/sysctl.c C7-pre2-current/kernel/sysctl.c
@@ -284,8 +284,6 @@
 	 0444, NULL, &proc_dointvec},
 	{FS_MAXFILE, "file-max", &files_stat.max_files, sizeof(int),
 	 0644, NULL, &proc_dointvec},
-	{FS_NRDQUOT, "dquot-nr", &nr_dquots, 2*sizeof(int),
-	 0444, NULL, &proc_dointvec},
 	{FS_DENTRY, "dentry-state", &dentry_stat, 6*sizeof(int),
 	 0444, NULL, &proc_dointvec},
 	{FS_OVERFLOWUID, "overflowuid", &fs_overflowuid, sizeof(int), 0644, NULL,

As you can see it touches the acct.c file. I'm not a hacker, so I don't know what it does.

Best Regards,

Grega Fajdiga

#2 lore raw
In reply to a message not in the archive

Grega,

The easiest thing to do to fix your problem is to edit kernel/Makefile and remove acct.o. The patch below (suppied by Andrey Klochko) will work.

Signature · 22 lines
Bob Miller					Email: [email protected]
Open Source Development Lab			Phone: 503.626.2455 Ext. 17


--- linux-2.5/kernel/Makefile.orig	Thu Mar 28 13:50:52 2002
+++ linux-2.5/kernel/Makefile	Thu Mar 28 13:24:12 2002
@@ -14,13 +14,13 @@
 
 obj-y     = sched.o dma.o fork.o exec_domain.o panic.o printk.o \
 	    module.o exit.o itimer.o info.o time.o softirq.o resource.o \
-	    sysctl.o acct.o capability.o ptrace.o timer.o user.o \
+	    sysctl.o capability.o ptrace.o timer.o user.o \
 	    signal.o sys.o kmod.o context.o futex.o kthread.o
 
 obj-$(CONFIG_UID16) += uid16.o
 obj-$(CONFIG_MODULES) += ksyms.o
 obj-$(CONFIG_PM) += pm.o
-obj-$(CONFIG_CONFIG_BSD_PROCESS_ACCT) += acct.o
+obj-$(CONFIG_BSD_PROCESS_ACCT) += acct.o
 obj-$(CONFIG_IKCONFIG) += configs.o
 
 ifneq ($(CONFIG_IA64),y)
#3 lore raw
In reply to a message not in the archive

Good day,

I have compiled a virgin 2.5.7 kernel with NFS support compiled in successfully. Therefore we can safely assume that there is something wrong with what Alexander Viro's patch (0-aliases-c-C7-pre2) is doing is wrong somehow.

Regards,
Grega Fajdiga