sabato 21 luglio 2012

fglrx compiling problems (again)

Today I came into a new error, after trying to recompile my fglrx drivers.
configuration:
fedora 16 64bit
kernel 3.4.4-4
fglrx drivers 12-6
the error is:

make[1]: Entering directory `/usr/src/kernels/3.4.4-4.fc16.x86_64'
  CC [M]  /usr/src/fglrx-8.98/2.6.x/firegl_public.o
/usr/src/fglrx-8.98/2.6.x/firegl_public.c: In function ‘kasInitExecutionLevels’:
/usr/src/fglrx-8.98/2.6.x/firegl_public.c:4159:47: error: ‘cpu_possible_map’ undeclared (first use in this function)
/usr/src/fglrx-8.98/2.6.x/firegl_public.c:4159:47: note: each undeclared identifier is reported only once for each function it appears in
/usr/src/fglrx-8.98/2.6.x/firegl_public.c:4159:66: warning: left-hand operand of comma expression has no effect [-Wunused-value]

Don't bother anymore with recompiling, use instead the rpmfusion repository and enter:
yum install kmod-catalyst
This solution, using non official amd drivers, is not suitable to me, because laptop gets very hot....

Googling aroung, it seems that the macro cpu_possible_map is invalid with 3.4.x kernel. try doing this:

  1. cd /usr/src/fglrx-8.98 or whatever else you have
  2. sh make.sh --nohints --uname_r=3.4.4-4.fc16.x86_64 --norootcheck
  3. you get the error above: ok.
  4. open 2.6.x/firegl_public.c at line 4159
  5. replace for_each_cpu_mask(p, cpu_possible_map)  with
  6. #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)
  7.     for_each_possible_cpu(p)
  8. #else
  9.      for_each_cpu_mask(p, cpu_possible_map)
  10. #endif

rerun command 2, now it should work
reboot.

info from
http://cvs.rpmfusion.org/viewvc/rpms/catalyst-kmod/F-16/fglrx_kernel_3.4.0.patch?revision=1.3&root=nonfree&view=markup


EDIT:
a quicker solution is explained here (end of the page)
http://wiki.cchtml.com/index.php/Fedora_17_Installation_Guide