Bug 229452 - radeontool.c build error (pm-utils-0.19-3)
radeontool.c build error (pm-utils-0.19-3)
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: pm-utils (Show other bugs)
5.0
x86_64 Linux
medium Severity medium
: ---
: ---
Assigned To: Phil Knirsch
: Reopened
Depends On:
Blocks: 235665
  Show dependency treegraph
 
Reported: 2007-02-21 03:03 EST by Johnny Hughes
Modified: 2015-03-04 20:18 EST (History)
5 users (show)

See Also:
Fixed In Version: RHBA-2007-0538
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-11-07 11:44:01 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Johnny Hughes 2007-02-21 03:03:02 EST
the file radeontool-1.5/radeontool.c does not build on rhel5b2 x86_64.

The error is:
radeontool.c: In function ‘map_devince_memory’:
radeontool.c:98: error: ‘PAGE_SIZE’ undeclared (first use in this function)
radeontool.c:98: error: (Each undeclared identifier is reported only once
radeontool.c:98: error: for each function it appears in.)
radeontool.c:113: warning: cast from pointer to integer of different size
make: *** [radeontool] Error 1

(Also tried building pm-utils-0.19.1-6 from rawhide, same error).

That file (radeontool.c) has this line:

#include <asm/page.h>

and asm/page.h includes asm-i386/page.h OR asm-x86_64/page.h

asm-x86_64 does not define ‘PAGE_SIZE’, thus the error (asm-i386/page.h DOES
define ‘PAGE_SIZE’)

using asm-i386/page.h for testing, results in this error:

gcc -Wall -O2 radeontool.c -o radeontool
radeontool.c: In function ‘map_devince_memory’:
radeontool.c:113: warning: cast from pointer to integer of different size


So, how did you get radeontool.c (and pm-utils-0.19.3) to build on x86_64?
Comment 1 Johnny Hughes 2007-02-21 03:24:24 EST
This is with kernel-headers-2.6.18-1.2747.el5.x86_64 (which provides
/usr/include/asm, /usr/include/asm-i386, /usr/include/asm-x86_64)
Comment 2 Johnny Hughes 2007-02-21 03:47:52 EST
OK ... 

radeontool.c: In function ‘map_devince_memory’:
radeontool.c:113: warning: cast from pointer to integer of different size

(that is a warning ... the radeontool binary is created)

Looks like the error is that kernel-headers-2.6.18-1.2747.el5.x86_64 does not
have the proper /usr/include/asm-x86_64/page.h file.

This also looks fixed in newer versions of kernel-headers ... at least the ones
in FC6 and Rawhide.
Comment 4 Phil Knirsch 2007-04-17 05:13:48 EDT
Reassigning to kernel-headers as the problem is that in RHEL5 the
/usr/include/asm-x86_64/page.h looks like this:

#ifndef _X86_64_PAGE_H
#define _X86_64_PAGE_H


#endif /* _X86_64_PAGE_H */

Read ya, Phil
Comment 5 David Woodhouse 2007-04-30 16:08:33 EDT
Thou Shalt Not Use PAGE_SIZE
Comment 6 Jos Vos 2007-04-30 16:16:57 EDT
Then it is a bug in pm-utils and the bug should be reopened for that package.
Comment 7 Jay Turner 2007-05-09 14:19:48 EDT
Reopening and assigning to pm-utils.
Comment 15 errata-xmlrpc 2007-11-07 11:44:01 EST
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2007-0538.html

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