Page 1 of 1

mmx.c fails to compile (2.6.20.4/test)

PostPosted: Tue Mar 27, 2007 11:42 am
by bjorn
Hi, I'm new here.
I just sat down to make a new kernel for my home gw, and thought i'd give 2.6.20.4 and the testing grsec patches a shot. I guess it failed.
what made me spit out my coffee is this:
Code: Select all
CC      arch/i386/lib/mmx.o
arch/i386/lib/mmx.c: In function '_mmx_memcpy':
arch/i386/lib/mmx.c:75: error: 'cr0' undeclared (first use in this function)
arch/i386/lib/mmx.c:75: error: (Each undeclared identifier is reported only once
arch/i386/lib/mmx.c:75: error: for each function it appears in.)
arch/i386/lib/mmx.c:46: error: invalid lvalue in asm output 0
arch/i386/lib/mmx.c:80: error: invalid lvalue in asm output 0
arch/i386/lib/mmx.c: In function 'fast_copy_page':
arch/i386/lib/mmx.c:238: error: 'cr0' undeclared (first use in this function)
arch/i386/lib/mmx.c:209: error: invalid lvalue in asm output 0
arch/i386/lib/mmx.c:242: error: invalid lvalue in asm output 0
make[1]: *** [arch/i386/lib/mmx.o] Error 1
make: *** [arch/i386/lib] Error 2


I don't know ASM, i do a little bit of C, but the deepness of the C code here is more than i can handle so i wasn't able to find/solve the problem myself.
I know it's just testing versions and all, but i was just wondering if there is a quick solution to it.. if not i'll simply go back to .19.2 for now. :)

And, do i really need the patched mmx.c? or can i just remove the mmx.c part of the patch and use the vanilla one? would that work?

CPU: 1.2GHz Athlon
GCC version: 4.1.2
Dist: archlinux

anyway thanks :]

Re: mmx.c fails to compile (2.6.20.4/test)

PostPosted: Tue Mar 27, 2007 5:54 pm
by PaX Team
bjorn wrote:
Code: Select all
CC      arch/i386/lib/mmx.o
arch/i386/lib/mmx.c: In function '_mmx_memcpy':
arch/i386/lib/mmx.c:75: error: 'cr0' undeclared (first use in this function)
arch/i386/lib/mmx.c:75: error: (Each undeclared identifier is reported only once
arch/i386/lib/mmx.c:75: error: for each function it appears in.)
arch/i386/lib/mmx.c:46: error: invalid lvalue in asm output 0
arch/i386/lib/mmx.c:80: error: invalid lvalue in asm output 0
arch/i386/lib/mmx.c: In function 'fast_copy_page':
arch/i386/lib/mmx.c:238: error: 'cr0' undeclared (first use in this function)
arch/i386/lib/mmx.c:209: error: invalid lvalue in asm output 0
arch/i386/lib/mmx.c:242: error: invalid lvalue in asm output 0
make[1]: *** [arch/i386/lib/mmx.o] Error 1
make: *** [arch/i386/lib] Error 2
try -test11 from the PaX test directory, it should be fixed. alternatively you can enable KERNEXEC :-).
I don't know ASM, i do a little bit of C, but the deepness of the C code here is more than i can handle so i wasn't able to find/solve the problem myself.
the very first error message gives you a big hint: cr0 is not declared and if you look at the code you'll see that it's in an ifdef/endif block, whereas one of its uses isn't -> the compiler will complain if the ifdef is skipped, which i guess is your case as you probably didn't enable KERNEXEC.
And, do i really need the patched mmx.c? or can i just remove the mmx.c part of the patch and use the vanilla one? would that work?
if you don't use KERNEXEC then you don't need to patch it either, but the latest PaX patch should fix it anyway.

PostPosted: Wed Mar 28, 2007 3:19 am
by forsaken
Which option is PAX_KERNEXEC ? I'm not seeing it.

PostPosted: Wed Mar 28, 2007 4:36 am
by PaX Team
forsaken wrote:Which option is PAX_KERNEXEC ? I'm not seeing it.
first, it's for i386 only, second, even there it has a few dependencies, in menuconfig you can hit '/' then enter the option name and you'll see where it is and what it depends on.

PostPosted: Wed Mar 28, 2007 5:49 am
by forsaken
PaX Team wrote:
forsaken wrote:Which option is PAX_KERNEXEC ? I'm not seeing it.
first, it's for i386 only, second, even there it has a few dependencies, in menuconfig you can hit '/' then enter the option name and you'll see where it is and what it depends on.


I seem to fulfill all these:

PAX && PAX_NOEXEC && X86_32 && !HOTPLUG_PCI_COMPAQ_NVRAM && !PCI_BIOS && !EFI && !COMPAT_VDSO && X86_WP_WORKS_OK

But I'm still not seeing any kernexec under "Non-executable pages" only "Enforce non-executable pages".

PostPosted: Wed Mar 28, 2007 12:42 pm
by amdfanatyk
for me it's just broken grsec patch

PostPosted: Wed Mar 28, 2007 4:55 pm
by PaX Team
forsaken wrote:I seem to fulfill all these:

PAX && PAX_NOEXEC && X86_32 && !HOTPLUG_PCI_COMPAQ_NVRAM && !PCI_BIOS && !EFI && !COMPAT_VDSO && X86_WP_WORKS_OK

But I'm still not seeing any kernexec under "Non-executable pages" only "Enforce non-executable pages".
does this also happen with the PaX patch alone?

PostPosted: Thu Mar 29, 2007 7:58 am
by forsaken
PaX Team wrote:
forsaken wrote:I seem to fulfill all these:

PAX && PAX_NOEXEC && X86_32 && !HOTPLUG_PCI_COMPAQ_NVRAM && !PCI_BIOS && !EFI && !COMPAT_VDSO && X86_WP_WORKS_OK

But I'm still not seeing any kernexec under "Non-executable pages" only "Enforce non-executable pages".
does this also happen with the PaX patch alone?


Yes it does, you can get my config at: *poof gone*

PostPosted: Thu Mar 29, 2007 4:03 pm
by PaX Team
forsaken wrote:
PaX Team wrote:
forsaken wrote:I seem to fulfill all these:

PAX && PAX_NOEXEC && X86_32 && !HOTPLUG_PCI_COMPAQ_NVRAM && !PCI_BIOS && !EFI && !COMPAT_VDSO && X86_WP_WORKS_OK

But I'm still not seeing any kernexec under "Non-executable pages" only "Enforce non-executable pages".
does this also happen with the PaX patch alone?
Yes it does, you can get my config at: https://www.forsaken.se/paxteam
how about CONFIG_COMPAT_VDSO=y?

PostPosted: Fri Mar 30, 2007 12:27 am
by forsaken
Oops, I must have misspelled VDSO when i grepped for it in the config.
Thanks for the help.