Bug 19648

Summary: Drm fails to build with kernel 2.6.29
Product: DRI Reporter: Mikko C. <mikko.cal>
Component: DRM/otherAssignee: Default DRI bug account <dri-devel>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium CC: ppaalanen, rion4ik
Version: XOrg git   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
Add definitions from newest kernel for legacy support, change from current->euid to current_euid() handler function
none
Correction, this time with the macro rewritten like it should have
none
One last time for good luck (and to fix a typo)
none
"#define current_euid() current->euid" should do the trick none

Description Mikko C. 2009-01-19 01:12:51 UTC
Here's the output:
                                    
  CC [M]  /var/tmp/paludis/x11-base-x11-drm-99999999/work/drm/linux-core/drm_drv.o                                          
  CC [M]  /var/tmp/paludis/x11-base-x11-drm-99999999/work/drm/linux-core/drm_fops.o                                         
  CC [M]  /var/tmp/paludis/x11-base-x11-drm-99999999/work/drm/linux-core/drm_ioctl.o                                        
  CC [M]  /var/tmp/paludis/x11-base-x11-drm-99999999/work/drm/linux-core/drm_irq.o                                          
  CC [M]  /var/tmp/paludis/x11-base-x11-drm-99999999/work/drm/linux-core/drm_lock.o                                         
/var/tmp/paludis/x11-base-x11-drm-99999999/work/drm/linux-core/drm_fops.c: In function 'drm_open_helper':                   
/var/tmp/paludis/x11-base-x11-drm-99999999/work/drm/linux-core/drm_fops.c:253: error: 'struct task_struct' has no member named 'euid'
make[2]: *** [/var/tmp/paludis/x11-base-x11-drm-99999999/work/drm/linux-core/drm_fops.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [_module_/var/tmp/paludis/x11-base-x11-drm-99999999/work/drm/linux-core] Error 2
make[1]: Leaving directory `/usr/src/linux-2.6.29-rc2'                     
make: *** [modules] Error 2
Comment 1 Rion 2009-01-20 04:26:28 UTC
after some googling i've found similar problem here http://communities.vmware.com/thread/188410 and proposed patches.
Comment 2 Seppo Yli-Olli 2009-01-21 23:43:33 UTC
Created attachment 22145 [details] [review]
Add definitions from newest kernel for legacy support, change from current->euid to current_euid() handler function
Comment 3 Seppo Yli-Olli 2009-01-21 23:51:06 UTC
Created attachment 22146 [details] [review]
Correction, this time with the macro rewritten like it should have

Previous one just had the macro straight pulled from kernel tree. It of course wasn't useful. It should rather have had the macro changed to use the legacy way of getting uid. The previous one is *dangerous* since the macro removes compile-time checking.
Comment 4 Seppo Yli-Olli 2009-01-21 23:54:02 UTC
Created attachment 22148 [details] [review]
One last time for good luck (and to fix a typo)

As before, please don't touch the earlier one. There's no warnings that it would fail but it will fail on run-time. The earlier patch had an excess '_'.
Comment 5 Mikko C. 2009-01-21 23:58:43 UTC
the last two patches look identical to me.
Anyway, it fixes the build for me, thanks!
Comment 6 Seppo Yli-Olli 2009-01-22 00:04:26 UTC
(In reply to comment #5)
> the last two patches look identical to me.
> Anyway, it fixes the build for me, thanks!
> 
Actually all three are wrong. Please don't use them. It needs a rewrite into a function (it would generate warnings+errors if it fails unlike macros).
I suspect there's still a problem with the latest one but as they're macros, it's impossible to tell during compile time. Ignore them.
Comment 7 Seppo Yli-Olli 2009-01-22 00:07:00 UTC
Comment on attachment 22148 [details] [review]
One last time for good luck (and to fix a typo)

Possibly broken.
Comment 8 Seppo Yli-Olli 2009-01-22 00:17:34 UTC
Created attachment 22149 [details] [review]
"#define current_euid() current->euid" should do the trick

Macro is fine if it's the right macro. 2.6.29 has current_euid() while < 2.6.29 does not. < 2.6.29 has current->euid data structure. This solution just maps them together. I'm not personally happy with this since it still does not give build-time notifications but I'll leave the final patch for someone else.
Comment 9 David Heidelberg (okias) 2009-01-27 07:29:29 UTC
Patch working. Thanks :-) I hope in quick include in drm master.
Comment 10 Pekka Paalanen 2009-01-27 13:55:16 UTC
I'm not sure a macro in drm_compat.c would do much good ;-)

Anyway, I pushed a fix to this issue. If it is still broken, or I broke something else, let me know.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.