compiling linux kernel 2.6.16 + problems with make modules

Asked by mtn88 on 2010-02-11

l am on ubuntu 9.10 trying to compile linux kernel 2.6.16 with mobile ipv6 ... but l encountered the same problem reported earlier by charlie with : MAKE MODULES
CHK include/linux/version.h
  CC [M] fs/binfmt_aout.o
fs/binfmt_aout.c: Assembler messages:
fs/binfmt_aout.c:154: Error: suffix or operands invalid for `cmp'
make[1]: *** [fs/binfmt_aout.o] Error 1
make: *** [fs] Error 2

Please tell me what are the possible solutions to this !!!!
[Edited]

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu yelp Edit question
Assignee:
No assignee Edit question
Last query:
2010-02-12
Last reply:
2010-09-25

Ubuntu does not support compiling your own kernel. If you need to compile your own kernel for whatever reason then please see a few guides..

Grabbing Ubuntu kernel source: https://wiki.ubuntu.com/KernelTeam/KernelGitGuide
Creating the kernel and installing it: http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=1&chap=7

Beyond that, your support is limited. Some developers may be interested in helping but the chances are very low.

mtn88 (williamecedrique) said : #2

l don't understand ur point. l am compiling a source kernel that exists already, l am not creating anything. l am following the process of compiling a 2.6.16 patched kernel (in my case, l applied the mipl patch for ipv6 mobility) and after configuration of the kernel (edition of the .config file in /usr/src/linux ) l tried unsuccessfully to load the modules with : make modules
and the errors are as follow :
CHK include/linux/version.h
  CC [M] fs/binfmt_aout.o
fs/binfmt_aout.c: Assembler messages:
fs/binfmt_aout.c:154: Error: suffix or operands invalid for `cmp'
make[1]: *** [fs/binfmt_aout.o] Error 1
make: *** [fs] Error 2

1) Custom kernels are not supported by the community
2) The links I provided explain how to do what you are trying to do
3) The links I provided explain why what you are trying to do is not working

inurneck (inurneck) said : #4

indeed.

mtn88 (williamecedrique) said : #5

Excuse me but l still don't understand. l was trying to continue with the compilation of the linux kernel from where l stopped with the command make && make modules_install but the same problem occured :

....

fs/xfs/linux-2.6/xfs_super.c: In function ‘init_xfs_fs’:
fs/xfs/linux-2.6/xfs_super.c:961: attention : le format n'est pas une chaîne littérale et pas d'argument de format
  CC [M] fs/xfs/linux-2.6/xfs_vfs.o
  CC [M] fs/xfs/linux-2.6/xfs_vnode.o
  CC [M] fs/xfs/support/debug.o
  CC [M] fs/xfs/support/move.o
  CC [M] fs/xfs/support/uuid.o
  LD [M] fs/xfs/xfs.o
  CC [M] fs/binfmt_aout.o
fs/binfmt_aout.c: Assembler messages:
fs/binfmt_aout.c:154: Error: suffix or operands invalid for `cmp'
make[1]: *** [fs/binfmt_aout.o] Erreur 1
make: *** [fs] Erreur 2

l really don't understand the problem

Compiling the kernel for Ubuntu IS NOT supported. You will not be given support for something that is not supported.

Unless you know what you are doing this is not something you should attempt. It has been stated already that this is not supported. I gave you some links you could use to try to figure this out yourself but you failed to read them thoroughly.

Ubuntu does not support what you are doing.

CatCity (catcity) said : #7

The reason for this, regardless of whether compiling the kernel is supported or not, is that the gcc version supplied as part of Ubuntu isn't compatible with the older linux kernel. This problem is (helpfully!) addressed by Andrew Morton at http://linux.derkeiler.com/Mailing-Lists/Kernel/2006-06/msg06536.html, and crucially the required patch to correct the problem is a

ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.17/2.6.17-mm1/broken-out/i386-use-c-code-for-current_thread_info.patch

My exact requirements differ, in that I'm using kernel 2.6.17.9 w/ Ubuntu 10.04 (gcc 4.4.3), and so I can't promise that this will work for 2.6.16 - however, I'd be very surprised if it didn't.

If you're uncomfortable with using patch, or if the patch fails due to differences between 2.6.16 & 2.6.17, then a long-winded approach is as follows:

1. Open the source file (relative to your source root) include/asm-i386/thread_info.h in your preferred editor
2. Find the lines
     /* how to get the current stack pointer from C */
     register unsigned long current_stack_pointer asm("esp") __attribute_used__;
3. These two lines should be just after a block of text beginning
     /* how to get the thread information struct from C */
     static inline struct thread_info *current_thread_info(void)

     Move them to just before this block

4. In the block above, replace the three lines between the { and } markers with

     return (struct thread_info *)(current_stack_pointer & ~(THREAD_SIZE - 1));

5. This section of the file should now look like this - spacing isn't important, punctuation and casing are critical:

     /* how to get the current stack pointer from C */
     register unsigned long current_stack_pointer asm("esp") __attribute_used__;

     /* how to get the thread information struct from C */
     static inline struct thread_info *current_thread_info(void)
     {
           return (struct thread_info *)(current_stack_pointer & ~(THREAD_SIZE - 1));
     }

6. Save file and compile :)

This works on my machine, and should be a general solution.

Michael Lustfield - regardless of whether Ubuntu, who I don't believe you represent, do or don't support custom kernel installs; if you don't have anything helpful to say then don't say it.

Can you help with this problem?

Provide an answer of your own, or ask mtn88 for more information if necessary.

To post a message you must log in.