Bug 473459 - undefined macros in drm/drm.h break userspace compilation (__user and DEPRECATED)
undefined macros in drm/drm.h break userspace compilation (__user and DEPRECA...
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: kernel (Show other bugs)
10
All Linux
medium Severity medium
: ---
: ---
Assigned To: Dave Airlie
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-11-28 11:08 EST by Hans Ulrich Niedermann
Modified: 2008-11-30 03:29 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-11-30 03:29:19 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Hans Ulrich Niedermann 2008-11-28 11:08:42 EST
Description of problem:

  drm/drm.h makes extensive use of the C preprocessor macros
  __user and DEPRECATED.

  Howver, in F10 drm/drm.h does not define those macros any more
  like it did in F9. Those two macros are usually undefined in
  userspace software, and thus compilation will fail.

  The drm/drm.h in F9 (from libdrm-devel) used to contain

    #ifndef __user
    #define __user
    #endif
    [...]
    #ifdef __GNUC__
    # define DEPRECATED  __attribute__ ((deprecated))
    #else
    # define DEPRECATED
    #endif

  which prevents the problem.

Version-Release number of selected component (if applicable):

  [F-9]$ rpm -qf /usr/include/drm/drm.h
  libdrm-devel-2.4.0-0.13.fc9.i386

  [F-10]$ rpm -qf /usr/include/drm/drm.h
  kernel-headers-2.6.27.5-117.fc10.x86_64

How reproducible:

  100%

Steps to Reproduce:
0. Compile any userspace software which uses drm/drm.h, without
   explicitly defining the __user and DEPRECATED macros, e.g.
1. git clone git://anongit.freedesktop.org/git/xorg/driver/xf86-video-radeonhd
2. cd xf86-video-radeonhd
3. ./autogen.sh
4. make
  
Actual results:

  Compile error in radeon_drm.h due to effects of undefined __user
  and DEPRECATED in code included from drm/drm.h

Expected results:

  Compiles.

Additional info:

  I guess we can also add workarounds to all userspace software which
  includes drm/drm.h... but that might be the wrong place to fix it.
Comment 1 Dave Airlie 2008-11-30 03:29:19 EST
this is a bug in the radeonhd driver, please don't bother us with it.

they include their own radeon_drm.h which they need to fix.

Note You need to log in before you can comment on or make changes to this bug.