LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (https://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   XFree86-4.4.0 compilation error (https://www.linuxquestions.org/questions/linux-from-scratch-13/xfree86-4-4-0-compilation-error-210313/)

jomen 07-27-2004 03:13 PM

XFree86-4.4.0 compilation error
 
Hi all,

I posted this in LQ-Forum "Linux-Software" but - as suggested there - I might be better off here...

I have to ask for help on this one - I have'nt got a clue what to do here...

Without success I tried to build XFree86 (4.4.0) from source and I'm getting the following error:
(just the last lines from compile.log)



making all in programs/Xserver/hw/xfree86/os-support/linux/drm/kernel...
make[9]: Entering directory `/mnt/extra/Software/X/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel'
make -f Makefile.linux
make[10]: Entering directory `/mnt/extra/Software/X/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel'
+ mv -f Makefile Makefile._xx_
+ ln -s Makefile.linux Makefile
make -C /lib/modules/2.6.7/build SUBDIRS=`pwd` DRMSRCDIR=`pwd` modules
make[11]: Entering directory `/usr/src/linux-2.6.7'
CC [M] /mnt/extra/Software/X/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/gamma_drv.o
In file included from /mnt/extra/Software/X/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/gamma_drv.c:57:
/mnt/extra/Software/X/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_vm.h: In function `gamma_do_vm_nopage':
/mnt/extra/Software/X/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_vm.h:104: error: structure has no member named `count'
make[12]: *** [/mnt/extra/Software/X/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/gamma_drv.o] Error 1
make[11]: *** [_module_/mnt/extra/Software/X/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel] Error 2
make[11]: Leaving directory `/usr/src/linux-2.6.7'
make[10]: *** [modules] Error 2
make[10]: Leaving directory `/mnt/extra/Software/X/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel'
make[9]: *** [all] Error 2
make[9]: Leaving directory `/mnt/extra/Software/X/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel'
make[8]: *** [all] Error 2
make[8]: Leaving directory `/mnt/extra/Software/X/xc/programs/Xserver/hw/xfree86/os-support/linux/drm'
make[7]: *** [all] Error 2
make[7]: Leaving directory `/mnt/extra/Software/X/xc/programs/Xserver/hw/xfree86/os-support/linux'
make[6]: *** [linux] Error 2
make[6]: Leaving directory `/mnt/extra/Software/X/xc/programs/Xserver/hw/xfree86/os-support'
make[5]: *** [all] Error 2
make[5]: Leaving directory `/mnt/extra/Software/X/xc/programs/Xserver/hw/xfree86'
make[4]: *** [hw/xfree86] Error 2
make[4]: Leaving directory `/mnt/extra/Software/X/xc/programs/Xserver'
make[3]: *** [all] Error 2
make[3]: Leaving directory `/mnt/extra/Software/X/xc/programs'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/mnt/extra/Software/X/xc'
make[1]: *** [World] Error 2
make[1]: Leaving directory `/mnt/extra/Software/X/xc'
make: *** [World] Error 2


I'm running LFS with kernel 2.6.7, glibc-2.3.2, gcc-3.3.2 - I compiled _everything_ on the System with this compiler (XFree-4.3.0.1 Gnome-2.6 KDE ...)

There are no special compiler-flags set:
-> in my .bash_profile I have "-O2 -fomit-frame-pointer -march=athlon-xp"

but this should not matter for the build...

-> in the host.def I have the following line:

#define DefaultGcc2i386Opt -O2 -fomit-frame-pointer -march=athlon-xp

Because it seems to be a problem while compiling the driver for my graphics-card - here is the line from host.def:

#define XF86CardDrivers ati AgpGartDrivers fbdev vesa vga XF86OSCardDrivers



(I have a ATI Technologies Inc Rage 128 RF/SG AGP rev 0 - which is working fine with XFree86-4.3.0.1 and also with previous Versions)

I can compile XFree-4.3.0 without errors and successfully - with the exact same host.def...
But that is what I have already.
I did try this just to check if the problem would be my kernel-source-tree - the problem could be there, because it is getting mentioned at the beginning of the error-message.


The kernel (2.6.7) and the compiler (gcc-3.3.2) are about the only thing I have installed deviating(?) - I mean different - from Instructions in the then most recent LFS-Book.
Since then I have recompiled (almost) every Program on the System to be current with LFS 5.0.

I have asked this Question before here on LinuxQuestions.org, but did not get any replies then.

I hope someone can point me in the right direction - please?!


Thank you!

Jochen

Dargason 07-27-2004 04:56 PM

Well, I don't really understand what's going on, but I know that in the LFS book they generally recommend unsetting any of the optimization flags, including "-march"... maybe you could try that?

Andrew Benton 07-27-2004 05:08 PM

The problem is the kernel headers from the 2.6 kernel. There are two ways to fix it, you could copy (or symlink) some header files from /usr/src/linux/include/linux into /usr/include/linux or you can alter the XFree source to stop it including the kernel headers. Open the file /mnt/extra/Software/X/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm.h in a text editor and remove line 41 where it says
#include <linux/config.h>

You may encounter similar problems later on when you come to compile Mplayer or Xine-libs. I don't know what the correct solution is there, I took the uncool option and made symbolic links to the current kernels headers. Good luck.

jomen 07-27-2004 05:18 PM

Thank you Dargason
...but it's almost definately not the CFLAGS - they are not aggressive at all - just producing code for my processor... but I'll try that too

Thank you Andrew Benton - this sounds good - it ist getting late now, so I'll try that tomorrow and see what happens

btw. - I've already compiled Mplayer and Xine successfully under 2.6.7 - no problems whatsoever

Jochen

Andrew Benton 07-27-2004 05:37 PM

Hmm...I think I spoke too soon, sorry. I've Googled around a bit and it looks like you're seeing a different error. Yours looks the same as this one http://linuxfromscratch.org/pipermai...ly/051015.html (which cleverer people than me haven't fixed yet) and also has similarities to this http://www.linuxquestions.org/questions/history/204767 . I'm sorry if I've lead you a dance.

jomen 07-28-2004 09:54 AM

Thank you Andrew Benton

..I did of course use google also to look for a solution to my problem - but that was before my first post (which got no replies).
At that time (maybe 3+ weeks ago) the things you pointed me at did not exist yet - and still do not ;-(
I will follow the first thread you pointed me to as it is exactly the same error-message described there.
I just moved my copied /usr/include/linux (as I explained in my post to LQ - Linux-Software) and made a link instead to /usr/scr/linux/include/linux (which points to my current kernel) - to no avail.
Since I'm not at all a knowing person, when it comes to understanding the source - I can see the structure DRM_DEBUG which seems to cause the error - I can see a variable count in it...but when I change that to _count, isn't it then a new variable (would it not needed to be declared somewhere)?
Nowhere in the code I found a variable called _count.

This is the structure in xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_vm.h:

DRM_DEBUG("baddr = 0x%lx page = 0x%p, offset = 0x%lx, count=%d\n",
baddr, __va(agpmem->memory->memory[offset]), offset,
atomic_read(&page->count));
return page;

In the kernel-source ( /lib/modules/2.6.7/build/drivers/char/drm/drm_vm.h ) I found a similar structure of the same name:

DRM_DEBUG("baddr = 0x%lx page = 0x%p, offset = 0x%lx, count=%d\n",
baddr, __va(agpmem->memory->memory[offset]), offset,
page_count(page));
return page;


Thank you for your help so far - I saw you asking on behalf of my problem :-)
I just launched a new compile maybe I will get to understand it - I'm rather assuming that I'm too stupid than to even think of an error in the code - this would have hit a lot of people by now and would be fixed already.

Jochen

jomen 07-28-2004 02:03 PM

It is done ! :D

I have compiled it and it is now running!
What I did is this:

following the first hint and link you gave me, I read through the conversation and decided to try what Ken Moffat wrote on http://linuxfromscratch.org/pipermai...ly/051036.html
As I read it, it would be next to useless to compile the kernel-modules from the XFree-source because the ones from kernel-source are just as new and good.
I have agpgart compiled in the kernel as well as drm and a module for my graphics-card (ati rage 128).
I added the following to my host.def:

#define BuildXF86DRI No
#define BuildXF86DRM Yes

...and it compiled cleanly, because the offending things where'nt needed to be compiled.
Question: shold or could I set the second one also to "No" ?

To avoid an error-message from X I commented out the line in XF86Config, that said:
Load "dri"

The only thing I noticed while running the new server was, that glxgears did not run as fast as it had been before - a drop from about 75 fps down to about 20 fps in fullscreen-mode.
I'm not sure, if this is a DRI thing.

I'm trying now to compile with these additions to host.def:

#define MesaUse3DNow YES
#define MesaUseSSE YES

I hope this is the solution to this speed-problem?!

Maybe someone can give me a hint on how to do this the way it shold be done - I hope dri is not needed for this, because that would put me where I was...

Thanks for your help till now!

Jochen:D

Andrew Benton 07-28-2004 05:27 PM

Well done for getting it working. I wish I could help more but I have an Nvidia card and so I've never faced these issues. A drop from 75 to 20 fps seems quite a step back. I don't remember noticeing anything different when I went from XFree86-4.3.0 to XFree86-4.4.0 so I wonder if it was worth it? If you were getting better performance before...
And the other thing is, if the problem is with the 2.6.7 kernel, could you install a 2.6.6 kernel, then install XFree the way you want and then reinstall the 2.6.7 kernel? I have to reinstall the nvidia driver when I recompile the kernel but I don't have to reinstall XFree so I don't know if that suggestion makes sense with an ATI graphics card.

jomen 07-28-2004 05:51 PM

these where my thougts also - I still have my old 2.4.24 kernel but it felt like cheating to go back.
Since the speed-problem remains, I will do that to compile X _with_ DRI...

The reason for wanting XFree4.4.0 was another Programm I tried to compile - Myth-TV or some other TV-Software - and that failed with errors pointing to some XFree headers and libraries... so I thougt, having the current version would cure that and I could go on more successful...

Thank you again !

Jochen

jomen 07-29-2004 05:48 AM

I will call this the end of this thread...

why doing it the easy way when one can take a hard and slow one...you still end up at the same place - with all the others already gone ;-)

I still don't know, why it did not work...
I booted my kernel 2.4.24 and compiled the thing without any problems - booted 2.6.7 and the problem was - not solved, but gone for me.
I'm not able to figure it out - but it works now for me.

Thank you all

Jochen


All times are GMT -5. The time now is 01:28 PM.