Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 229452 - radeontool.c build error (pm-utils-0.19-3)
Summary: radeontool.c build error (pm-utils-0.19-3)
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: pm-utils
Version: 5.0
Hardware: x86_64
OS: Linux
Target Milestone: ---
: ---
Assignee: Phil Knirsch
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2007-02-21 08:03 UTC by Johnny Hughes
Modified: 2015-03-05 01:18 UTC (History)
5 users (show)

Fixed In Version: RHBA-2007-0538
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2007-11-07 16:44:01 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2007:0538 normal SHIPPED_LIVE pm-utils bug fix and enhancement update 2007-10-30 16:16:54 UTC

Description Johnny Hughes 2007-02-21 08:03:02 UTC
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 08:24:24 UTC
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 08:47:52 UTC
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 09:13:48 UTC
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 20:08:33 UTC
Thou Shalt Not Use PAGE_SIZE

Comment 6 Jos Vos 2007-04-30 20:16:57 UTC
Then it is a bug in pm-utils and the bug should be reopened for that package.

Comment 7 Jay Turner 2007-05-09 18:19:48 UTC
Reopening and assigning to pm-utils.

Comment 15 errata-xmlrpc 2007-11-07 16:44:01 UTC
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.

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