Bug 353821

Summary: [PATCH][IA64] xen build err, PAGE_SIZE and PAGE_SHIFT are undeclared
Product: [Fedora] Fedora Reporter: Zhan, Yi <yi.zhan>
Component: xenAssignee: Xen Maintainance List <xen-maint>
Status: CLOSED NEXTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: rawhideCC: agriffis, dchapman, jarod, prarit
Target Milestone: ---Keywords: Patch
Target Release: ---   
Hardware: ia64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-03-05 16:22:49 EST Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Bug Depends On:    
Bug Blocks: 163350, 418441    
Attachments:
Description Flags
fix the build error "PAGE_SIZE and PAGE_SHIFT are undeclared" none

Description Zhan, Yi 2007-10-26 06:02:36 EDT
Description of problem:
When rebuilding from the latest srpm, we got the following error and build failed: 

/usr/src/redhat/BUILD/xen-3.1.0-src/tools/ioemu/hw/xen_machine_fv.c: In function
'xen_init_fv':
/usr/src/redhat/BUILD/xen-3.1.0-src/tools/ioemu/hw/xen_machine_fv.c:225: error:
'PAGE_SIZE' undeclared (first use in this function)
/usr/src/redhat/BUILD/xen-3.1.0-src/tools/ioemu/hw/xen_machine_fv.c:225: error:
(Each undeclared identifier is reported only once
/usr/src/redhat/BUILD/xen-3.1.0-src/tools/ioemu/hw/xen_machine_fv.c:225: error:
for each function it appears in.)
/usr/src/redhat/BUILD/xen-3.1.0-src/tools/ioemu/hw/xen_machine_fv.c:235: error:
'PAGE_SHIFT' undeclared (first use in this function)
/usr/src/redhat/BUILD/xen-3.1.0-src/tools/ioemu/hw/xen_machine_fv.c:245: error:
'i' undeclared (first use in this function)

There are two problems in the file xen_machine_fv.c, which was added by the
patch xen-pvfb-01-qemu-fv-machine.patch :
1. A simple one, the variable 'i' is undeclared. 
2. PAGE_SIZE and PAGE_SHIFT are undeclared. 

I have worked out a patch to solve them. Since the /usr/src/include/asm/page.h
in IA64 is just dummy and I can't find any header file which defines the two
macros both in glibc_headers and kernel_headers, I have to use the getpagesize()
from <unistd.h> to get the page_size and then use ffs() from <strings.h> to get
the page_shift.

Version-Release number of selected component (if applicable):
xen-3.1.0-12.fc8.src.rpm

How reproducible:
always

Steps to Reproduce:
1. rpmbuild --rebuild xen-3.1.0-12.fc8.src.rpm
2.
3.
  
Actual results:
build error as described above

Expected results:
build cleanly

Additional info:

patch attached

The two marcos could be found both in /usr/include/asm/page.h and
/usr/include/sys/user.h. But in IA64, they are not there.
Comment 1 Zhan, Yi 2007-10-26 06:02:36 EDT
Created attachment 238751 [details]
fix the build error "PAGE_SIZE and PAGE_SHIFT are undeclared"
Comment 2 Prarit Bhargava 2007-10-26 09:37:35 EDT
Adding Jarod and Aron.

P.
Comment 3 Doug Chapman 2008-03-05 16:22:49 EST
xen still doesn't build but this is no longer the issue.  We have a new BZ open
for the current error.  We no longer see this particular issue.