Compile errors encountered in the Linux-2.6.23 kernel

Source: Internet
Author: User
Tags mutex

Compiling linux-2.6.23

Error [1]: elf_x86_64: No file or directory

The reason is that GCC 4.6 no longer supports the Linker-style architecture. In the Arch/x86/vdso/makefile,
Replace "-M elf_x86_64" with "-m64" at the beginning of Vdso_ldflags_vdso.lds.
Replace "-M elf_x86" with "-m32" at the beginning of Vdso_ldflags_vdso32.lds.

Error [2]:. Size expression for Copy_user_generic_c does not evaluate to a constant

Locate Arch/x86/lib/copy_user_64.s, and Change End (Copy_user_generic_c) to end (copy_user_generic_string) in the file to entry (Copy_user_ generic_string), keep the same variable.

Compilation appears undefined reference to __mutex_unlock_slowpath

In this sentence, you can find that your function mutex_lock very likely in kernel a function file, we now try to go in kernel/to look for

About the Mutex_lock function file

[email protected]:/usr/src/linux-2.6.23$ ls kernel/mutex*kernel/mutex.ckernel/mutex-debug.h  kernel/mutex.okernel/mutex-debug.c  kernel/mutex.h

You will see that there are a few files on Muxtex at kernel, and this time we just need to open a relevant file and see for yourself.

Obviously we'll open the mutex.c, open with Vim, and you'll see the function of the compiler error.

When you compile an error, when you open this file, there is no this __used, in this file, a total of three places to change, then you go to change it, when you see __mutex_unlock_slowpath (); This function is, also in front of this function to add __ Used

Attention! Another solution on the web is to add a macro definition in the. config file that is CONFIG_DEBUG_MUTEXES=y not feasible.

arch/i386/boot/boot.h: Assembler messages:arch/i386/boot/boot.h:110: Error: bad register name `%dil‘[/size]make[1]: *** [arch/i386/boot/video.o] 错误 1make: *** [bzImage] 错误 2

In fact, this problem arises because my system has GCC and GCC 4.4, the former version is 4.1, and then I modified the GCC 4.4 renamed the default GCC, will be out of this problem, modified back on the good.

If you must use GCC 4.4, you can also refer to the online modification method:

Arch/i386/boot/boot.h, ASM volatile ("MOVW%%fs:%1,%0": "=r" (v): "M" ((U16 ) addr));

There is no register dil ... Accurately speaking here is no explicit use of the register Dil, however, according to Http://www.delorie.com/djgpp/doc/brennan/brennan_att_inline_djgpp.html's introduction, The r here represents a dynamic selection from ESI and EDI, where the Dil is coming from. Solution, EDI does not work, we will change a group, change Q is, Q is in eax, EBX, ecx, edx Middle pick one, change finished, recompile through.

Today, when compiling the uimage, execute make command, error message: 416 "mixed implicit and normal rules", translated into Chinese: mixed and implied general rule. Originally thought is the kernel package problem, from the official web download the low version, reported the same error, Google found that because my system make tool is too new, make the old version of the rule is not compatible with the new version. The problem is resolved in the following manner:
1 in makefile 416 lines of code

config %config: scripts_basic outputmakefile FORCE

Switch

%config: scripts_basic outputmakefile FORCE

2 in Makefile 1466 lines of code

/ %/: prepare scripts FORCE

Switch

%/: prepare scripts FORCE

Compile errors encountered in the Linux-2.6.23 kernel

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.